3 ms·
This is why always say the true beginner programming language is C. Stupid easy to learn, have some loops, have some conditions, make some memory allocations.
by eddd-ddde 2y ago
This is why always say the true beginner programming language is C.
Stupid easy to learn, have some loops, have some conditions, make some memory allocations. You will learn about the fundamentals of computing as well, which you might as well ignore (unknowingly) if you start with something like JavaScript (where is this data living in my computer?).
- n_plus_1_acc 2y agoHow can you teach C when there's no list of UB, there's sometimes no agreement on how to read the standard, and loads of non-standard-compliant compilers.
- bobthepanda 2y agoPlenty of universities teach C every day even if that means specifying a compiler, and usually it’s a very boring compiler that gets chosen
- n_plus_1_acc 2y agoRight, but all C courses I've done had UB in examples without mebtioning it. There teachers just didn't know what they are teaching.
- bobthepanda 2y agoUnless you are writing a compiler and code specifically tailored to take advantage of UB, there’s not much to say about it other than “be careful about UB cause it can make your program buggy from your POV.”
- lelanthran 2y ago> How can you teach C when there's no list of UB, there's sometimes no agreement on how to read the standard, and loads of non-standard-compliant compilers. Right. Becuase no one ever learned C as a first language ever, and those that paradoxically did were worse programmers for it!
- n_plus_1_acc 2y agoAre you saying people who learned C as their first programming language are better programmers or worse?
- lelanthran 2y ago> Are you saying people who learned C as their first programming language are better programmers or worse? That's both a false dichotomy and irrelevant as well. My message is "There are multiple excellent (even legendary) developers in the short history of our field that learned programming in C. There are many more who primarily used C". This refutes your point completely.
- lukan 2y agoAnd this is why I always say, we have a world full of computer consumers, not programmers. C as a first language is only easy, if you happen to bring along a deep technical interest (and pre knowledge) about the "technical fundamentals of computing". Most people do not have that. Tell them about heap and memory allocations and you will get a blank stare. But show them some simple functions, to make some flashing graphics on the sceen - and they will have fun. And can learn the basics of programming at the same time. And then you can advance more low level, for those who feel the call. But please don't start with it, unless you have some geeky hacker kids in front of you who really want to learn computers. Then C makes sense. For "normal" people not so much.
- randomdata 2y agoExcel is the best first language if you just want a world full of computer programmers. But there is an implicit context here around those who want to program alongside the professionals. That comes with wanting some deeper understanding of the machine.
- hombre_fatal 2y agoThe problem with C is that beginners generally want to build something. "Oh, you want to build an app that does X? Well, first learn C for three months and then switch to Python/Javascript/etc. to build the thing that motivated you in the first place" doesn't fly.
- GordonS 2y agoAye, especially nowadays with the ubiquity of computing - "hello world", or console apps in general, aren't the most enticing of projects anymore.
- int_19h 2y agoFrom that perspective, something like Pascal or Modula-2 is much better - you get all the same stuff but no footguns.
- eddd-ddde 2y agoActually yeah, I'd say even something like zig would work but that's pushing it a little bit in terms of feature complexity.
- jerf 2y agoI'm not saying this because I like Go per se, though one might argue I like Go because I can say this, but "Go, but stay away from all concurrency for a while" is becoming my go-to recommendation for new programmers. Fewer foot guns, it's close enough to the metal you can learn about it (there's even an assembler you can play with if you want to), and despite being 15 years old is essentially not the result of 15 years of language-construct-astronautics. It also lacks a lot of the accidental complexity of C in the compilers, using new modules is "go get" rather than essentially learning a new sublanguage, a lot of advantages. But do stay away from the concurrency. I occasionally get flack on that point, but try to remember back to your programming days when you were having enough trouble keeping track of how one instruction pointer was flowing; it doesn't help to immediately try to keep track of multiple. Gotta recover the novice mindset for a moment when recommending programming langauges. I used to recommend Python, as many others did. Your cited disadvantages of such languages are certainly true, but Python used to make up for it with the ability to do real work relatively quickly, and while it may not have taught you how the machine worked, it did a good job of teaching programming. But now... well... Python was my primary hobby language for about 8 years around 2000-2008. I'm fluent in Python. I wrote metaclasses. I wrote a bit of a C module. And I can still read it, because I do check in from time to time. But it's not the same language anymore, and almost every change it has made has made it harder to recommend as a new language. It used to be the simple alternative to Perl that still had most of the power... now I think it's harder to read than a lot of Perl 5, what with all the constructs and the rules about what happens and the difficulty of resolving what a given line is going to do with all the ways of overloading and decorating and overriding everything. And the culture of having all this power, but using it selectively, is gone from what I can see; now it's "we have all this power and what a shame it would be not to use it".