Hacker News new | past | comments | ask | show | jobs | submit login

I disagree.

While I think C is a valuable language to learn and I agree with your reasons for learning it, I do not think it should be someones FIRST language. It would make a great second, though. Why? Because C (and C++) has a lot of confusing cruft that a beginner just doesn't need to know about. The noise in the language is too high and too much work is involved in achieving relatively simple things. A higher level language also has quicker returns, which definitely helps keep someone whos just starting out motivated. Most high level languages have better tools to learn with too, like an interactive read-eval-print-loop.

I would recommend Python. Not Python 3, but Python 2.6 - better library support. I recommend Python because it takes very little to get working and it comes with everything a beginner would need bundled. When you're learning, you don;t need direct hardware access, you don't need direct OS interfacing, you don't need high performance (and probably wouldn't get it anyway until you learn how to write good, fast C). You DO need to get things done quickly (its hard to learn, otherwise) and you DO need an environment that doesn't require much background knowledge to work in. In Python, a simple program is simple. Theres no need to learn about "main" (and therefore functions), about includes, printf format specifiers and so on - just to write a hello world. As your skill increases, you can gradually add more language features: conditional statements, loops, I/O, functions, data structures, classes, functional programming tools, libraries, metaprogramming. You dont have to deal with manual memory management and you'll get more meaningful error messages than "segfault".

You learn a lot about PRGOGRAMMING (rather than having to deal with the low level complexities of C) which can then be applied to almost any language. If you outgrow Python (and I don't think you ever would, I know people who write some amazing stuff in Python, including HIGH PERFORMANCE CODE) you can learn C. I'd recommend it as a second language. Everything you've learned from Python will be applicable in C too. At this stage you should be well versed and pointers should come a lot more easily. You can also use Python and C together - its not even that hard.

You could easily replace Python with Ruby in the above, if you prefer. Python and Ruby are pretty much equal players.

If you don't mind going a less mainstream, I'd suggest learning Factor: a fast, powerful, very dynamic, native compiled concatenative language. It has pretty much all of lisps powerful features, with some ideas taken from Forth, Smalltalk and others, has an active community and very clean codebase. (The library code is some of the highest quality code ive seen) being stack based, it may take some effort to get into the mindset though.




All excellent points. But remember the original questioner already knew some python and some VB. C is probably an excellent choice for him, though personally I use Python for the vast majority of my code. Of course, my work has morphed to be more system and database administration than programming lately so I may be biased by that.


The poster's first language is technically VB6.

If you can make the effort, you can learn programming with C. You need good learning materials (which are available), you need to work hard, and you need to focus on learning C rather than trying to cram C into an otherwise generic introduction to programming.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: