Writing bug-free code



  • There is an old joke:  In your garden, how do you tell what is flowers, and what is weeds?  Pull up everything; what grows back is weeds.

    Following this principle, you can write bug-free code, as follows: 

    1. Document all the expected behavior of your code. 
    2. Start removing code that produces the behavior that is expected, and set it aside. 
    3. What you have left is bugs.   Throw all the remaining code away.
    4. Take all the code you've set aside in step 2 and add it back in.
    5. Now, you've got a bug-free system.

  • Discourse touched me in a no-no place

    Is there a punchline?



  • @PJH said:

    Is there a punchline?
    Its obviously self-referential .. he pulled out all the good content and what was left should have been thrown away. Perhaps that was the next step?



  • This thread is now the offical bring back the stickers and mugs thread. Discuss.



  • Yes, this is supposed to be funny.  Think about it.  If you take away -exactly- the code that produces the expected behavior,

    1. how do you determine what is the good code, and what is the bad?  Bugs aren't really like that -- they're deeply embedded in the code, an integral part of it.  So it is really impossible to set aside the code that you want, and leave behind the code you don't want. 
    2. If you somehow could do that, and discard the bugs, you wouldn't be able to re-assemble what is left into a working product.  There'd be too many holes.
    3. No one knows what is really the expected behavior; and certainly no one has written down --exactly-- what the expected behavior is. Many have tried; and that is the downfall of waterfall
    But wouldn't it be great to do that?  Oh -- look.  There is a bug in the code here.  Just take out these three lines and build it again.  It'll be perfect.

     



  • It reminds me of the reasoning that tells us that the ears of a fly are located in its left hind leg.



  •  This is the most depressing and unfunny attempt at a joke I have ever seen in my entire life and I've been to germany and france god damnit.


  • Discourse touched me in a no-no place

    @dogbrags said:

    Yes, this is supposed to be funny.  Think about it.
    It gets even less funny the more you try to justify why it is funny.



  • @stratos said:

    This is the most depressing and unfunny attempt at a joke I have ever seen in my entire life and I've been to germany and france god damnit.

    Wrong.  Germany and France are hilarious, depressing jokes.



  • @dogbrags said:

    Think about it. 
     

     

    You just explained the joke! In more than 100 words! Using a list of points.



  • Mind-numblingly Jeff Dunham style not funny, but keep trying!



  • Assembler doesn't grow back, you insensitive clod.


  • Trolleybus Mechanic

    @Lingerance said:

    This thread is now the offical bring back the stickers and mugs thread. Discuss.
     

    I think we should throw out all the swag that isn't stickers and mugs. Then all we'll have left is stickers and mugs, and everyone will be happy!



  • Why not just add various lizards, snakes, birds, etc. to the code so they just eat all the bugs?

     

    Then when all the bugs are gone, the lizards et al will starve to death and die, then you're just left with the good code.

     

    And some decaying remains of bugs and bug-eaters.



  • @too_many_usernames said:

    Why not just add various lizards, snakes, birds, etc. to the code so they just eat all the bugs?

     Then when all the bugs are gone, the lizards et al will starve to death and die, then you're just left with the good code.

     And some decaying remains of bugs and bug-eaters.

     

    +1 useful wba



  •  Even better:

     

    After the lizards are dead, introduce bacteria to the code, which will decompose all the lizards.  Finally, when that's done, add a few bugs back into the system to get rid of the remaining bacteria.



  • @Shishire said:

     Even better:

     

    After the lizards are dead, introduce bacteria to the code, which will decompose all the lizards.  Finally, when that's done, add a few bugs back into the system to get rid of the remaining bacteria.

    Or just do what I do: program drunk.  Alcohol kills bacteria.



  •  I think this forum should have a "unfunny" section so we have somewhere to place this thread in.



  • @stratos said:

    I think this forum should have a "unfunny" section so we have somewhere to place this thread in.

    We do.



  • @too_many_usernames said:

    Why not just add various lizards, snakes, birds, etc. to the code so they just eat all the bugs?
    I'm partial to spiders.  A little radiation and they can get as big as my house.  Not to mention the super powers from getting bitten.



  • @belgariontheking said:

    I'm partial to spiders.  A little radiation and they can get as big as my house.  Not to mention the super powers from getting bitten.
     

    I'm still in two minds about you posting while high and/or drunk.



  • @dhromed said:

    @belgariontheking said:

    I'm partial to spiders.  A little radiation and they can get as big as my house.  Not to mention the super powers from getting bitten.
     

    I'm still in two minds about you posting while high and/or drunk.

    Really?  My biggest fear is that he'll stumble upon the site while sober, see the things he writes, and vow never to do a cocktail of heroin and bourbon ever again.


  • @bstorer said:

    Really?  My biggest fear is that he'll stumble upon the site while sober, see the things he writes, and vow never to do a cocktail of heroin and bourbon ever again.
     

    Man, that would be a sad day for the world.


Log in to reply