From there, sure, learn C++, Java, Rust, Go, Node.js, whatever toolset matches your industry. Start with the fundamentals, though.
From there, sure, learn C++, Java, Rust, Go, Node.js, whatever toolset matches your industry. Start with the fundamentals, though.
If you want to teach them a lisp as a first language, at least use Racket, which actually have modules designed for education. I think it's less of a headache to use a language with a more modern syntax, like python or pyret, but Racket is excellent of course. You can introduce lisp later in a undergraduate compiler/interpreter class so you don't have to talk about parsing for a month.
There is a terrific benefit to learning on a platform where you can not only look up documentation within the system (man pages), but also "dig deep" into the code of any particular piece of the system you are interested in. So in learning C, you gain access to the body of knowledge contained in a Linux system, or contained in a BSD, and when you get curious about something like "These loops and conditionals are all fine and well, but how does a window actually get drawn to my screen?" you have everything at your fingertips to go and answer it.
Is that connection to the machine possible without learning C? You could use a toy operating system written in something else, but you miss out on the honesty that comes from teaching the same system that people are actually using (or at least able to use).
I think Go might not be an unreasonable alternative. It shares C's philosophical heritage, removes the need for manual memory management, and is capable of exposing a student to pointers, creating images, and HTTP communication all within the stdlib and the first chapter of the official book. The only downside, as I see it, is that one would need to additionally learn something like Rust to be able to apply the concepts to things like kernel drivers and close-to-the-metal programming.
this is a garbled thought. The average person may have trouble with manual memory management, and C requires some manual memory management (the stack is automatic), but that's not C teaching bad habits.
You can learn to do manual memory management in C, because C teaches manual memory management.
that doesn't make manual memory management a good idea for the average programmer, but that's not C's fault.
experience with C teaches good manual memory management in the same way that working with sharp knives teaches good knife management. Do professional people get cut with sharp knives? yes. Are sharp knives a good idea? yes. All the time for everybody!? nope
Lisp famously has one of the simplest syntaxes possible that is still structured, and one of the simplest data structures to understand. There's almost nothing to it.
And why would you introduce Lisp in a compiler/interpreter course, to people who are presumably already quite advanced in their knowledge?
Lisp is best as a teaching aid to introduce common high-level language concepts, in a way where it's clear how they all actually work in a familiar syntax- because it's Lisp nearly all the way down. (No black boxes.)
Most other languages suffer from a "trust me" problem, where students are taught what complicated things do but have to take it as gospel because they can't read the implementation, so they end up with high level concepts but no idea what's really going on to make those work, and a vague belief that "underneath" is more complicated and mysterious than it has to be. (Black boxes abound.) Indeed some students struggle to understand high-level concepts until they can see the mechanism.
From that foundation, they'd have the exposure they need to expand out.
I also enjoyed the path my University took. You started with Java. Data Structures was in C++, Java, and Python. Operating Systems was in C. AI was in Common Lisp (with some examples in Java and Python). Programming Languages was in any language you wanted, but examples were mostly in C and SML (SML/NJ). Computer System Design was in HDL, Assembly, and C. Software Design I and II used Java. Requirements Elicitation and Specification used Z. Concurrent/Distributed systems I and II used Promela, SPIN, TLA, and code was in Java.
Universities should not have become fearful of teaching Lisp and Smalltalk in the first year, once Java gained popularity.
C is fun for playing with pointers and doing raw memory things, but it becomes overwhelmingly painful and frustrating so quickly. And for the wrong reasons. Once you have to touch macros, or want to reuse code, it is just … old. Not hard, not minimalistic - just old. C can be fun the way bash can be fun, or baking without a recipe. It is fun to overcome an arcane mess, for the challenge. But you really learn little, or the wrong thing.
And C is not easy to look up online either. It took me so many hours figuring out some things are just not possible in C (without making it a new language via macro madness). Things that should be possible. Like „generics“. Kinda possible, but never satisfying. You constantly have to endure verbosity over abstraction. Not because that’s how computers work, but because how people did it 30 years ago, or because some industrial microcontroller needs it this way.
IMO whatever C can teach you, assembly can do better. Without tricking you into believing it’s a practical choice for most anything.
I think Rust is visually offputting for new students and it’s not really a good choice, but at least you learn something important, when things get hard. In C you are either trained to view programming as the most repetitive, joyless activity ever, or to indulge in hacking your way around broken shit, disregarding cooperation (with your future self), universal elegance and safety.
If there is „one language everyone needs to learn“ it’s some accessible and fun, which let’s enjoy computers and not tell you limits at every opportunity. There is no way to avoid C entirely, if you enjoy programming anyway; at some point you have to interface or tweak C, most likely.
Other than, oh, things like getting the same code to produce exactly the same result on two different machines, where the sizes of the types being used by the code are different.
BUT, if you are coming from a networking/file perspective I can emphathize with you. Byte ordering is a pain for data serialization, even that has chance to cause issues and is no doubt a source of bug and pain.
typedef unsigned int whatever_t;
#define WHATEVER_MAX UINT_MAX
I can write the code such that I can edit whatever_t and WHATEVER_MAX to whatever values I want, and it still works, without changing any of the rest of the code.This is not very highly abstract, but higher than assembly language.
If you want to teach this sort of hardware independence, asm is probably not the best teaching tool.
I would say C taught and learned correctly can teach you the memory model computers use and the concept of pointers. Other languages do other things better, like Java can teach you about memory management via garbage collection and references.
It is a fantastic language to use because the tradeoff is obviously evident in the language.
You can use Smalltalk for a day. Understand the history. Understand the compromise.
And Objective-C captures a beautiful moment in the trajectory to ever more high level abstraction.
It really is astonishing that most programmers (whom I know) consider Lisp to be this weird language with too many brackets.
Programmers (humans really) are really good at having knee-jerk reactions to things and then sticking with the same opinion for some reason. As engineers, you would think we'd be better at looking at things objectively, but somehow discussions/thinking around programming languages tend to be a very emotional thing for many, so they stick with their first impressions.