I read plenty of forums. Hell, what’s the net without forums? Ok, porn, but that’s another story. And, off course I need Google.. And Wikipedia.. Well I guess the net has more than forums, but anyway…
One question that never ends without a looong thread is the question about what programming language to learn first. It’s like a C vs. C++, C++ vs. Java, vs. you name it.
Especially the question about learning plain old C before learning a newer more modern language, that has OOP, a pre-written GUI library, and a drag and drop designer IDE.
The question is without doubt a matter of conquest. What is it you want to master? What will you do with your programs? Is it GUI based, windowed applications? Console based? Services / Deamons? A new mp3 player? A conversion application for decoding or encoding?
If you’re goal is to write Cocoa based Mac Applications with Objective-C, why learn C? I’ll give my thoughts on that a little later. If you’re gonna write QT applications for Smart Phones, do you need C? It’s better to jump right into the polished GUI based IDE of choice, than it is running apps in a console window, right? I’m not that sure.
This post is targeted at novices, that probably has started “learning” three or four languages, but still, cannot produce much with either, because they don’t understand the elementary pieces of logic that goes into programming as a whole.
My point of view in the C vs. [insert_language_here] is that programming isn’t something you’re going to master any time soon, no matter how you try. Sure, you can use a drag and drop IDE, then punch in some calls to pre-defined methods, that you don’t even understand how is possible, how does this stuff you’re getting intellisensed and autocompleted really works behind the curtains. Your program might even run and do something, but honestly, you didn’t make it. You’re capable of finishing the puzzle (given there aren’t too many pieces), but you could never make the puzzle pieces yourself.
Who wants to make puzzle pieces? None I know, but given this scenario, it is more to the story. When, and I do say WHEN not IF your program breaks, chances are, you ain’t gonna be there to fix it.
In my example I’m actually using a question based on programming for the Mac, and a guy on this forum asked this question about to C or not to C before Objective-C.
If you jump heads on with Objective-C, the IDE will off course make you more productive in shorter time than if you want to go through the nuts and bolts of C first.
But, the thing is, chances are you’ll be producing bloated, slow running, crash-prone, badly designed application logic, but the GUI will look like a thousand bucks, because Apple engineers did the work with the GUI components.
The one important thing to learn, is that, it is all in the logic. The efficiency requires thorough planning and heaps of experience.
To program efficiently in a object oriented language like C++ or Objective-C is a seriously hard task to master. Programming efficient in C is so much simpler. The top to bottom, linear way of thinking, concentrating on the most efficient method for solving each tiny bit of the application’s workflow, and seeing your functions and methods working as a charm, that is the art of programming.
And in Objective-C as well as in C++ you are totally allowed to directly call C library functions. Stuff you’ve made or from the C standard library.
Most pieces of efficient code (and I’m talking about ALL CODE PRODUCED) is written in C these days. Python is written in C, Perl, as well as many other “interpreted” languages.
C is the core of C++ and Objective-C. Java is something I’d rather not discuss. Same goes for C#.
So, YES. Learn C. It won’t take more than a year to get sufficient knowledge before moving on. If you don’t have time for that, it is up to you. But, mark my words:
C is a relatively simple language. Learning C will make any other programming language much more understandable later.
Higher level languages are abstractions from the lower level structures that drives them.
If you know these lower level structures, you don’t have to spend time learning how to use some abstraction, be it in form of a framework fragment or whatever. Just write efficient code in C, and call it from the higher level languages.
Its only possible to create anything if you know how to make it.
So do you need to learn C before Objective-C? No, but I would.
Else I would feel like a man that calls himself a car mechanic, but actually he only knows how to fix the brakes, because that’s what they do at his garage.