Modern IDEs now allow you to search for a class or a file and go to it from the search results. On my last few projects I’ve seen developers using this feature almost exclusively rather than navigating their code tree. This is a very nice feature that I really enjoy using but does it have a dark side?
I’m an old school hacker and I like to know how my code is structured – its packages, dependencies, web root folders, output folders for the IDE and for automated build scripts, etc. I’ve always felt that this gave me a bigger picture than just “insert code here”. I tend to analyze how the bits of code or classes that I am writing (or reading) fit into the overall structure, where they go, what packages / components / modules / assemblies my application has.
It is interesting that on projects where code navigation by search is the norm I come across weird / circular dependencies between packages, classes in packages that do not really fit together (at least in my mind), and integration tests for endpoints that require the wiring of the entire application to work. My initial feeling is that this is a symptom of developers who may not yet be experienced enough to see the big picture shape of their evolving application, and/or of an application layout/design that does not provide any affordances to developers to indicate where they should put their code.
What’s the point I’m trying to make here? That’s a tough question. I’ve been debating with myself for a while whether I should even blog about this, whether this would sound like a rant, or whether this would be helpful at all. In the end as a software craftsman I decided to simply put this out as a cautionary note and a plea to keep a watch out for code that is frequently searched but infrequently read. It smells …
#1 by Jim Barritt on 27 October 2009 - 1:18 am
Quote
Hi Tom,
I have also observed this and, also wondered about its dark side, with very similar set of concerns that you mention here.
I would actually say that Eclipse positively encourages a “flat” package hierarchy because its flattens package structure and “hides” classes in the navigator view by showing them inside source files. You might aswell have one massive package!
This is one of the reasons I favour intellij, the package view is much cleaner and makes me want to explore it rather than trying to hide it away and use CTRL-T all the time.
So +1 from me at least.
Jim
#2 by GrahamBrooks on 25 November 2009 - 6:12 am
Quote
Mr T
,
I see this effect as part of a general lack of zooming of perspective during development. Quite often teams are under pressure to deliver functionality as quickly as possible and a possible instance of Reckless debt (http://martinfowler.com/bliki/TechnicalDebtQuadrant.html). A symptom of not thinking there is enough time to mould the code back into a consistent architecture.
Graham
#3 by Tom on 25 November 2009 - 10:59 pm
Quote
Hey Graham, I forgot about reckless debt, though I have been trying to attribute some of this behaviour to value fetishism (had to use that in a sentence). Some teams are now quite good at red-green-red-green software delivery, and can turn out code like a machine. However its supposed to be red-green-refactor (or at least red-green-reflect), but that seems to get lost in the rush to deliver “value”. Unfortunately that leaves teams accumulating tech debt that may not ever be addressed, or actually using tech debt as a passive-aggressive mechanism of not actually dealing with an issue that is ‘too hard”.
#4 by Sana Jeffries on 30 August 2011 - 2:44 am
Quote
It might have a dark side, but it is much easier to navigate and manage the structure.
Sana Jeffries
Webmaster http://www.bulbamerica.com
Philips Bulbs
#5 by Tom on 1 September 2011 - 9:58 pm
Quote
Easier to navigate but I’m not sure about managing structure, unless you actually view the structure after navigating to the class/code/file.