Productive Developers are Smart and Lazy
Join the DZone community and get the full member experience.
Join For Free- developer as in energetic and focused on building real-world code solutions
- not a dreamer who never gets around to writing anything practical
- smart as in able to think things through (i.e. not smart-ass)
- lazy as in lazy-loading , that is taking time to write code (i.e. not couch potato)
good development is
lazy
development a.k.a. patient development; it happens when the developer spends the time necessary to think through all the pathways of the solution that he is developing
before
writing the code. that is
lazy-writing
of code, i.e. not writing code before the problem is understood. the more due diligence a developer does to make sure that he is writing the correct code will reduce the amount of code that needs to be written.
this
due diligence
takes the form of:
- really understanding the requirements and getting product management (business analysts) to be clear on what are the actual requirements
- they often are not given time to gather requirements
- they often don't have access to the right subject matter experts
- they sometimes have very poor abilities to synthesize consistent and complete requirements (see when ba means b∪ll$#!t artist )
- really making sure that you understand how you are interfacing to other developers on your team and other teams, this involves:
- collaboration in front of a white board
- producing diagrams (uml and visio)
it takes time to do this due diligence to make sure that you have
consistent requirements
and to make sure that you will have
consistent interfaces
with your peers. however, developers are eager to start banging out code and spend hours at their desks banging out code.
in reality, less than 5% of that time is spent productively (see the programmer productivity paradox ). if you see developers spending 100% of their time staring at their screens with no human interaction then you are looking at some of the worst developers.
in reality, less than 5% of that time is spent productively (see the programmer productivity paradox ). if you see developers spending 100% of their time staring at their screens with no human interaction then you are looking at some of the worst developers.
it is a bad sign if developers are always coding
productive developers
are constantly checking their understanding of the requirements and making sure that they are staying in
sync
with their team's code. productive developers are in
regular contact
with the product managers/business analysts and can often be seen
white boarding
with their peers and architects.
there are definitely developers who use their years of experience to become more productive, in fact among the best developers:
- the ratio of initial coding time was about 20 to 1
- the ratio of debugging times over 25 to 1
- program execution speed about 10 to 1
- program size 5 to 1
however,
in the aggregate
, developers do not become more productive over time (see
no experience necessary!
), i.e. over thousands of developers there is no correlation between years of experience and productivity. in fact, we have measured productivity regularly 8 times over the last 50 years and years of experience do not correlate (in the aggregate) with productivity.
why is lazy writing of code so important?
code is often written before the requirements are understood or gathered. in addition, quickly written code often fails to fit with everyone else's code; often, it is only during integration that this problem is discovered. good developers are patient and realize that there is a cost to writing code quickly.
developers become psychologically attached to their code
bad developers are
reluctant
to change poorly written code. rather than rewrite suboptimal code, bad developers will simply
add more code
to make up for deficiencies. even worse, they tend to blame everyone else for having bad code. what you end up with is band-aid after band-aid that leads to a severely buggy and unstable system.
don't get me wrong, good developers can find themselves in a situation where they have written
sub-optimal
code. the difference is that a good developer will recognize a problematic section of code and:
- refactor the code if the code is largely doing the right thing
- rewrite the the code otherwise
when developers produce and maintain sub-optimal code, it becomes
harder and harder
to change this code as time goes on. that is because their peers will need to write code that interfaces with the suboptimal code and build clumsy interfaces or work-arounds to make the code work. as the code base grows, too many later code units rely on the functionality of this initial code. of course, the later code can do little to increase the stability of the code and bugs multiply when simple changes are made; in short, development becomes slower and slower.
when in doubt, be lazy and write code late!
dev
Published at DZone with permission of Dalip Mahal, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments