Comments on: Software Development Considered Harmful http://tleaves.com/2004/08/05/software-development-considered-harmful/ Creativity x Technology Sat, 17 Mar 2012 05:09:58 +0000 hourly 1 http://wordpress.org/?v=3.3.1 By: binaryLes http://tleaves.com/2004/08/05/software-development-considered-harmful/comment-page-1/#comment-531 binaryLes Tue, 19 Oct 2004 14:38:47 +0000 http://tleaves.com/?p=161#comment-531 >I'd believe the comment regarding expections if in >my past I hadn't seen things like this before: > >try { >/* my entire program that ignores exceptions */ >} catch { >print("something bad happened"); >} just because you give a man a shovel, doesn't mean he is going to use it to dig, many shovels make good leaning posts for the lazy. >I’d believe the comment regarding expections if in >my past I hadn’t seen things like this before:
>
>try {
>/* my entire program that ignores exceptions */
>} catch {
>print(“something bad happened”);
>}

just because you give a man a shovel, doesn’t mean he is going to use it to dig, many shovels make good leaning posts for the lazy.

]]>
By: OdeToCode Link Blog http://tleaves.com/2004/08/05/software-development-considered-harmful/comment-page-1/#comment-533 OdeToCode Link Blog Sun, 12 Sep 2004 14:11:55 +0000 http://tleaves.com/?p=161#comment-533 <strong>Software Development Considered Harmful</strong> Software Development Considered Harmful

]]>
By: OdeToCode Link Blog http://tleaves.com/2004/08/05/software-development-considered-harmful/comment-page-1/#comment-532 OdeToCode Link Blog Sun, 12 Sep 2004 14:11:43 +0000 http://tleaves.com/?p=161#comment-532 <strong>Software Development Considered Harmful</strong> Software Development Considered Harmful

]]>
By: mowry86 http://tleaves.com/2004/08/05/software-development-considered-harmful/comment-page-1/#comment-530 mowry86 Wed, 11 Aug 2004 20:07:10 +0000 http://tleaves.com/?p=161#comment-530 I'd believe the comment regarding expections if in my past I hadn't seen things like this before: try { /* my entire program that ignores exceptions */ } catch { print("something bad happened"); } I’d believe the comment regarding expections if in my past I hadn’t seen things like this before:

try {
/* my entire program that ignores exceptions */
} catch {
print(“something bad happened”);
}

]]>
By: Tom Ault http://tleaves.com/2004/08/05/software-development-considered-harmful/comment-page-1/#comment-529 Tom Ault Tue, 10 Aug 2004 02:54:31 +0000 http://tleaves.com/?p=161#comment-529 >3a. Functions that return void >This is my pet peeve. Declaring a function to >return void translates to "for all eternity I >hereby declare this function will always >succeed." This isn't true for languages that provide exceptions. In fact, if your language provides exceptions, you should use them to signal error conditions rather than relying on the caller to check a status code, becuase they force the caller to deal with the error in some manner rather than just ignoring it. >3a. Functions that return void

>This is my pet peeve. Declaring a function to
>return void translates to “for all eternity I
>hereby declare this function will always
>succeed.”

This isn’t true for languages that provide exceptions. In fact, if your language provides exceptions, you should use them to signal error conditions rather than relying on the caller to check a status code, becuase they force the caller to deal with the error in some manner rather than just ignoring it.

]]>
By: Vanessa http://tleaves.com/2004/08/05/software-development-considered-harmful/comment-page-1/#comment-528 Vanessa Sun, 08 Aug 2004 00:38:54 +0000 http://tleaves.com/?p=161#comment-528 (Insert religious zealotry about the superiority of BoundsChecker over Purify. YMMV). Yes, about the profiling for speed. I would say this even stronger than you did, that in my experience most assumptions about what code is causing slowness are just plain wrong. Use a profiler, or put in your own instrumentation and get the facts. C++ specific - make your destructors virtual by default. You may not remember to change the signature when you subclass three years later. (Insert religious zealotry about the superiority of BoundsChecker over Purify. YMMV).

Yes, about the profiling for speed. I would say this even stronger than you did, that in my experience most assumptions about what code is causing slowness are just plain wrong. Use a profiler, or put in your own instrumentation and get the facts.

C++ specific – make your destructors virtual by default. You may not remember to change the signature when you subclass three years later.

]]>
By: Faisal http://tleaves.com/2004/08/05/software-development-considered-harmful/comment-page-1/#comment-527 Faisal Fri, 06 Aug 2004 18:24:11 +0000 http://tleaves.com/?p=161#comment-527 7.a. if you are using code reviews, understand the goals, and make sure you have the right kind of review for the goal. are you using reviews to make sure idiots don't check in dumb code (code reviewed by a small senior team), reviews to make sure you are writing good code (stand up in front of everyone and do a walkthrough), or reviews to make sure new code makes sense with old code (approval of last few people to touch that codebase and/or the architects of said codebase). 7.b. make sure your tools cooperate with and/or enforce your development process rather than fighting it. 8.a. if you have access to more than one compiler, use both for testing. different compilers catch different code issues. 9. in comments, document intent as well as behavior. this makes it easier for people who do read comments to understand how to write to the interface so that all hell doesn't break loose if you change the behavior. 7.a. if you are using code reviews, understand the goals, and make sure you have the right kind of review for the goal. are you using reviews to make sure idiots don’t check in dumb code (code reviewed by a small senior team), reviews to make sure you are writing good code (stand up in front of everyone and do a walkthrough), or reviews to make sure new code makes sense with old code (approval of last few people to touch that codebase and/or the architects of said codebase).

7.b. make sure your tools cooperate with and/or enforce your development process rather than fighting it.

8.a. if you have access to more than one compiler, use both for testing. different compilers catch different code issues.

9. in comments, document intent as well as behavior. this makes it easier for people who do read comments to understand how to write to the interface so that all hell doesn’t break loose if you change the behavior.

]]>
By: mowry86 http://tleaves.com/2004/08/05/software-development-considered-harmful/comment-page-1/#comment-526 mowry86 Fri, 06 Aug 2004 14:41:57 +0000 http://tleaves.com/?p=161#comment-526 3a. Functions that return void This is my pet peeve. Declaring a function to return void translates to "for all eternity I hereby declare this function will always succeed." It is rare when you can actually make this claim and even rarer that it remains true over time. Save us all the effort, declare your function to return a value - we'll add the error handing up front and then in six months when you update the function we'll both be glad you chose the higher calling. 3a. Functions that return void

This is my pet peeve. Declaring a function to return void translates to “for all eternity I hereby declare this function will always succeed.” It is rare when you can actually make this claim and even rarer that it remains true over time. Save us all the effort, declare your function to return a value – we’ll add the error handing up front and then in six months when you update the function we’ll both be glad you chose the higher calling.

]]>
By: peterb http://tleaves.com/2004/08/05/software-development-considered-harmful/comment-page-1/#comment-525 peterb Fri, 06 Aug 2004 05:03:58 +0000 http://tleaves.com/?p=161#comment-525 I don't think it's a recipe for disaster. It might be a recipe for that particular build failing, but obviously if you have some limitation that makes some particular guideline I give inapplicable -- such as "the people who wrote this kernel were idiots, so their header files puke warnings when you compile with all warnings turned on," then you modify your behavior accordingly. Your point is a really good example, by the way, of how lousy code begets more lousy code. Somewhere there's a guy writing a kernel device driver who wants to write good code, but because some nameless kernel *cough*LINUX*cough* is dripping with garbage and won't build with -Werror -Wall, he basically _can't_ use the robots to help him write good code. I feel sorry for that guy. I bet he wishes that the people that wrote those kernels had done their jobs properly. If they had, he'd be able to use better tools to help him write better code. I don’t think it’s a recipe for disaster. It might be a recipe for that particular build failing, but obviously if you have some limitation that makes some particular guideline I give inapplicable — such as “the people who wrote this kernel were idiots, so their header files puke warnings when you compile with all warnings turned on,” then you modify your behavior accordingly.

Your point is a really good example, by the way, of how lousy code begets more lousy code. Somewhere there’s a guy writing a kernel device driver who wants to write good code, but because some nameless kernel *cough*LINUX*cough* is dripping with garbage and won’t build with -Werror -Wall, he basically _can’t_ use the robots to help him write good code.

I feel sorry for that guy. I bet he wishes that the people that wrote those kernels had done their jobs properly. If they had, he’d be able to use better tools to help him write better code.

]]>
By: Chris Hanson http://tleaves.com/2004/08/05/software-development-considered-harmful/comment-page-1/#comment-524 Chris Hanson Fri, 06 Aug 2004 04:48:52 +0000 http://tleaves.com/?p=161#comment-524 My experience from games was that building the same code on multiple compilers, turning on all the compiler warnings and fixing the problems, generally worked pretty well for cleaning up a codebase. At least when we could fix the bugs... My experience from games was that building the same code on multiple compilers, turning on all the compiler warnings and fixing the problems, generally worked pretty well for cleaning up a codebase.

At least when we could fix the bugs…

]]>