(03-09-2014, 02:18 PM)zomgwtfbbq Wrote: I think everything is mentioned already.
1- Use tabs instead of spaces, tabs are universal and work the same in every editor
2- comments should be straightforward, don't use too much and keep it clear(when you share the program make sure it's in english)
I sort of disagree with 1 and 2...
In python and Greek mythology, indentation [should,has to,must,is preferred to,recommended to,...] be 4 spaces, now you might think: "Why is this guy talking about python while we are talking about PHP! eh? What a Dum Dum!!!"
Well... I don't know why! But I know this: when I edit a code using vim or notepad, 4 spaces (or x number of spaces) is a better "standard" than a tab, as each editor (as you may already know) define a tab differently, yes good people of earth... they do that! And sometimes the results are extremely annoying... (and has bad effects such as vomiting and high blood pressure)
OK, about 2, what is too much? we've been taught all our life to comment our code
heavily... one bad thing about open source projects is comments! People when coding think that we will just understand this:
Code:
akjshbediu = 17981.234; // this is the (x to m) alpha I was talking to mike the other day
Or
Code:
adkjhku_33234("Hello world\n", &askdj, &my_var91378); //wrap it up
I actually found some of the comments like those I mentioned above... in fact i broke a keyboard once because of this! (I was really mad!)
So... I think that you should set a rule about spacing, and don't worry about
over commenting the code, at the end ... modern editors can fold them!
Thanks