4 ms·
I've programmed for many years and taught programming; my trajectory through the various programming languages and paradigms seems to have worked for me. But th
by todd8 7y ago
I've programmed for many years and taught programming; my trajectory through the various programming languages and paradigms seems to have worked for me. But things have changed in big ways since I learned to program.
My first job after grad school was as an assembly language programmer. It's humbling and teaches some good programming practices (like "take a small bite and then run tests"). Today, assembly language programming is not appropriate for most applications. Processors are very fast, memories are very large, and instruction sets include numerous complex features that optimizing compilers handle very well. Meanwhile there has been one new programming language after another gradually improving the high level programming tools available.
If I was designing a university curriculum for CS, I would introduce languages in this order:
First Python, its basics are easy to learn and it allows new programmers to actually tackle interesting assignments. Those that don't go on in CS will have still acquired familiarity with a useful language for writing simple programs. It's a good language to use as a lingua franca in subsequent courses.
Second simple Java and OO design, there are just so many jobs using this language.
Third C, introduced along with a study of data structures. Learning data structures as an undergraduate is mostly learning linked structures of one kind or another and C is the best language for this. C is close to what's happening at the machine level whereas Python and Java have garbage collection and language features that already include lists, maps, etc. Studying data structures in C lets students see how these higher level abstractions are implemented and prepares them for seeing kernel code.
After this there are still some big important languages left out. Lisp/Scheme can be introduced in an AI class. Javascript can be introduced in a web programming class. Assembly language can be introduced in a hardware class.
The go language would work well for an algorithms class and "modern" Java with collections, streams, modules, etc. for an undergrad compiler class or software engineering class.
Naturally SQL should be used in a database class. Git could be introduced after the first year and used for all assignments. LaTeX could be required for all writing assignments.
The important language left out here is C++. It's just seems so difficult to learn that I don't know when or whether it should be taught. C++'s new features are big improvements, but the historical baggage is a lot to take on as a new programmer. When should C++ (or Rust, or Haskell for that matter) be learned?
- blub 7y agoC++ lends itself well to large-scale, performance-intensive, cross-platform software. Rust could in theory be used for similar projects. Using C to learn pointers & data structures gives students just enough rope to hang themselves later if they want to use C in a real project. I'd go for an STL-heavy C++ and dig into the memory handling and pitfalls. Students need to understand how to solve resource management issues in low-level programming. Since they're essentially unsolvable in C (be careful, try harder, use valgrind & pray), it doesn't seem like a good teaching language.