HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Codestyle

2»

Comments

  • LincLinc Detroit Admin

    Tim's Lord Brackos comment basically won the war. We're keeping the same-line open brace and we have made it canon: http://docs.vanillaforums.com/developers/contributing/standards/

  • businessdadbusinessdad Stealth contributor MVP
    edited May 2014

    @lumio said:
    Nice :) I'm not really happy with 4 spaces, but thats matter of tase ;)

    And I detest the camelCase, it's one my pet peeves. I think that coding is like a bite like shoes, to everyone their own. :)

    Oh, and tabs all the way. :D I got used to them from the day I got to work with teams where some people demanded 2 spaces, others wanted 4 spaces and so on. I just have to set the tabs to be the amount of spaces I like, I see everything with 2, 3 or 1437 spaces, my colleague can do the same and everyone sees stuff the way they like. It's a matter of getting used to things, after all.

    By the way, I work extensively with WordPress as well. When I first started with it, I went through the coding guidelines, made a list of them and then worked away to "adopt" them:

    • Nope...
    • Nope...
    • Nope...
    • Ok
    • Nope...
    • Nope...

    :D:D:D

  • businessdadbusinessdad Stealth contributor MVP

    @Tim said:
    StegosaurusCase for ClassDefinitions, ExceptionNames
    camelCase for functionNames, methodNames, $variableNames
    ELEPHANT_CASE for GLOBAL_CONSTANTS, CLASS_CONSTANTS

    Beer case to survive them all.

  • peregrineperegrine MVP
    edited May 2014

    http://docs.vanillaforums.com/developers/configuration/

    Editing configuation

    should be

    Editing configuration

    unless your name is Elmer Fudd

    using the same AlphaBetaCamel Capitalcase typing standards.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Now one last thing: What about DocBlocks? Are they coming in as well? (ala Doxygen style)

  • LincLinc Detroit Admin

    @lumio We already use DocBlocks, albeit inconsistently. We're getting better.

  • ShadowdareShadowdare r_j MVP
    edited May 2014

    I like having camel case for the naming conventions. On the contrary, I also don't mind inline control structures with no braces if there's only one statement in the structure and don't mind having no spaces after keywords in control flow statements.

    I've installed and set up PHP CodeSniffer with PHPStorm. I'm looking forward to seeing the code get updated to match the new standards.

    Add Pages to Vanilla with the Basic Pages app

  • LincLinc Detroit Admin

    What you're really witnessing is Vanilla reaching the level of comfort where we have time to invest in things like CodeSniffer implementations and coding standards meetings. :)

Sign In or Register to comment.