• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Spaces or Tabs

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

    #31
    Originally posted by NickFitz View Post
    Ugh - why on a new line?
    Because it improves readability, maintainability clarity... A curly brace on the same line makes a hideous mess of the code, so why do it? The first thing I do when I have to read code looking like that is to structure it properly. Not doing so just makes deciphering it unnecessarily difficult.

    I had this discussion with somebody at a client a few years ago. I ended it by saying "Fine, you do it that way; I'll do it the right way."
    Amateur

    You'd really prefer something hideous looking such as:

    Code:
    for(i = 0; i < 10; i++) {
         if(i % 2 == 0) {
             doSomething(i);         
             doSomethingelse(i); 
             etc; }}
    over :
    Code:
    for (i = 0; i < 10; i++) 
    {
        if (i % 2 == 0) 
        {
             doSomething(i); 
             doSomethingelse(i); 
             etc;
        }
    }

    Comment


      #32
      Originally posted by TimberWolf View Post
      Because it improves readability, maintainability clarity... A curly brace on the same line makes a hideous mess of the code, so why do it? The first thing I do when I have to read code looking like that is to structure it properly. Not doing so just makes deciphering it unnecessarily difficult.
      WHS

      Originally posted by NickFitz View Post
      I had this discussion with somebody at a client a few years ago. I ended it by saying "Fine, you do it that way; I'll do it the right way."
      I have a similar running "jest" with a friend of mine, albeit his/your way are obviously the wrong way
      Where are we going? And what’s with this hand basket?

      Comment

      Working...
      X