• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Coding Standards

#1
I tried posting this in the Developer Resources but I could not. If the mods see fit to move this topic please do.

My question is whether there is or there will be a coding standards document that xenForo uses and xenForo modifications should abide to. I understand that it will be difficult to 'police' this when more and more modifications/plugins start rolling in, but it does set the tone and does help in the long run.

One small example that I can give you is the use of tabs vs. spaces on code written in plugins. Also what is the default tab? 4 spaces or 8?

Something like that would help IMHO.
 
#5
Btw, the tab size of "4" or "8" is determined by the text editor or IDE that you are using.
It's just stored as a single tab (0x09) in your file.
True but tabs differ in different operating systems. I have used that just as an example.

Thank you for the links!
 
R

ragtek

Guest
#6
True but tabs differ in different operating systems.
Really?
Didn't know this, always thoutht that's some random stuff which is handled by the ide. (if it's really true, nice to know that there are some standards)
 

Shadab

Well-known member
#7
Well, I think he confused tabs with line breaks, which can very well vary (\n versus \r\n).

I haven't read about any OS which handles tabs (0x09 hex code) in any different way.
And if there's one, I'm yet to see any religious war thread "discussing" it. :D
 
#8
Actually I did not confuse them with line breaks. I meant tabs. They are a function of the IDE as some have posted but it is also a matter of OS. I have seen numerous times files saved on my Windows system to be horribly indented when opened in Linux. This is one of the reasons that one uses spaces vs. tabs.

Thanks again for the links.