password
username
Sponsored by CakeMail, an email marketing software.
Newsletter preview

Java World logo JavaWorld's Enterprise Java Alert
JavaWorld.com | Java Developer Forums | Java Technology Insider | Update Your Profile

When lines of code meet the Law of Unintended Consequences

By Dustin Marx

One of the most insightful articles that I have read (in terms of both general daily life and a software development career) is Steven Kerr's "On the Folly of Rewarding A, While Hoping for B." In this article originally published in 1975, Kerr employs descriptive examples to demonstrate how a reward system can lead to different and even opposite results than intended. Using lines of code to measure effort and developer productivity often feels like another example of this tendency.

The use of lines of code as a metric may serve as a detrimental motivational force for the software developer. In other words, while using lines of code may be meant to measure productivity and to understand how far along a particular task is, the unintended consequence may be poor decisions that favor larger code counts in shorter periods of time.

If we applied Kerr's article directly to this discussion, we might rename the article "On the folly of rewarding potentially worse development practices that happen to lead to more lines of code, while hoping for a measurement and estimation approach that helps developers and managers manage their work loads more effectively." This is not nearly as succinct a title as the original title, but does make the point. To be clear, I am not saying that fewer lines of code is always and necessarily better than more lines of code. What I am writing about here are situations when it's preferable to write fewer lines of code, but the motivation to keep that count up influences the decision.

How does using lines of code as a performance metric decrease code quality? Read on to find out.

Also see:

On the Folly of Rewarding A, While Hoping for B (Steven Kerr)

Analyzing code metrics - unambiguously (Andrew Glover, JW Blogs)

More in JW Blogs:

Java.next #3: Dispatch strategies
Stuart Halloway writes: Flexible dispatch is a key element of Java.next. All of the Java.next languages support dispatch strategies that are far more flexible than Java's single dispatch. These strategies are not perfectly interchangeable, but have a great degree of overlap ...

Five unit testing tips: #1. Use the data store
Johannes Brodwall writes: I’ve looked over some of my code lately, and found ways that I often improve my tests. I’m planning on writing a blog post for each of my five favorites. First out: Using the data storage ...

The elephant
Charles Nutter writes: I was just having a conversation with a friend, a Rubyist whose opinion I respect, who clued me in that he really hates when JRuby users use Java libraries with little or no Ruby syntactic sugar. He hates that there's a better chance every day that Java-related technologies will enter his world ...

You've hit the tip of the iceberg: Read more in JW Blogs


SPONSORED BY ENTERPRISEDB CORPORATION
rule

ENTERPRISEDB CORPORATION PostgreSQL in a Package
Postgres Plus is ideally suited for transaction-intensive, Web 2.0, and next-generation applications. Try out the world's most advanced open source database today.

rule
ALSO FEATURED ON JAVAWORLD:

Web development with Wicket, Part 3: Many ways to persist
Wicket's fierce independence leaves you with lots of options for persisting your data. Find out how Wicket makes the marriage work, whether you want to settle down with Spring/Hibernate or live on the edge with Databinder and ActiveObjects.

Behavior-driven development with easyb
Get a quick introduction to this Groovy DSL for behavior-driven development. Find out how easyb lets developers and domain experts speak the same language - easily!

The case for Java modularity
It never rains but it pours! Get some background on the long and winding road to Java modularity, then compare the two specification requests vying for inclusion in Java 7: JSR 291: Dynamic Component Support for Java SE and JSR 277: (Sun's) Java Module System.

Is unit testing doomed?
Andrew Binstock follows up his recent blog posts with a deeper inquiry into why fewer Java developers are unit testing code, and why some may regret the decision later.

UPCOMING ON JAVAWORLD:

-Large data processing with Apache Hadoop
-Agile development: Writing software with the grain
-Excel spreadsheets with Open XML
-WebWork validation with Struts 2

Upcoming Podcasts:

-Guillaume Laforge on the merits of Groovy
-Rod Johnson on SpringSource Application Platform
-Todd Hoff on Java scalability

JavaWorld's Daily Brew - Starting conversations in the Java developer community
http://www.javaworld.com/community


JAVA TIPS FORUM
open hand from computer Share your indispensable programming tips with other developers here.

JAVA TECHNOLOGY INSIDER
Java technology podcast logo Inside views on essential and emerging Java technologies from the developers shaping the future of the Java platform

SPONSORED BY ENTERPRISEDB CORPORATION
rule

ENTERPRISEDB CORPORATION PostgreSQL in a Package
Postgres Plus is ideally suited for transaction-intensive, Web 2.0, and next-generation applications. Try out the world's most advanced open source database today.

rule

Webcast: Why archive email? Top challenges and best practices
Join Michael Osterman, President of Osterman Research, as he discusses the business advantages of archiving email, and examines the consequences businesses face when they don't archive. He'll review the top 10 challenges businesses face in managing email retention, including the impact of new amendments to the Federal Rules of Civil Procedure. Listen today. 

Featured reader resource

Software Business 2008: Register Today!
Software Business 2008 will focus on current strategic business, financial and technology issues and growth opportunities facing executives and managers of software companies. This two day conference, October 30-31 in San Francisco, serves owners, chief executives, presidents, vice presidents and division directors or department managers of leading and fast-growing software companies, located throughout North America, who are conducting business domestically and worldwide. Register now 

 

09/09/08

RECENT PODCASTS

Sharding with Max Ross - Hibernate Shards

Dan Diephouse on SOA governance with Mule Galaxy 

Brian Sletten on REST done right

 

ACTIVE DISCUSSIONS

Java Q&A: Custom components in Cisco CVP 3

Java Q&A: Integrating applets using JBuilder

Java Q&A: Loading common data for all users

Announcement: Java Q&A Forums - beta testers needed!


Improve App Performance

Discover new tools and strategies to help you keep up with managing application performance across your IT environment in this Executive Guide. Learn how to consistently guarantee your applications are up to snuff in today's complex IT environments. Get your free copy now.

Download this Executive Guide now.



 


To continue receiving JavaWorld's Enterprise Java Alert newsletter, please add @nwfnews.com to your white list.

COMPLIMENTARY SUBSCRIPTIONS AVAILABLE
As a NW newsletter subscriber you are eligible to receive 50 issues of Network World Magazine, in print or electronic format, free of charge.

Sign up for your subscription today: Apply here. International subscribers,click here.

 

SUBSCRIPTION SERVICES
To subscribe or *** to any Network World newsletter, change your e-mail address or contact us, click here.

Terms of Service/Privacy

***

JavaWorld is a trademark or registered trademark of Sun Microsystems, Inc. in the United States and other countries, and is used under license by International Data Group, Inc. All other product names and trademarks used are the trademarks of their respective owners.

Network World, Inc., 492 Old Connecticut Path, Framingham, MA 01701
Copyright Network World, Inc., 2008