2 August 2007

Programmer's Dilemma

Guess what? After a long time, I am into full-time coding. For the past few days, I am coding for about 7-8 hours a day.

The language is MAPLE. It is actually a mathematical software system or for the beauty of it, let's call "a computer algebra system". To be frank, I haven't liked the syntax/grammar that well. I guess, it's just a matter of getting used to.

Programming is not easy too. Because you need to know quite a lot of math to use this. Till now, I have managed fine.

I had to use some finite-field stuff - which is incidentally very poorly done in Maple. I just thought of writing a wrapper class/module. Started with it and got defeated badly. The reasons for failure were - 1) I am not crystal clear with all the details of finite fields. 2) I am still not an expert in Maple.

Now, coming to the title.

Whenever I have to write a reasonably big function/program, I think for quite some time. Even after I am done with thinking, I would be hesitant to start. I will just go around and around for quite some time. It takes a lot of energy to pull me back to write it. I guess it is like "chewing the cud". Taking the program structure from mind and chewing and re-chewing it - to confirm everything.

Another funny thing is that, after writing the code, I will read the code very many times - checking for syntax/logical errors. Again I am hesitant to try compiling and running. I want it all to go in a single go. Rather, I don't want the compiler to find the smallest silly mistake.

What would the compiler think about me? - if I don't find and correct it myself? ;)

Just now, I am done with a big chunk of code - a set of functions for core of the program. I finished it and waiting to get enough courage to run it. I have read it a couple of times and it looks perfect and is shining after the polish.

Still... shall I try it now or after a break? This is my dilemma. If I try now and find some mistakes, then I wont be taking any break. Anyway I'm running it now.

I guess, cross-checking the algorithm and code, before giving it to the computer is what makes me a good programmer. Careful coding is always better than trial and error. Less bugs more fun! :)

Signing off,
Sands.

~

4 comments:

Hailstone said...

Atlast what happened? Did the compilation result in a success?
Or had any bugs?

Sands | കരിങ്കല്ല് said...

50-50.... not yet complete...
there were some bugs.

Anonymous said...

"Careful coding is always better than trial and error."

So true..

The first advice i had abt programming is "Spend more time in ur bench than in front of the computer".. (i never followed it though :P)

-Vivek

Anonymous said...

Hmm, I don't agree with the whole 'do it in one pass', your style seems bottom's up. I work mostly the other way Top down. I plan in detail the top level logic/structure. Once I have this working and simulated in my head, I fill the rest of the details via an iterative and interactive process of code/compile/execute/code