4 ms·
The thing that makes C a good candidate is that it's a very very small language. Yes there are plenty of strange quirks that the experts need to deal with but y
by banachtarski 13y ago
The thing that makes C a good candidate is that it's a very very small language. Yes there are plenty of strange quirks that the experts need to deal with but you can come up with an elegant and compact implementation of every standard data structure.
High level languages tend to favor one data structure over another. Starting with those languages can give students the "hammer syndrome" w.r.t. that structure.
- anaphor 13y agoI see this a lot with functional programmers and linked lists. Yeah you can derive a lot of data structures from a list, but sometimes it's like putting a square peg into a round hole, and a custom data structure would be more efficient.
- nbouscal 13y agoAs far as I can tell, only hobbyist functional programmers try to make everything work with linked lists. Most people who write in functional languages professionally know to use the correct data structure for the job, and how to do so (the most common educational resource being Okasaki's Purely Functional Data Structures).
- betterunix 13y agoScheme is a small language as well, and it is worlds better for teach abstract concepts. You can write far more elegant and compact implementations of data structures in Scheme than you can write with C. As for preferring one data structure over another, C does that as well: arrays are the only data structure with first-class support.
- erichocean 13y agoScheme is a small language as well, and it is worlds better for teach abstract concepts. I've heard this claim many, many times, but for me, I find Scheme (and Haskell, for that matter) impossible to work with. I love what Scheme and Haskell do in theory, but in practice, I find them unusable for those things. With Scheme and Haskell, I find I'm always trying to figure out how I should make the compiler happy, vs. taking an abstract concept that I understand well and just implementing it, which is something I find easy to do with C. But I also suck at math, and my assumption is that for people who don't suck at math, Haskell and Scheme and all the others are probably easier, and that makes sense to me.
- smorrow 13y agoFunctions don't see arrays, functions see pointers, even if you passed an array. The sizeof a passed array is the sizeof a pointer. So they're not first class.
- pjmlp 13y ago> The thing that makes C a good candidate is that it's a very very small language. Modula-2 and Oberon are also quite small.