10 ms·
In college I used to tutor students in computer science. Mid-way through my college career my school switched the curriculum to teach Python instead of Java. I
by lumb63 5y ago
In college I used to tutor students in computer science. Mid-way through my college career my school switched the curriculum to teach Python instead of Java. I found that the students who took Python lacked what I considered a basic appreciation for and understanding of how the language actually ‘does’ something.
For instance, when you only need to write two curly braces to create a “dictionary” (of course behind the scenes this is a hash table) many of the nuances of that data structure are hidden from you. You have no idea that accesses are O(1) amortized but worst case are O(n). Even if you do, maybe you don’t understand why. You have no idea that there is reallocation and collision handling code working behind the scenes constantly.
Python also lacks a number of nuances I consider it important to be aware of. You live your entire Python life blissfully unaware that everything is a pointer, and the impact that has on performance. You never come across static typing, or that it is possible to check your code for some level of syntactic correctness before it runs (i.e. Python is interpreted rather than compiled).
I think from this standpoint, it is worth learning a language like C to gain an appreciation for how truly complex a lot of the things Python allows you to do, are. I think that anything which helps you better understand what it is you are doing, how you are doing it, and why you are doing it that way, will make you better at doing that thing.
- mitch3x3 5y agoFor many people (myself included), the ease of writing python jumpstarted my journey to eventually learning everything else you mentioned gradually. If I would have had to learn it immediately I most likely would’ve felt disinterested and overwhelmed and given up since I didn’t know yet why I needed to learn it.
- tmjdev 5y agoThis is my major gripe with the college courses I took. They start at the molecular level and build to the planetary scale. This works for some people, but for me I had the hardest time finding a personal interest until I got to the application. It was the application I wanted to build, and to do actual work you don't manipulate the molecules directly. Build an application, then as you need to learn more to get things done you naturally pick up a deeper knowledge of the tech you're using. Of course this is different for everyone.
- buffet_overflow 5y agoAgreed. I've found the insistence my college professors had on writing everything yourself and not using libraries or modules for common tasks to be in the end counter productive. Namely for the reason you described. To reference Carl Sagan, I didn't have the stamina in the beginning to build the universe before I made my apple pie. Additionally, code is more collaborative than that, and it shows in a lot of engineering departments when people aren't trained on how to look at the shelf for existing parts before building something new.
- KhoomeiK 5y agoYup yup yup. I've been coming to this realization about myself so much recently too. It's how I taught myself web/app dev with hackathons, facing a huge project head-on and "backtracking" to learn stuff as needed. It's how I taught myself machine learning by jumping into a research project with a prof without ever having written PyTorch. And it's how I'm now teaching myself higher math, having just jumped into the homotopy type theory textbook and an idea I have for application in NLP, and going backwards to learn the required category theory and algebraic topology. I wonder whether the fundamental structure of curricula could be changed to take advantage of this fact, because I think it's true for a lot of people.
- westurner 5y agoFrom https://news.ycombinator.com/item?id=28709239 https://news.ycombinator.com/item?id=28709239 : > From "Ask HN: Is it worth it to learn C in 2020?" https://news.ycombinator.com/item?id=21878372 https://news.ycombinator.com/item?id=21878372 : (which discusses [bounded] memory management) > There are a number of coding guidelines e.g. for safety-critical systems where bounded running time and resource consumption are essential. *These coding guidelines and standards are basically only available for C, C++, and Ada.* > awesome-safety-critical > Software safety standards: https://awesome-safety-critical.readthedocs.io/en/latest/#software-safety-standards https://awesome-safety-critical.readthedocs.io/en/latest/#so... > awesome-safety-critical > Coding Guidelines: https://awesome-safety-critical.readthedocs.io/en/latest/#coding-guidelines https://awesome-safety-critical.readthedocs.io/en/latest/#co...
- kibwen 5y agoThere are certainly some advantages to be gained from greater mechanical sympathy and an appreciation of static types. However, in the modern day, I wouldn't suggest a Python programmer learn C to achieve either of these things. For a Python programmer who just wants to learn about static type systems, learn Typescript. For a Python programmer who wants to learn about static type systems and mess around with pointers, learn Go. For a Python programmer who really wants to get elbow-deep in a natively-compiled language with a fairly sophisticated type system, learn Rust. For someone who doesn't want to actually use C and just wants to learn concepts, C doesn't really have any advantages these days. Its type system is anemic, its compilers are unhelpful, its abstractive capabilities are poor and leaky, and its claims of being close-to-the-metal are overblown on modern processors. There are plenty of good reasons to learn C, but IMO "to become a better Python programmer" is not one of them.
- DarylZero 5y agoThose are all vastly more complicated than C. And on top of that you have to learn three instead of just one! (Imagine trying to learn Rust without experience with C. Oh man.)
- kibwen 5y ago> Those are all vastly more complicated than C. C's simplicity is an illusion. The vast quantity of footguns and edge cases make writing correct C extremely complicated. > And on top of that you have to learn three instead of just one! You don't need to learn all of those, select one based on what your goals are. And it's not like gaining a surface-level understanding of any of these programming languages would take more than a week to a month anyway. > Imagine trying to learn Rust without experience with C. Oh man. It's quite the opposite. Rust is a dream to learn compared to C. The Rust compiler is like having a personal tutor at your beck and call to teach you systems programming best-practices. Without exaggeration, these days I would not suggest someone start learning C until they have learned Rust.
- sseagull 5y ago
- nopenopenopeno 5y ago>when you only need to write two curly braces to create a “dictionary” (of course behind the scenes this is a hash table) many of the nuances of that data structure are hidden from you. You have no idea that accesses are on average O(1) but worst case are O(n). Well, that is wrong. Single value accesses are O(1) amortized. Also, Java is a lower level language but I don’t think simply programming in Java instead teaches you this. Either way, it’s the difference between learning how to write programs and learning computer science.
- BBkid 5y agoYou got me curious there. Do you have any resource recommendation to learn about the cost of different data structures/algos and such?
- solarmist 5y agoThis is what big O (also little O and little omega) notation is all about. Unfortunately, all the resources I know of teach it as pure mathematics, so they require a firm grasp of mathematical proofs to understand the details and implications. With that said I highly recommend the classic Introduction to Algorithms (CLRS for short) by Cormen et Al. It is written in clear and straightforward language. And the lectures on MIT OCW by Erik Demaine are outstanding. By reading and watching the lectures I deeply understood stuff that I had just muddled through previously. https://en.m.wikipedia.org/wiki/Introduction_to_Algorithms https://en.m.wikipedia.org/wiki/Introduction_to_Algorithms
- voakbasda 5y agoIntroduction to Algorithms is a classic that every serious programmer should read cover to cover. at my first programming job (now almost 30 years ago), I remember implementing the red-black tree algorithms in C from that book. It is chock full of really useful ideas that will make your systems better.
- amirkdv 5y agoCLRS is the text, but for a more gentle introduction see Grokking Algorithms.
- agumonkey 5y agoIdeally you'd teach python to build a c compiler. ;) That said do people know more about the innards of Java ? It shield you from a lot of details too. From memory layout, to polymorphic calls.
- NikolaNovak 5y agoI agree with everything you said, and feel exactly the same way; except my university switched from C to Java mid-way my attendance... so it probably just goes to show something or the other :->
- ensignavenger 5y agoIt seems like many of these problems were holes in the curriculum more than weaknesses in Python. However, modern python has type annotations, which help a lot with checking the program for correctness. I would say every one of these concepts can be taught with effective curriculum using modern Python. Now, I still think one studying computer science would be well served to learn C at some point! But Python is a great replacement for Java in the curriculum.
- bigodbiel 5y agoI always liked the stick shift versus automatic for drivers ed analogy. Yet in an era where inclusiveness and student retention are deemed more important than foundational learning, its no wonder Python is getting mass adoption.
- codyswann 5y agoNone of that pays the mortgage, though.