Feedback wanted on code style

BlitzMax Forums/BlitzMax Beginners Area/Feedback wanted on code style

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.

Hi David,

Thanks for the feedback. I agree with you on the loop variable, my later versions have removed this (it was actually more like lazyness than concern for optimisation that saw me place it there - you know declare once then use anywhere - I've since slapped myself and I'm back to being more careful).

Yeah the capitalisation thing worries me - only because I'm used to coding in languages where case is important and with BlitzMax it's not. In general the method I'm used to (but still having trouble sticking to) is to use camel case, with lower case starts for all variables, all upper case for constants and starting with upper case for Types/classes. Not having had to deal with globals previously I'm uncertain as to whether I need to differentiate them from local or field variables - it would be nice if the BlitzMax IDE tracked variables in the code panel as well as the types and functions. I would also usually use lower case starts for function names - but the BlitzMax style capitalises all keywords and included functions so I've tried to do the same thing.

I do generally find ordering my functions/methods to be handy too - but I tend to group them more by function (eg: all the getter/setter calls together and all the draw functions together). But I generally try to keep my classes/types small so they are easily scanned through... which means I agree whole heartedly with your separate files for types. I'm a java coder from way back and I'm used to that methodology and it makes sense to me. I just wasn't sure it was a good idea with BlitzMax, so thank you for that.