Friday, 25 April 2008

To C or not to C... Should Jeff Atwood Learn C?

I just heard on StackOverflow Podcast 2 that Jeff Atwood does not know C!
I was like....WHOA!!!
Joel's reaction was along the same lines... He tried his best to disguise it politely, but the opinionated software guru inside of him couldn't resist telling Jeff to learn C...

Joel is right… Go learn C Jeff! Not having ever worked with C? Now THAT is CodingHorror!

Alright... for an Evangelist or a Program Manager, it doesn't really matter that much whether you know C or not...
But for a hardcore developer, I’d always prefer someone who’s done some C programming at some point in his life! The odds of finding a "rock star coder" who doesn't know C just seem very, very low to me...

I don't remember the inner details of C anymore, but those “basic” concepts & lessons from C programming have been invaluable to me as a developer!

Lets take an example…

Consider an array of strings “abc”,”def”,”ghi” etc…
and I want to concatenate them…

I could run a loop and use a string like so...

string alphabet = “”;
for(i=0;i<=strArr.Length;i++)

alphabet = alphabet + strArr[i] ;

Or I could use a StringBuilder and append to it.

StringBuilder alphabet = new StringBuilder();
for(i=0;i<=strArr.Length;i++)

alphabet.Append(strArr[i]);

Which method will be more efficient? Why?

If you don't know the answer, both intuitively & logically, I'm guessing you haven't ever been a decent C programmer...(yet)!

I just thought of a somewhat relevant analogy...

Photography...

One doesn't really HAVE to know all the deeper details of photography like exposure, shutter speeds, apertures etc to take good photos... Because modern digital cameras simplify (abstract) all this for the amateurs (like me!). Also, we can always go and tweak the photos on PhotoShop...

But do you have any doubt that there are lotsa things that expert photographers can do, that ignorant amateurs simply won't even be able to think of...

Similarly, one doesn't HAVE to have learned C to make a useful program/application.

Yet, at the same time, knowing C gives a developer this sort basic fundamental programming insight, that comes only from coding closer to the machine level. He can use the simplified and abstracted features of higher level languages like C#,VB.net much more skillfully. This gives him a much better chance of writing "technically" beautiful software.

Quick Question : How important is the "technical beauty of code"...?

Short Answer : It depends... Could be absolutely essential in some project, and absolutely unessential in another...

Bottom Line : When hiring a "hardcore developer", I'd love to have one that has lots of potential for producing beauty!

Disclaimer : Though "potential for producing beauty" or knowing C is not always the most important requirement in a developer!

0 Comments: