Writing code - Think carefully before doing it!

Posted on January 24th, 2007 at 20:01 in Linux

Today i wrote probably the stupidest program i have ever done. After all these years using Linux (around 5 or 6 by now), with some knowledge of bash, python, sed, awk, of all the things in the world, i got the bright idea to write a C program to parse the text output of a program. Next time, i’ll stick nails in my forehead instead of doing a program of 3 or 4 chained for cycles, with scanf’s and printf’s.

The final solution ? 10 or 20 lines on a bash script will solve my problems. There goes 3 hours down the drain!

2 Responses to “Writing code - Think carefully before doing it!”

  1. Diogo said on January 26th, 2007 at 11:01 :

    It’s not about knowing the tools, it’s about finding out which is the best one for the job.

  2. Alfredo Matos said on January 26th, 2007 at 19:01 :

    Don’t hammer a nail with a stapler. Just use the hammer.

Leave a Reply