Announcement

Collapse
No announcement yet.

What Style Do You Code?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #46
    Originally posted by Cyborg from DH
    The vBulletin coding standards are more or less the same as yours, with a few exceptions I have noted:
    1. All loops and branches are surrounded with braces, even if they only contain a single line statement.
    2. All operators are surrounded with spaces

    Comment


    • #47
      I'd love to seem them Kier ^^

      Do you think you could post them up?

      Regards,
      - Dean
      Dean Clatworthy - Web Developer/Designer

      Comment


      • #48
        This is the current rough copy:

        http://www.vbulletin.com/vbdocs/vbul..._standards.htm

        Comment


        • #49
          Originally posted by Kier
          Thats right, tease us with the vbdocs directory

          Comment


          • #50
            That made a nice read Kier Thankyou!
            Dean Clatworthy - Web Developer/Designer

            Comment


            • #51
              PHP Code:
              if (condition)
              {
                   
              // do something here
              }
              else if (
              condition)
              {
                   
              // do something else
              }
              else
              {
                   
              // final action

              I use style 5 simply because when it comes to reading it its that slight bit easier to understand and also its just a habit for me to make all my code as clear as possible

              Comment


              • #52
                I am curious why you want $userinfo["$field"]; to be done (quoting the array key variable)?

                Just wondering.

                Comment


                • #53
                  Originally posted by Cyborg from DH
                  I am curious why you want $userinfo["$field"]; to be done (quoting the array key variable)?

                  Just wondering.
                  Note that $var = $array[$key]; will cause a parse error if $key is not quoted and is a negative integer, and will cause a notice if $key is a string and is unquoted.
                  ....

                  Comment


                  • #54
                    What version of PHP is that? I can't reproduce either of those problems...

                    (error_reporting = E_ALL)

                    Comment

                    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                    Working...
                    X