underst
Method ModifierThe underst
modifier (@Underst
in the Clprolf framework) is used to mark methods whose implementation is not straightforward.
It highlights algorithms that are non-trivial, where the way a computer solves a task is different from how a human would naturally reason about it.
underst
means “understanding”.Even with human-like algorithms (such as those written in Algol-like languages), it is sometimes tricky to express jobs for the computer. A classical example is sorting: while humans sort in a very direct way, computers need a step-by-step algorithm.
Consider the bubble sort algorithm.
This approach is efficient for the computer, but it is not the intuitive human way.
Therefore, the method should be marked with underst
to indicate that the implementation is more technical than natural.
public agent BubbleSorter {
private int[] theElements;
public int[] getElements() {
return this.theElements;
}
public BubbleSorter(int[] theArray) {
this.theElements = theArray;
}
public underst void sort() {
// Non-trivial algorithm here
}
}
@Agent
public class BubbleSorter {
private int[] theElements;
public int[] getElements() {
return this.theElements;
}
public BubbleSorter(int[] theArray) {
this.theElements = theArray;
}
@Underst
public void sort() {
// Non-trivial algorithm here
}
}
underst
.Behind the underst
modifier lies Clprolf’s philosophy of keeping implementations simple and explicit:
underst
.This ensures that all Clprolf code remains understandable, regardless of its complexity.