4 ms·
C is an excellent first language when teaching in a CompSci type environment. If the students are of a different discipline (not aiming to be CompSci grads) or
by 3amOpsGuy 14y ago
C is an excellent first language when teaching in a CompSci type environment.
If the students are of a different discipline (not aiming to be CompSci grads) or much younger then i think there are better choices e.g. Python.
In a CompSci academic setting i think learning assembly first (that is first programming language but in parallel with the other classes such as computer architecture etc.) is also a valid approach.
Programming from the Ground Up [1] is a very accessible introduction to x86 ASM and even supposing you don't go any further than the examples in this book, you'll still feel the benefits.
[1] http://ftp.igh.cnrs.fr/pub/nongnu/pgubook/ProgrammingGroundUp-1-0-booksize.pdf http://ftp.igh.cnrs.fr/pub/nongnu/pgubook/ProgrammingGroundU...
- jorangreef 14y agoThanks for the link, found a choice quote from there on page 234: "If you are constantly looking for new and better ways of doing and thinking, you will make a successful programmer. If you do not seek to enhance yourself, 'A little sleep, a little slumber, a little folding of the hands to rest - and poverty will come on you like a bandit and scarcity like an armed man.' Proverbs 24:33-34"
- tripzilch 14y ago"And thou shalt make loops" Exodus 26:4
- jlgreco 14y agoI am split on if I think C/assembler is the best introduction material for computer science, or if scheme is. What I am rather certain of though is that just about everything in-between is not. You don't really see the best of both worlds, but rather the worse. (I should probably clarify that I think there is a large disconnect between what makes a good language for teaching and what makes a good language for software development in a corporate environment.)
- cpeterso 14y agoI think the best introduction would be Scheme (to learn algorithms), assembly language (to learn machines), and then C (to unite the two). After that, I would recommend some strongly-typed language like Haskell or OCaml. And finally Python to actually get work done. :) My friend said that UC Berkeley's undergraduate CS program followed this introduction. (In the 1990s, at least; I don't know about now.)
- Nicole060 14y agoI think the case could be made for either C or Scheme because they are both quite small languages compared to most of the pl that are in common use. I've seen people start with something like C++ and they spend more time playing language lawyers than learn about algorithms and data structure.
- _delirium 14y agoThose are two of the "pure" approaches, and recently there's a third one, something in the ML/Haskell orbit. C for the low-level/machine-oriented approach, Scheme for the lambda-calculus-esque approach, and ML/Haskell for the type-theory-oriented approach. Whether the Scheme approach is the best theoretical introduction depends on part on how important you think type systems are to modern CS. Much of PLs thinks the answer is "very important", since they view types as the basis of rigorously specifying program behavior. Rob Harper has taken that view at CMU, for example, using Standard ML in his revamped intro course. (I'm not strongly opinionated on that subject myself.)
- sedachv 14y agoI think Scheme is the way to go because it's very easy to build a real compiler for it and introduce assembly that way (see http://scheme2006.cs.uchicago.edu/11-ghuloum.pdf http://scheme2006.cs.uchicago.edu/11-ghuloum.pdf if you don't believe me).
- pwaring 14y agoThe benefit of Scheme over C is that people are less likely to have experienced it before university/college. We were taught Java and C/C++ in CS, but the problem was that many people already knew them, so you ended up with a situation where half the students were bored and the other half had no idea what the lecturer was talking about.
- chromejs10 14y agoI still prefer Python as the first language someone learns. Especially in a school environment where someone is trying to decide majors, starting off in C might be too much to grasp. It might be a turn off for the person where as in Python can get students up and running quickly and able to produce some really cool things (games (pygame), a twitter like app (using google app engine), etc. I'd rather get someone excited about CS first then go back and teach them the important inner workings such as memory management, pointers, heap v. stack, etc.
- JamesLeonis 14y agoI don't (technically) agree with assembly as a first language because of the daunting amount of system knowledge a beginning student needs. However, once a student starts groking C (or C++ for that matter), especially pointers, bit manipulation, and stacks, I think assembly is invaluable for really understanding what the computer and your code is doing. This is especially true when paired with the aforementioned systems course. I guess I am agreeing with you in the end...
- rbanffy 14y agoI'm in for assembly as a first language, provided it's for a clean architecture. A PC has all kinds of weird legacies (that enable it to boot MS-DOS and behave like an IBM 5150) that can make life miserable for an apprentice. People say x86_64 is much cleaner than x86, but I'd prefer ARM, MIPS or 68K. I learned assembly on an Apple II and the 6502, while anachronistic by today's standards, is a nice place to start. Maybe one day I'll find the time to learn enough of VHDL to implement a 6502-inspired 64-bit processor and build a reasonable computer around it.