Tuesday, November 13, 2007


After writing about complex behavior emerging from networks of simple non-linear elements this morning, I read Slashdot this evening to see a story on just that topic. Strange.

Other than that I worked to get the new interpreter system working against the existing test suite. It's mostly there, but there are still a few bugs left.

Ironically, the transaction bug of the day was occurring in a section of code where I was doing a lot of testing to see exactly what command had been issued, and responding accordingly. However, I have an AST that works for me, and after staring at it for 10 minutes I suddenly realized that all the problems would go away if I used the same code for each type of command. Consequently, 12 lines turned into 2, and all the bugs went away. Thank goodness for being able to call into a clean interface design.

This isn't the first time that I've fixed a problem by removing code. Sometimes I wonder if real software engineering is about removing lines of code rather than inserting them. Pretty much destroys the "Lines of Code" metric that some companies like to employ (word to the wise - don't work for these companies).


bullit said...

Hi Paul,

I too often say that the best part of development is deleting code. I don't know if any companies actively use the SLOC metric any more for measuring productivity. Well, I think Boeing here in Brissie still do :) As you say, I certainly wouldn't work for them.

I've seen it far too much, that incentivising something leads to unexpected behaviour. For example making SLOC a metric encourages people to write more code, not better code, and leads to a proliferation of duplication.


Quoll said...

Wow, you could read what I wrote and it made sense? I just looked at it again and wonder what I was on (actually, I've seen the label on the Cold/Flu cocktail I'm taking, so I have pretty good idea what I was on).

Still, it is nice to delete code in order to fix bugs and add functionality. Seems counter intuitive, but it makes sense when you see how much more elegant the final system is.

Shery said...

My question is about ur very early posts in Mulgara.
I've just started my dissertation and in that I must use Mulgara.
the problem that i faced is when I load my RDF & OWL files into full text model and wants to query them, I want to know the number of the records that retrive but i don't know how. I used the count function as u said in ur previous posts but it brings for me the column with this information
Could u help me? Thank u in advance