Organizing code

Blitz3D Forums/Blitz3D Programming/Organizing code

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Being relatively new to Blitz AND 3D (although been programming for most of my 30+ years life!), I have found significant speed increases have only come from optimising my algorithms and methods i.e. by finding more effecient methods of accomplishing the same task (the slow bubble sort metioned above is a good example).

I did spend quite a bit of time messing with some of the different methods of 'writing' code and generaly found the differences to be negligible when compared to getting the 'method' correct. A good method can give a ten fold speed improvement. Optimising the way you 'write' your code may be good for a few percent at best.

Also, from many years of experience (jeez, I'm an old git!), its far more important to keep your code clear and readable. This is why functions were 'invented' and allow programmers to reliably program larger and more difficult tasks. Functions were added for a reason, and it was not 'just' to slow down code! The only exception is perhaps optimising any routines that are performed 100's of times a second where small speed increases can add up.

Rhy Out