Bad developers are made not learned.

So in an earlier post I pointed to a post by Andy and said,

It’s much easier to transition from C++ to a managed language than the reverse. Plus understanding how memory management really works pays off when you move to a GC managed language like Java or the CLR

Jeff Atwood left a comment,

I think this is kinda.. bad advice. I’ll let Jon Galloway explain why, because he does it so much better than I do

Joel got it wrong – Why learning C is a waste of your college time and money

So I read the posting Jeff pointed to and came away with something different than he did. Apparently what Jon Galloway is saying is that learning C/C++ will make you a bad programmer. I don’t think that bad programming practice is learned, I think bad programming practice is enabled by the environment the developer is in. But I don’t think that any programming language is going to give you a false sense of control. In fact the example he uses to illustrate how the developer really isn’t in control is exactly the kind of thing that can only be understood if you have a good understanding of how computers and operating systems work close to the metal. If you’ve spent all your life working in a GC’ed language, why would you ever need to know how memory management works, let alone virtual memory? Jon also says it doesn’t teach you to work with a framework. What’s the STL? What about MFC? ATL? Carbon? All of those things use C++ as their base language. Notice I didn’t say to take a C/C++ course at a university as I’m not convinced that a CS course will teach you everything you need to know in the real world. I said to learn C/C++ first because if you understand HOW things work, you’ll have a better idea of how things DON’T work. How can you identify a memory leak in your managed application if you don’t know how memory leaks come about or what a memory leak is?

I think that all of the points that Jon bring up could be true, if the person he’s speaking about is a bad programmer anyway.

BTW as an aside, Jon mentions the data storage and processing needs of todays systems. He’s just talking about piddley stuff, non-scientific data. I’ll post a little bit on what kind of data sets we’re talking about in scientific data in a little while (hopefully, real life is about to intrude yet again!). Here’s a teaser, terrabytes are usually the smallest unit of measure we use when we’re talking about scientific datasets.

  • http://www.codinghorror.com/blog/ Jeff Atwood

    > Jon also says it doesnít teach you to work with a framework. Whatís the STL? What about MFC? ATL? Carbon? All of those things use C++ as their base language. Notice I didnít say to take a C/C++ course at a university as Iím not convinced that a CS course will teach you everything you need to know in the real world. I said to learn C/C++ first because if you understand HOW things work, youíll have a better idea of how things DONíT work. How can you identify a memory leak in your managed application if you donít know how memory leaks come about or what a memory leak is?

    What you’re really saying, then, is that abstraction doesn’t work. You’re saying that you must understand the layer below the layer you’re at (and possibly even 1 more layer) in order to be competent.

  • Scott

    hmmmm, no I’m saying there’s a difference between the guy that can paint your car and the guy that can paint your car AND diagnose what that clicking noise in your engine is.

    You can work in an environment where you never, ever have to manage your own memory or worry about registers in your entire career. But I think you are a little better off if you understand how things are working under the hood, even if you never have to open the hood and work on things yourself. It could just be my nature to want to know how things work and I’m projecting it onto my chosen career and saying that’s the way it should be for everyone.

  • Pingback: Coding Horror

  • http://www.codinghorror.com/blog/ Jeff Atwood

    I posted a response here:

    http://www.codinghorror.com/blog/archives/000277.html

    It’s a black and white issue. Clearly experience at the lower levels is a good thing– but it’s a question of focus.

  • http://www.codinghorror.com/blog/ Jeff Atwood

    er, I meant to say NOT a black and white issue. Doh!

  • http://www.brock.ac.uk/blogs/jon Elvis

    i find this kind of stuff po-faced and demoralising to the huge numbers of people out there using memory-managed languages to produce solid, well-written and useful software, but who have only done rudimentary C or C++ (or none at all).

    although i’m sure that properly learning C/++ would make me a better programmer, i can think of other things i could learn which would have much better pay-offs. sorry if that sounds a little pragmatic.

  • Scott

    Remember, my original post said that if a person is just starting out and they are asking me what language they should learn I said C/C++ because it would make the transition to GC’ed languages like Java and C#/.NET easier. I don’t think I would advocate anyone learning C++ if they are already a compentent, knowledgable programmer unless they wanted to. I think understanding how memory works and how the OS works at a low level does help when troubleshooting really complicated programs. I certainly didn’t take the C/C++ route, except for a brief stint back when I ran a WWIV BBS and wanted to modify it.

  • Pingback: Lazycoder » Blog Archive » Know your platform