It has been a year and a half, and I think I have made lots of progress on this!
Here is a description of the style I've went with:
-Local variables are in lower case. Words are separated by the underscore character "_". e.g "blue_berry"
-Class member variables follow the above rule, except that they start with the underscore character "_". e.g "_blue_berry"
Format:
After rereading this thread, it turned out there was one thing I left out, and that was the character per line limit =(. But I hope I will be able to get used to that as well.
Some other paradigms I follow:
Finally, class files for stuff I've written recently (perhaps you could give it a skim and see if there you catch something I can improve):
http://pastebin.com/2YSsnLCG #AExpression.h
http://pastebin.com/KmDzFgx6 #AExpression.cpp
http://pastebin.com/R6RWcKTE #AScope.h
http://pastebin.com/WmWFuuWr #AScope.cpp
I am still not the best with for loops and such, but I try to attain a balance between my focus on what the code does and its readability.
I'd be interested in listening to newer guys' opinions on this topic also.
Here is a description of the style I've went with:
-Local variables are in lower case. Words are separated by the underscore character "_". e.g "blue_berry"
-Class member variables follow the above rule, except that they start with the underscore character "_". e.g "_blue_berry"
Format:
- Class names are in upper camel case. e.g: "ObjectInstance".
- Functions which are in global scope are in camel case and first letter capitalized. e.g: "UpdateMode()"
- Class member function are in camel case, but the first letter isn't capitalized. e.g: "renderEntities()"
- Global variables / preprocessor defined values are in ALLCAPS.
After rereading this thread, it turned out there was one thing I left out, and that was the character per line limit =(. But I hope I will be able to get used to that as well.
Some other paradigms I follow:
- Longer self-explanatory variables all the way. While that can make a line of code much longer than it could be, I try not to use 1 character variable name ("i", "j"..etc in for loops) except in cases where the block of code is short enough.
- Not to use the default constructor when writing classes but get an "init()" function instead which takes the parameters and does the construction/initialization for you.
Finally, class files for stuff I've written recently (perhaps you could give it a skim and see if there you catch something I can improve):
http://pastebin.com/2YSsnLCG #AExpression.h
http://pastebin.com/KmDzFgx6 #AExpression.cpp
http://pastebin.com/R6RWcKTE #AScope.h
http://pastebin.com/WmWFuuWr #AScope.cpp
I am still not the best with for loops and such, but I try to attain a balance between my focus on what the code does and its readability.
I'd be interested in listening to newer guys' opinions on this topic also.
![[Image: signature.png]](http://s3.postimg.org/wedqxlk3n/signature.png)
A-Engine: A new beat em up game engine inspired by LF2. Coming soon
A-Engine Dev Blog - Update #8: Timeout

Chat

![[Image: ZucdcMY.png]](https://i.imgur.com/ZucdcMY.png)

