5 ms·
starting with python is ok as long as theres a C class following. At various work places ive been to, the vast majority of coders know python or ruby or simila
by zobzu 12y ago
starting with python is ok as long as theres a C class following.
At various work places ive been to, the vast majority of coders know python or ruby or similar languages. They have NO CLUE how the memory is allocated, why some things in python are slower, etc. At some point they go 'its python runtime overhead'. But most of the time they could make the program much faster just by using better data structures in python. Most of the time they don't understand why something doesnt work the way they want and basically pray to get a premade answer on stackoverflow. While they could figure it out much faster by understanding how their machine works.
C has the advantage of being close enough to what the OS does (heck even C isnt always that close with compiler optimizations but - ok). Forces you to understand how the kernel works, how the CPU works, etc. Makes you a better python programmer too.
- pabb 12y agoI 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.
- scott_w 12y agoThat'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.
- Dewie 12y agoI 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.
- anon4 12y agoThere are basically two things we call "programming". One is the specification of a process in algorithmic terms - the abstract, but rigidly defined sequence of transformations on input data into output data. This is a field of mathematics. Two is the building of a physical system to take input data and produce output data, these days by configuring a complex machine comprised of many different pieces of silicon, each of which takes a string of bits and understands a concrete machine language. We have built a high tower of abstractions, so many different silicon-based computing machines can be programmed the same way without programmers going insane. This is a field of engineering. You need to teach both. They are two completely different skillsets and a successful developer needs to understand both sides - the mental tools necessary to make algorithms, and the engineering skills necessary to make machines that implement algorithms. You don't start from discrete mathematics and then proceed to trying to bang them inside a computer, nor do you start from silicone and then pretend this is the basis for algorithms. Both are starting points and you need to approach both as their own thing, not a continuation of the other. To this end, it would be for the best to teach both C and Python at the same time. I find that the two aspects of programming are their own mindsets and things learned in the beginning of each don't really carry over to the other. And then hope the student can put one and two together.
- LyndsySimon 12y agoWhen I set out to learn Python, I'd had passing experience with Visual Basic, PHP, Javascript and even a bit of Scheme. I understood what programming was all about, but I hadn't yet overcome the initial struggling to translate the logical flow that I had in mind into code. Now, almost a decade later, I'm still writing Python. Sure, I write my share of Javascript like most people, but Python is my first and true love. Python is shallow. There isn't a lot to it - once you understand how magic methods work, you're pretty much at the point where reading the source of the implementation is the next step in understanding. It wasn't long before I found myself learning the specifics of C data types in order to understand exactly how Python types worked. In short, my contention is that someone who wants to become a better programmer will become a better programmer regardless of their preferred language.