Hacker News new | ask | show | jobs
by pabb 4410 days ago
I started typing a really verbose and roundabout answer that really just amounted to this.

I don't even really agree with learning Python first. If you can get over the hurdle that is learning C (or really even just Java), you have the benefit of learning so much more about computing and the fact that types are implicitly being adhered to, memory is being managed beneath the surface, garbage collection, etc. I learned Java for my intro programming course and luckily had an instructor who really emphasized those topics. It made learning C and subsequently assembly much simpler. Had I started in Python, I don't see really learning much more than "wow, I can do some cool things with a computer." I suppose that's okay if the class is advertised as programming for non-CS majors, but to teach Python as an introductory course for CS curriculum seems almost like robbery to me. Jump the initial hurdle of learning the (somewhat) low-level stuff, and then the rest will come easily.

2 comments

That's a reflection of the skill/desire of the programmer and not their initial introductory language. A naturally curious and intelligent person who wants to get better at their craft is going to learn about this stuff. Some people are happy learning enough to get by, and that's ok. Not everyone is destined to learn everything about their machine down to how disk controllers work.

Personally, I barely learned enough C to even be dangerous, and it's had no negative effects on my work. I have a reasonably good understanding of how Python works at the abstractions that I need to. If I need to learn more, I go figure it out. In truth, the most useful stuff I learn about writing efficient code comes from reading articles/blogs that give medium-level overviews of how a language implements certain features and how it effects your software. Would knowing C help with that? Not in the slightest.

I learned Java for my intro to programming. Later, I guess 2 years or so later, I began to take an interest into how and why programming languages work. Java throws an error if my index is out of bounds, which means it needs to check it itself, but what would happen if it didn't? What do I need garbage collection for? Why can't the compiler stack-allocate most objects whose references don't escape the scope of the method? How does the runtime know when it has run out of stack space? Does it check it on every new stack frame? Does the stack grow dynamically, or is it allocated ahead of time into one continuous, monolithic chunk? Can an ideal compiler infer the maximum size that the call stack will have at run time (modulo Halting Problem)?

I don't feel that my curiosity was permanently damaged by learning Java. On the other hand, I wouldn't have necessarily have wanted to learn anything about lower-level languages for its own sake, except perhaps only out of some sense of duty that 'every programmer should know this and that'. But since I have an interest in programming languages - which I of course didn't know that I would develop when I was learning my very first programming language - these things became relevant to me later.