PDA

View Full Version : Code Standards



Hobbit
03-05-2013, 05:58 AM
Some people are going over the same parts changing standards back and forth so we are going to standardize our code! (Based off SRL Dev Standards)


i (or any variable) when used in the context of a for loop is always lowercase
and bolded words (keywords like if, then, begin, end, for, function, procedure) are to be all lowercase
CONSTANTS should be all caps (With underscores where normal camel case would go, ie: CONST_NAME)
variables are camel case with the first letter always lower case (ie: exampleVariable)



Its late and this is all that comes to mind atm but I will post more as I see it. Don't waste time scouring through the code to fix it, but if you come across it, fix it and just keep this in mind going forward :)

(Was certain we had a thread in dev listing out everything but i cant find it atm)

Here is a thread that will be helpful, not the one I was meaning but still good http://villavu.com/forum/showthread.php?t=60288

Justin
03-05-2013, 06:00 AM
Some people are going over the same parts changing standards back and forth so we are going to standardize our code! (Based off SRL Dev Standards)


i (or any variable) when used in the context of a for loop is always lowercase
and bolded words (keywords like if, then, begin, end, for, function, procedure) are to be all lowercase
CONSTANTS should be all caps (With underscores where normal camel case would go, ie: CONST_NAME)
variables are camel case with the first letter always lower case (ie: exampleVariable)



Its late and this is all that comes to mind atm but I will post more as I see it. Don't waste time scouring through the code to fix it, but if you come across it, fix it and just keep this in mind going forward :)

(Was certain we had a thread in dev listing out everything but i cant find it atm)

Sorry if any was on my part, I was un-aware of all the Code Standards, If you could copy-paste that listing thread (If you ever find it) that would be great.

YoHoJo
03-05-2013, 06:03 AM
I think you mean bold words need to begin with a capital letter? :D

Hobbit
03-05-2013, 06:06 AM
I think you mean bold words need to begin with a capital letter? :D

NO! NEVER!

Its actually against GNU pascal standards not just ours :p
http://www.gnu-pascal.de/h-gpcs-en.html#Capitalization

Added link to first post.

Le Jingle
03-05-2013, 06:25 AM
Love it! Glad to see I'm not too far off the ball from the Code Standards :]
I know it's common to make small mistakes and what not, I accept my faults for those too ;]

Ashaman88
03-05-2013, 12:13 PM
Lowercase is boring :P

But I think I followed this for the include, sorry if I missed something and thanks for the reminder!

DannyRS
03-05-2013, 12:16 PM
Sorry if I changed anything like that by accident ;)

I kept 90% of my changes the way they were from the original dev, e.g. Nobody in gametab used constants as all caps :/

I'll try make sure to do the camel thing from now on :p

I'm not that far off :)

Edit* - Offtopic ^^^ what the hell wake up to mass cups? :O

Ashaman88
03-05-2013, 12:25 PM
Sorry if I changed anything like that by accident ;)

I kept 90% of my changes the way they were from the original dev, e.g. Nobody in gametab used constants as all caps :/

I'll try make sure to do the camel thing from now on :p

I'm not that far off :)

Edit* - Offtopic ^^^ what the hell wake up to mass cups? :O

hax!!!! well deserved :)