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

Coding Standards

Discussion in 'XenForo Pre-Sales Questions' started by niden.net, Dec 4, 2010.

  1. niden.net

    niden.net Member

    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.
  2. Brogan

    Brogan XenForo Moderator Staff Member

    The Developer Resources forum is for licensed customers only so I've moved this to Feedback.

    Kier did post some very high level guidelines here: http://xenforo.com/community/threads/add-on-id-guidelines.6394/

    Nothing specific has been produced at this time though.

    Regarding the point you raise, I expect most people just use the standard tab which equates to 4 spaces.
  3. Shadab

    Shadab Well-Known Member

    Brogan likes this.
  4. niden.net

    niden.net Member

    Thank you.​
    I have some suggestions that I can post later on.​
  5. niden.net

    niden.net Member

    True but tabs differ in different operating systems. I have used that just as an example.

    Thank you for the links!
  6. ragtek

    ragtek Guest

    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)
  7. Shadab

    Shadab Well-Known Member

    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. niden.net

    niden.net Member

    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.
  9. dieketzer

    dieketzer Well-Known Member

    thats cos windows is... windows :p

Share This Page