FANDOM


Introduction Edit

Code practice is a combination of ways how code is organised. It is important to ceep your code clear, because the most problem is not to write a code, but to debug it. And if code is not well organised debugging may take much more time and it will not be readable for others or even yourself a month later.

Variables and function naming Edit

developers choosed a stile where full words are separated by minus, as "danger-time-limit", by following the same practice you may make your code slightly easier to understand.

Goto VS loops Edit

Many sucsesful side are using labels, which are equiwalent to goto in other languages. In general it is considered that goto is bad in almost all cases, especially if it "jumps" outside the one screen of code. Reason is that such code is extremely hard to debug, because program behave in a unpredictable way. But in grobots label using may save some processor work. It may be useful to initially write your code as loops and when code is debugged to change loops into goto in critical places to get some free processor actions.

Arrays VS shared memory VS variables Edit

the only available array is a processor memory, wich cost real resources, unlike shared memory and variables. Shared memory takes 3 actions to read/write a single variable and variables defined in code takes only one action to read/write them. There is also a theoretical way of using stack as an array with "pick" command to read. But stack is limited to 100 values and somwtimes up to 10 values are needed for current calculations. So at most you can expect to have 90 values array from a stack. it takes 2 actions to read such value and you cant easily write without having to rebuild the stack. return stack could be used only for reading/writng a top item and it is even more risky. If programm will try to return in a non valid adress nothing good will happen.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.