hello,

I may have to hire a programmer in a couple of months and I'd like to get him to use coding standards (php). I just would like to plan the future and make sure an additional programmer would understnad the code.

and to be honest: givent the volatility of these guys where I live it's like a life insurance policy 😉

As I dont have any coding standards right now, I was wondering whether any of you would know where to download good ones 🙂

thanks!

    I suggest using the phpBB3 Coding Guidelines as a reference document.

    Among the areas listed, some which frequently come under contention are:
    1. Use of tabs versus spaces for indentation level
    2. Number of spaces for indentation level
    3. Placement of braces
    4. Usage of braces where they are optional
    5. Hungarian notation
    6. Underscores versus camel case for identifier names
    7. Spaces between tokens
    8. Alignment of multiline statements
    9. Usage of parentheses where they are optional

    You should check to see what your current code is like with respect to these issues and decide accordingly (or change your current code if need be). For many of these issues it does not actually matter which way is decided, so long as it is consistently used.

      thanks to both of you.

      i'll check these 2 out 🙂

        I think coding standards should focus on things other than layout and naming. Like making sane code.

        Layout and naming are all very well, but they are not the only things.

        I also HATE hungarian notation, it is irredeemably broken and should never be used. It also makes your code look like an idiot wrote it.

        Mark

          MarkR wrote:

          I think coding standards should focus on things other than layout and naming. Like making sane code.

          Layout and naming are all very well, but they are not the only things.

          Definitely agree

          I also HATE hungarian notation, it is irredeemably broken and should never be used. It also makes your code look like an idiot wrote it.

          Mark

          LOL -- I just love the way your world is so black-and-white with never a middle ground on any topics for which you care to share your opinions here. :p When you say you don't like Hungarian notation, are you just referring to the practice of using "camel back" notation with the lowerAndUpperCase letters instead of names_with_underscores, or the full-fledged Hungarian notation that includes starting each name with specific lower-case letters indicating the variable's type and/or other general information (e.g. "$uiSomeName" for an unsigned integer)?

            Write a Reply...