Writing code when you are a theorist

Despite my involvement in the FreeBSD and FreeSBIE projects, I do not think of myself as a coder, nor a “system” guy in general. I’ve always been more attracted by theory and I followed a mainly theoretic courses path during my M.Sc. . My thesis is about theory in data mining but involves some experiments and I have to write the code for them. The day I had to write the first of these experiments, I decided Python would have been my language of choice, mostly because I wanted a language which allows fast and easy write-test-run cycles. Python gave me that.

In the last few weeks I thought about improving the way I write code: I felt I was lacking discipline and order. One of my advisors said my writing style is really formal when I write about computer theory. My code was quite the opposite. It was ugly, with no underlying design, with a lot of semantic errors, fragile and so on. I had to steer away from that development style.

I am now a little bit slower in writing code, but my code is better. It is easier to test. Easier to debug. Easier to be reused. More formally correct but easier to read. It will improve even more, I hope, now that I have a (small) project to work on every day.

Comments 2

  1. blextar wrote:

    Esattamente il mio stesso problema. La differenza รจ che il mio relatore m’ha detto di infischiarmene del codice e che potevo anche cercare qualcuno che lo scrivesse al posto mio, se necessario. A lui interessavano solo i risultati dei test e la relativa interpretazione.

    Spaghetti code forever, quindi! :)

    Posted 23 Dec 2008 at 11:12
  2. Philip Paeps wrote:

    It is always interesting to see how your coding style “evolves” over the years. I’ve been writing software full time (well — for values of “full time” that apply to the job…) for about seven years now and it’s interesting to compare my old code to my new code.

    I’ve always followed the BSD style(9) guide religiously so the “look” of my code hasn’t changed much. I’ve evolved a lot more “architecture” though. In the process, I’ve also gone from perhaps over-commenting to under-commenting.

    Writing code is as much a task of habit as is anything else, I suppose.

    Posted 24 Dec 2008 at 13:24

Post a Comment

Your email is never published nor shared. Required fields are marked *