Simplicity Lost in 3D

I don’t know about you, but if I see a three-dimensional array being returned by a method in Java, alarm bells start going off (without, of course, suitable (and it better be mighty) justification). I have no idea how this method was added to the code base without review by another developer (my guess is that it wasn’t), but proper developer hygiene and good conscience (who would want to inflict it upon anyone else?) won’t let me leave it there. After studying the single method for over half-an-hour and dragging over the original author, I finally realised what it’s purpose in life was.

There are already far too many articles about what simplicity is (try this link), but my favourite rule of thumb is, if you have to stop and think about what code is doing while you’re reading it, it may be excessively complex. I avoid writing complex code, not because I am lazy or stupid, but because it is a waste of time that prevents me from writing other code that adds greater business value.

2 Replies to “Simplicity Lost in 3D”

  1. Hear, Hear, Although I think that often it actually takes *more* effort and time to write simple code – the time saving comes in when some other poor sucker has to read it 🙂

  2. I agree that it takes *more* effort to keep it simple, but not necessarily *more* time. I tend to be the own consumer of my own code a lot of the own time, and by keeping it simple all the way through development, I still think I can write the complete group of functionality faster than I otherwise would have.

Comments are closed.