How do you write code?
A:
if (this==statement) {
code = 1;
if (this==another) {
moar = 2;
}
}
B:
if (this == statement)
{
code = 1;
if (this == another)
{
moar = 2;
}
}
C:
if (this == statement)
{
code = 1;
if (this == another)
{
moar = 2;
}
}
Notice I put semicolons after every assignment, because it is good practice.
I also put "==", even though this isnt required in game maker, its required in other languages. Probably because you can assign variables within statements in other languages.
Personally I code in A, but i think the most legible and widely used is B.
What would be cool is if there was an option in game maker to clean their code up to standards, for learning purposes.
In other news, YOYOgames is starting to go bankrupt. Which i find hallarious.
heres the link:
yoyogames
To anyone who codes like as in A: wtf - it's not even listed here
…except whenFirestormXAG (or you) actually mean this:Also, the indent styles have names:
http://en.wikipedia.org/wiki/Indent_style*mutters* "A" is so annoying.
I prefer the Java style, and the 80-column rule.
I hate putting if () clauses on multiple lines, but seeing it done makes sense sometimes. I just really don't like it when every single clause gets a new line (one developer at my work does this, and when I'm analyzing his code, it nags at the back of my mind). Like this:
B - and I add extra lines between sections to make code more readable.
Both A and B, depending on the alignment of Jupiter and Saturn
I use a format similar to B.