Share via


Writing less code

Who said "There's only really one metric to me for future software development, which is
-- do you write less code to get the same thing done?"  Maybe one of the folks on lesscode.org who

practice the art of using less code to get more done. We shun
complexity and challenge the status-quo when it impedes our ability to simplify
our development tools and processes. We appreciate Python, Ruby, LAMP, REST, KISS,  

Uhh, no.  It's the person often reviled  as a promoter of complexity and keeper of the status quo, our very own Chief Architect. [;)]

I mention this not only because the dilemma of simplicity is one of my favorite themes,
but because this came up in several conversations that I heard at PDC
about the new featues in C#.  The basic sentiments are stated pretty clearly by PDC blogger David Wheeler

But as with anything, the complexity that is added to this
language will require very careful management. ...I spend a lot of time
working with developers that are new to C#, new to Object Orientation
and new to .NET. I feel that Lambda expressions, extension methods,
anonymous types and LINQ (Language Independent Natural Query) will be
concepts that they will find it difficult to grasp at the first
attempt.
...
C# 3.0 is reaching a point where a developer with only a few months
experience will be unable to read what an "advanced developer" will be
writing for, say, data access.

I
definitely heard a number of people moaning about
Lambda expressions in particular, which apparently can cause horrible
LISP flashbacks to those with less than fond memories of the '80's AI
hype wave. What was most interesting to me, however, was that in the
panel discussion on LINQ Friday afternoon, someone
asked about all the additional features being added to C# to
support XML, SQL, object-relational mapping, etc. and worried that
these features would undermine its essential simplicity. Anders
Hejlsberg responded much as Bill Gates did in the quote at the
top:  Think about all the complexity and tedium that the new C#
features removes from your application code, and weigh that against the
additional complexity of C# itself.  Anders went through a long
list of things that application developers will need to know less about
in return for learning about LINQ, etc. 

So far, and I say this after having spent the evening reading
dozens of blog entries on LINQ, it looks like a considerable majority
of the people who have been exposed to LINQ agree that it will provide
an excellent return on the investment to learn the new features. 
Remember, however, that the whole point of announcing all this at PDC
was to
get feedback, so by all means let Anders and others know about specific
features will cause you more pain than gain. 

In my opinion, adding infrastructure code that was designed and
implemented by the best people in the business then  exhausitvely
tested for years, but lets you write less code in an application, is an excellent tradeoff.

Comments

  • Anonymous
    September 18, 2005
    There is a balance to be struck between not compressing code enough (too fat) and compressing it too much (too skinny).

    Fat code is verbose code. Fat code means that there's more code you can mess up. Fat code is easy to read, but there is more of it so it takes longer to understand.

    XML is "fat."

    Skinny code is less code. Less code, however, is not necessarily simpler code. When you make mistakes writing skinny code, those errors are magnified. Skinny code takes a short time to read, but it can be difficult to understand if it is too skinny.

    Regular expressions are "skinny."

    C# code to extract and manipulate data from relational databases and XML is "fat." C# 3.0 AND LINQ are attempts to make that code slimmer. That's a good thing, but try not to make the code too skinny.

  • Anonymous
    September 19, 2005
    The comment has been removed

  • Anonymous
    September 22, 2005
    reading through lesscode.org and what do I see? reference to mike champion as "one of the few remaining reasons left to respect microsoft..." I'm sure I could soften that for the present audience to, "an excellent reason to add to your respect for microsoft."

    I don't disagree, really, but I hope someone on the panel pointed out all of the excellent facilities cobol and pascal had to make i/o more accessible to the masses. (I'm just sore because I think lambda expressions are great. :)

  • Anonymous
    May 29, 2009
    PingBack from http://paidsurveyshub.info/story.php?title=mikechampion-s-weblog-writing-less-code

  • Anonymous
    June 08, 2009
    PingBack from http://cellulitecreamsite.info/story.php?id=5595

  • Anonymous
    June 09, 2009
    PingBack from http://greenteafatburner.info/story.php?id=2531