??Spoken Form Programming
There are well known impediments for novice programmers to continue developing their programming and algorithmic skills:
to name a few.
Most novice programmers are unable to overcome these archaic structures and the difficulties they present which require careful manipulation of symbols and countless hours of debugging to learn how to manage their rigid structures.
In this article we focus on our attention on applications of Spoken Form Programming for for( ) statements.?
For weekly API and programming updates and discussions and example please join Linked In group:
To enquire about the Free Form Programming Language and CCN’s certified training including Unity certification please contact [email protected]
for( ) in C#
Simplest possible example of for( ) statement in C#:
for (int i = 0; i < 10; i++)
{
//do something for each +1 increment of i
foo(i);
}
Source: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/iteration-statements
Gets far worse if increments are fractional and between two arbitrary numbers:
float a, b;
d = (b-a)/10f;
for (int i = 0; i < 10; i++)
{
//do something fractional increment d between a and b
foo(a + i*d);
}
While Free Form Programming Language does provide such primitive syntax, it offers a Free Form alternative version:
list = in the -5 to 7 range at increments of 0.02 evaluate foo;
list = evaluate foo in the -5 to 7 range at increments of 0.02;
list = in the -5 to 7 interval evaluate foo at increments of 0.02;
list = at increments of 0.02 evaluate foo in the -5 to 7 range;
list = from -5 to 7 at increments of 0.02 evaluate foo;
list = in the -5 to 7 interval evaluate foo at increments of 0.02;
list = in -5 to 7 range at increments of 0.02 evaluate foo;
...'s action
Spoken Form has no boundary thanks to the human reuse of Free Form expressions. For example we tasked our students to design different styles of stairways. Spiral stairways is one of many and delivers good challenges to the novice designers.
领英推荐
stair = cuboid with pmin at ({4., 0., 0.}), pmax at ({8., 2.4, 0.8});
2. '...'s action' is an innovative lingual construct to a) clarify the actions applied to an object e.g. make it animate , b) describes the actions in Spoken Form:
stair's action = rotate around z by t then move along z by 2.5*t;
Free Form programmers are taught as any engineering or physics or math students are taught to envisage the parameter ‘t’ as passage of time , in our case time in the sense of animation.
3. '0 to 10 range' is the range for the parameter 't' of the animation and yet no need for the Free Form programmers to bother with their redundant mention.
stairs = place 100 stair in the 0 to 10 range;
Students at first design a simple movement of a 2D rectangle along the x-axis. Quickly they do realize that manually moving the objects is tedious with unnecessary repetitive code.
And they also learned how to rotate an object around a point and again the same observation that without using a proper abstract for looping such repetitive applications are impossible to? manually manage.