I was walking up to a Starbucks today when I noticed a guy outside smoking, working on his laptop and reading two books on learning C. Ugh. Why people feel the need to torture themselves by learning to program through C is beyond me. It's like learning surgery by being given a pair of chopsticks and being told to remove one of your testicles. Learning C++ is like learning more about surgery by being given a rusty spoon with the directions to re-attach the testicle.
Eric will likely disagree with me on this. But I think it's best to learn programming through a high level language, like Ruby or Python. That will teach you the basics, structured programming, data structures, objects, how to decompose a problem, how to refactor, all that good stuff. Then if you get a job writing device drivers for graphics cards you may want to learn C. Otherwise, just stay with the high level stuff. Moores Law worked, damnit! Use a garbage collected object-oriented programming language.
Posted by jherr at September 6, 2007 02:15 PMActually, when I taught a "Intro to Programming" class at Certive I used Python:
http://eric_rollins.home.mindspring.com/introProgramming/index.html
Today I would probably teach it in Ruby. For many purposes Python or Ruby will be all a user needs. A potential problem, though is in using them to learn algorithm concepts like Big-O complexity. Part of the power of Python and Ruby comes from having built-in operators (such as "in") and types (such as dictionaries) with greater than O(1) complexity. They do more work for you in fewer lines of code. But this power makes analysis more difficult. C/C++ and Java restrict their built-ins to O(1), making algorithm learning and analysis easier. The more powerful operators and types are in separate libraries like STL.
[I haven't researched this in detail; certain Java features such as string concatenation using "+" are probably over O(1)]
I don't think you can effectively evaluate that student's choice without first understanding their requirements and situation. It depends on what they need/want to learn. If they want to understand how computer work "under the hood", C (or assembly) is a good way to learn. If they want to learn Un*x/Linux/BSD kernel internals, C is almost mandatory. If they want to learn procedural programming, C works as well. If they want to learn how OO works and is implemented "under the hood", C is not bad either.
I believe it is important to learn general program using several programming languages. Learning C, Ruby, and Lisp might be a good start. As they say in Perl: "There is more than one way to do it"!
Thanks for signing in, . Now you can comment. (sign out)
(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)