|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Saturday, May 04, 2013 4:28 PM
Points: 1,
Visits: 8
|
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Tuesday, October 30, 2012 10:37 AM
Points: 263,
Visits: 859
|
|
I think you can extend this ever further by saying you should take pride in your work. Good formatting and readability is just part of that. Besides, everyone is replaceable. Crafting pristine or sloppy code won't change that fact.
James Stover, McDBA
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Tuesday, May 14, 2013 12:59 AM
Points: 204,
Visits: 457
|
|
Its such an easy thing to do, but until you go start trying to maintain code that is poorly written, you'll never really understand WHY you should lay everything out nicely.
There are a number of tools on the market (or alternatively you could learn how to set Management Studio up properly) which will refactor your code, so basically I believe there's no excuse for poorly indented/laid out code.
I think every programmer should spend at least a year on maintenance prior to being allowed near a greenfields development!
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Tuesday, May 14, 2013 2:24 AM
Points: 1,871,
Visits: 2,692
|
|
Fully agree. Bad formatting is almost as ugly as bad coding. When handing over your code/work you should feel confident that any developer can look at it and be able to read/understand it.
I'm not saying it must be pretty, and spend more time on the looks rather than the functionality, but be proud of your work, not ashamed, and fear that it will come back to you because no one can read it.
---------------------------------------------- Msg 8134, Level 16, State 1, Line 1 Divide by zero error encountered.
|
|
|
|
|
Mr or Mrs. 500
      
Group: General Forum Members
Last Login: 2 days ago @ 7:35 AM
Points: 515,
Visits: 1,016
|
|
| It's easy to do and only those with no drive or ambition make themselves indispensable - who wants to be slogging away with the same old code in 5 or 10 years time??
|
|
|
|
|
SSCrazy Eights
        
Group: General Forum Members
Last Login: Today @ 6:51 AM
Points: 9,373,
Visits: 6,470
|
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, October 02, 2012 6:14 AM
Points: 4,
Visits: 53
|
|
| One of my colleagues just tested SQL Prompt, it adds a button "Format code". So the formatting is done automatically according to default or custom rules. I used to do formatting by hand, but I'm considering moving to this tool, because it will save a lot of time.
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 1:53 AM
Points: 29,
Visits: 115
|
|
I have had to spend hours re-formatting badly set out code to make it readable before I even stand a chance of understanding what it does. Some of it I had written when I was less experienced.
So, please, set you code out neatly and comment it thoroughly. You will save yourself and others a lot of work in the future. Or do you want to get phone calls on holiday from junior programmers who are pulling their hair out trying to understand your code?
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Friday, November 16, 2012 3:47 AM
Points: 290,
Visits: 988
|
|
Interesting that you'd bring this up. Often when I see bad sql code it's done by someone who never took the time to learn sql but focuses on vb/ java/ c or c#. There it's more common with bad coding standards I'd say from my experience. What do you think? I also think it's more common with this type of code from people who wants to have fun more then having fun while taking pride in doing it proper. Often the later also makes faster code as a side bonus.
I changed a sql script from taking 3 hours down to 40 seconds. That was such a person. And guess what, cursor was involved, but the time consuming part was not the cursor but how the select statements were made.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Tuesday, October 02, 2012 6:14 AM
Points: 4,
Visits: 53
|
|
|
|
|