5 ms·
I think there's a tension between two imperatives in teaching new programmers: 1) Learning must be applied learning. Give people problems to solve and they wil
by evdev 9y ago
I think there's a tension between two imperatives in teaching new programmers:
1) Learning must be applied learning. Give people problems to solve and they will come to you for data structures and algorithms, O notation, etc. If they don't, they should do something else
2) A lot of what's out there in programming languages are cargo cults, and newbies need to be prepared for this. For instance, virtual function inheritance isn't a thing. It's a weird call chain pipeline system glued into your vtable, which C++/Java teaching also won't bother to tell you exists. Make people start from assembly, graduate to C, then write their OWN vtable, so it's demystified. Now you've reduced the ability of software designers to piss on your leg and tell you it's raining.
So ideally I'd want students (at first) to be doing something either close to the machine or in the functional model. As they say though, the imperative of 1) means getting people to actually produce something, which is easier in Python.
- Cyph0n 9y agoAnother approach is to introduce newcomers to programming with a single course that: 1) uses Python to teach general programming, 2) uses JS to show how to write code that runs in a browser, and 3) demonstrates low-level programming patterns using C. This is essentially what CS50 at Harvard does, and it seems to work well. Once a student has been exposed to these 3 languages, subsequent courses can explain how a computer works and introduce new paradigms (FP, LP).
- evdev 9y agoYes, I think it's very reasonable to use a scripted dynamically typed language to learn control flow to start with. We tend to forget that the basics of loops and mutation are a hurdle for many people.
- jcranmer 9y agoWhile I think that most CS people should learn assembly and computer internals basics, it would be an absolute disaster to start students off in assembly as CS 101. Python is a fairly decent language for starting people off: * It doesn't have a lot of boilerplate, so no magic "I'll teach you what this means in three weeks" steps * Output for debugging is fairly easy, since print accepts a lot of stuff without needing to muck with formatting strings * Assignment is a statement, not an expression. You can't say "if x = 3" by accident * Python is one of the major programming languages, so you're teaching students something that is pretty much guaranteed to be useful for them.
- tmccrmck 9y agoBut many students come in with years of programming in a language like Python, Java, or C++. My friends and I built video games when we were in high school so we were comfortable in all three of those languages. Scheme levels the playing field. I have never encountered a student who entered university with years of functional programming experience and I was a TA for an introductory CS course. I think moving back to Scheme would be a wise choice for universities that are combating problems with diversity.
- jcranmer 9y agoIf students have years of programming experience, why are they being made to take programming 101?
- outworlder 9y agoBecause it is a required subject in your curriculum? You don't get to pass people just because they say they know something.
- eropple 9y agoMy university did. COS101 was an optional class for complete novices but if you weren't already at least exposed to programming your advisor would sign you up for it. COS125 was the first for-realsies class (taught in Scheme, as it happens).
- cbr 9y agoIf a student claims to know what the class would teach, you don't have to take their word for it: you can talk to them, or you can give them a test. (I skipped the first two intro CS classes in college after talking to the professors and figuring out the right place to start given my background.)
- tmccrmck 9y agoBerkeley used to let students skip the introductory CS course, 61a (in Scheme), if they had received a 5 on the AP CS exam. They removed that option I believe after fall 2010. One of my friends was able to skip 61a by meeting with the department chair, Paul Hilfinger, and convincing him that 61a would be a waste of time for him. My friend could drone on and on about the simplest of subjects so we assumed he just annoyed Hilfinger until he said "enough already".
- metaobject 9y agoI'm not sure new programmers need to worry about how virtual function inheritance is implemented via the viable. Are there even standards for that? Or is that an implementation detail which seems popular across multiple compilers? There's time for them to learn the details, but just learning that the functionality exists and knowing how to use it is a good start.
- evdev 9y agoThe point isn't to learn it as if it's something you'll have to recreate--it's to understand that "advanced" language features are built on top of the "fundamental" structural model and are not magic. You need some understanding of how programming languages are built in order to keep languages and libraries honest. Otherwise learning about type/object systems becomes learning all the pitfalls and incidental complexities caused by the design as if they're benefits and not costs.
- brianberns 9y agoMy problem with this sort of bottom-up approach to learning how to program is that what seems "fundamental" from one point of view always turns out to be an abstraction built on an even lower-level foundation. So, virtual functions aren't real because they're just vtables implemented in C. But C isn't real because it's just fancy assembly language. But assembly language isn't real because it's just fancy machine language. But machine language isn't real because it's just 0's and 1's zipping around the hardware. So I have to learn how integrated circuits work before learning how to program? No. Bottom-up knowledge is important for understanding performance and other trade-offs. However, there's also a lot of benefit in learning how to program in a formal system without knowing much about how that system is implemented under the covers. If I was teaching an intro programming course to undergrads in 2017, I'd be strongly inclined to teach them a clean functional language first (e.g. Elixir, F#, etc.), and only introduce gory details like pointers and memory allocation later on.
- nickpeterson 9y agoF# would be particularly well suited for this since it can reasonably do imperative, object, and functional styles. I'm not as familiar with Elixir to make the judgement there. Though I suppose one could also argue for something like Clojure.
- sanderjd 9y ago> So I have to learn how integrated circuits work before learning how to program? No. I took a couple classes in college that were designed to teach what is going on underneath the 1s and 0s of instruction sets. I didn't take the classes about how circuits work, but they existed, I had friends who took them, and I really wish I had as well. Maybe this isn't required knowledge to do software engineering, but it's definitely useful knowledge. Why wouldn't we want to learn these things?
- brianberns 9y agoI agree that these are useful and interesting things to learn. I just don't agree that they should be taught first when learning to program.
- agumonkey 9y agoI kinda despise the notion that assembly is everything. It's better than falsely higher abstraction like cpp and java but it's not all. Inductive logic and the functional paradigm maps onto all of these. And allows for more diverse abstractions without lying either.