![]() Home |
![]() Map |
![]() OS++ Down Load |
![]() Doco_A |
![]() Youtube |
![]() Chat |
![]() News |
![]() Shop |
TLDR; The top line, is a standard declaration using the format (CODE.org/STANDARD/GRADE). You are using this declaration to notify future readers that the following code is written in OS++, with the 2022 syntax standard. But while the code works satisfactorily, it is technically inferior, resource expensive or just not scalable.
The declaration just happens to be an HTML link, which has more information.
Format | What it means | Notes |
---|---|---|
CODE.org | Is the code language type | OS++ |
STANDARD | Is the year of the standard | 2022 |
GRADE | Means the code grade or quality | Requires attention |
For a list of standard declarations and a better explanation. Please visit http://osplusplus.org/2022standard/professional
To see the Language documentation for this language. Please visit http://osplusplus.org/2022doco
TLDR; Kludge, Declaring it works, but it’s not a pretty solution
If you make this declaration, it is important to outline the nature of the Kludge so it can be corrected later. A quick REM at the top of the code is sufficient. After all you are the expert in this area and you need to alert other stake holder as to the nature of the situation.
This declaration allows a professional programmer to flag code as being inferior and to solicit advice from the community.
Kludge is where a procedures is just wrong. You feel it in your bones. But it works. You are not proud of this. Please note that some Kludges are the best way to solve a problem with the technology at hand. Time will be the final arbiter.
OS++; started life as a openscad cube module that could be rendered like a cylinder. A cube grows from X=0,Y=0,Z=0. A cylinder grows from the X=Middle of shape, Y=Middle, Z=0. So a cube that could be rendered like a cylinder would grow from MM0. I called the module lib_cube_MM0(X,Y,Z). Soon I wanted to render a cylinder and a sphere like a cube ie from 000. This resulted in lib_sphere_000 and lib_cylinder_000. But if a 0 is the first point, and M is the middle point. What is the Last point? I decided “9”. The last digit in the decimal system.
Now, Since we have 3 axis. Each with 3 points. We have 3^3 or 27 cubes, sphere and cylinder modules. A total of 81 modules ie 333. I used awk and bash to generate all the modules, starting at “000” and ending “999”. This was quite a large library. This was a kludge (the library, not it’s generation method). It’s called “inline programming”. Essentially rather than loops,functions and variables you just lay out the code, in a long list. This Kludge worked well. It was fast. And it allowed me to test the concepts and get on with 3dprinting. However it was not scalable. Later versions used more characters. If 0,M,L (which replaced 0,M,9), from the initial code, is considered a base 3 system, then the latest generation supports base 12 (A,B,C…L), and base 10. Let’s forget about p&P and you have 23 chars (0,M,L,1-9,A-K) for each axis. 23^3= 12,167 different procs for cuboid alone before you include all the different Rcuboids. Therefore this programming technique, that I used in generation 1 was a kludge as it could not be used in later generations.
TLDR; I used inline programming on the first generation of code. This was a Kludge as it worked well in that situation. But it was not scalable to the later generations. The process of declaring code as a Kludge, allows a programmer to ask for help and get input on making their code better. Since I work alone, that someone is an older and “wiser me”.
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|