6 ms·
I'm surprised that people have managed to get through a CS program without learning C (or, at least, C++)! It seems to me that programming should be taught simu
by cballard 11y ago
I'm surprised that people have managed to get through a CS program without learning C (or, at least, C++)! It seems to me that programming should be taught simultaneously in Haskell (or Lisp?) and C.
- C teaches you how computers work.
- Haskell teaches you how programming logic works.
- luiz-pv9 11y agoC was the first official language I learned in school. It was very hard at first, mainly because I couldn't see how everything (memory management, pointers, references, data structures, etc.) would fit in a real world scenario. We didn't learn about Make and building automation until 3 months in the course. `gcc myfile.c -o myfile` was all we did, one concept at a time. Maybe programming 101 should start with a higher level language and dive slowly on "how does that work?".
- AlexeyBrin 11y agoProbably because some modern CS programs use Python for their intro courses and Java for the advanced ones.
- khedoros 11y agoThat's about right, I think. Mine started with Java (because the school was heavily supported by Sun). Some more advanced courses went into other styles of programming (Prolog for logic programming, Lisp for functional, ARM+MIPS assembly for low-level understanding). The C++ courses were purely electives and were taught in a "C with classes" style when I took them around 2005. Of course the compilers, networking, and robotics classes all assumed fluency in C, and of those, the series on compilers was required, so it was impossible to escape learning at least some enough C to pass those classes.
- Tomte 11y agoC doesn't really tell you how computers work, a healthy dose of Hennessy's book and an accompanying lecture works much better than learning C. But C has immense cultural value. Lots and lots of extant source code, important source code: Linux. The BSDs. PostgreSQL, SQLite, whatever. C is the lingua franca. "Everybody" speaks at least a little C, so it can be used as pseudocode notation (without learning some specific, maybe even ad-hoc, pseudo language).
- mbrubeck 11y ago> C has immense cultural value. Lots and lots of extant source code, important source code Yes, exactly! In my opinion, C for a programmer or computer scientist is like Latin for a medieval scholar. You don’t need to speak it fluently, but it’s good to know enough to read other people’s works and understand how concepts are expressed. In practical terms, I think that almost any programmer can benefit from reading K&R and doing the exercises in it, even if they never go on to write “real” programs in C. The book is very short and readable, and finishing it is a much tinier task than learning the standard libraries and toolchain options and best practices and all the other stuff you need to be productive writing production-quality code.
- allbody 11y ago> a healthy dose of Hennessy's book Most any CS book seems to have been written in C, Java, C++ and lately, Python. Are there books on computer architecture, algorithms, compilers, whatever written in Scheme?
- Tomte 11y agoI have no idea what you're talking about. Are you interested in finding such a book? Do you try to refute any of my points? If so, which one?
- allbody 11y agoI am not refuting. I was actually asking if there are CS books written in Lisp. Almost any CS book I've seen relies on C, C++ or something along those lines. > Are you interested in finding such a book? Yes.
- Tomte 11y agoAh, okay. Off the top of my head, only Structure and Interpretation of Computer Programs. But that's... different. And Paradigms of Artificial Intelligence Programming.
- 11y ago
- agentultra 11y agoI'm of the mind we should be teaching predicate and temporal logic, formal methods, and critical thinking before teaching languages. Though if you were to start with a language C might be a good one just to show you how sloppy thinking leads to incorrect behavior and poor performing programs.
- ArkyBeagle 11y agoI think you are absolutely right. This will (apparently) never happen. I actually had a conversation with the mathematics department chairman about this after I took the formal logic course as a junior in college. "Why wasn't this the first course I took?" I made A's on all subsequent math courses; I'd been a lot B's and C's up to then. He didn't say he knew why we don't. Now, this is a smallish college that started as a normal school - a teacher's college - and still is a teacher's college. The only graduate courses there were in education. I think we all actually know why. We cargo cult these things to a deep level. I don't think it's intentional; I think that very few people know what rigor and formalism are. It's painful to learn.
- dragonwriter 11y ago> - C teaches you how computers work. Except it doesn't. If any language "teaches you how computers work", its assembly. While a lot of the quirks of C's design compared to more "pure" structured programming languages (e.g., Pascal) reflect a desire to provide more direct access to common low-level features of systems of the time when C was introduced, it doesn't really teach you how computers work except insofar as trying to understand its quirks might motivate some inquiry into how computers work.
- notacoward 11y agoAgreed. I would say that C teaches you how the OS API works. That doesn't map well to how even a simple computer works, let alone one with multiple processors, complex memory hierarchies, north and south bridges, various I/O adapters, etc. Don't even get me started on anything virtual or distributed. Knowing C might help, to the extent that code which might be useful to gain such understanding tends to be written in C, but the language itself isn't going to impart those lessons.