C#: Fat or Fit?

July 12, 2007

In C# 3.0 Considered Rubenesque?, David Ing considers (mainly) whether C# needs the functional extensions being proposed for v3.0 and by the by touches on a discussion I’ve been having internally about Java, Python and Erlang. The main points for me revolve around language complexity, the timing of the need for functional programming and when not to abstract.

Elliotte Harold has been vocal against adding complexity to the Java language. The complexity loving geek in my stamps his foot (“… but I want properties / closures / etc”) but Elliotte’s right – programming languages don’t have to accrete features, and in the real world most Java programmers get dazed and confused if you throw inner classes at them. On the other hand python has managed to support a functional style of programming (although I’m told that this isn’t totally pythonic) and is still considered easy to learn, so perhaps it can be done simply.

You don’t need to reach for Mother Shipton’s almanac to know that functional programming languages are going to be hugely important, with processors now not getting much faster, but gaining more cores. The languages that enable normal rank and file developers to take advantage of that are going to win in the way memory managed languages did, and in the way dynamic languages are doing. The question is not really “if” but “when”, and the answer probably depends who you are and what you need to do.

If I were writing an data analysis program to run a cluster (say 32 machines with dual-dual processors), then I’d be reaching for any language that let me use them as efficiently as possible – give the air con something to think about. Even if I had a dual-dual server dedicated to a single service I’d probably do so too, even though I’d be unlikely to get a 4x speed up due to I/O contention (example from Pragmatic Programmer). Most of our current web facing servers (where most of my code will end up running) are single or dual core, and aren’t due for an upgrade any time soon. So I’m better off sticking to what I know for now.

The final point is probably the most important, since it’s not future gazing: –

There is a school of thought that when you’re working with a relational database rather than a collection of in-memory objects, then you should not lose track of the various nuances and advantages of the stores – abstraction to save typing can come back to bite you?

Replace “working with a relational database” with “machine boundary” or “transactions” and it’s still true. Remember the first law of software complexity – you can’t get rid of complexity, just move it around. The more amazing an abstraction is at hiding complexity from you, the more likely it is to leak.

Advertisements

2 Responses to “C#: Fat or Fit?”

  1. baoilleach Says:

    “””On the other hand python has managed to support a functional style of programming (although I’m told that this isn’t totally pythonic) and is still considered easy to learn, so perhaps it can be done simply.”””

    When Python adds in a new feature that overlaps with previous features, it deprecates the old ones; this stops it getting fat. For example, map and filter are now deprecated in favour of list comprehensions (which means less lambdas too) which came in in Python 2.3 or so:
    map(float, mylist) —> [float(x) for x in mylist]
    reduce(lambda x: x > 1, mylist) –> [x for x in mylist if x > 1]

    I use list comprehensions all over the shop now. It replaces a couple of commands by one. Cool.

    Noel


  2. […] A week or so back David Ing raised a concern that the new language features in C# 3.0 are bloating the language. Jim Downing adds to the conversation by asking if C# is Fit or Fat. I certainly understand their concerns, but for me, waiting for the new C# 3.0 features is like being a 5-year old on Christmas Eve knowing that the package in the corner is a Millennium Falcon toy. I think LINQ is overhyped, but the stuff they supposedly did just to support LINQ is going to rock. The movement in regards to programming languages that I’m seeing is to pack more punch with less code weight, and I think the C# 3.0 stuff is going to help the mainstream move in that direction. […]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: