6 ms·
guys, >The first language should NOT be the easy one, it should be >one that sets up the student's mind and prepare it for >serious computer science. >C is per
by munin 14y ago
guys,
>The first language should NOT be the easy one, it should be >one that sets up the student's mind and prepare it for >serious computer science.
>C is perfect for that, it forces students to think about >memory and all the low level stuff,
as one low-level programmer to another, I hate to break it to you, but "low level programming" is not "serious computer science". the two have very little to do with each other.
- lucisferre 14y agoIronically C is technically a high level language anyways.
- heretohelp 14y ago'ish. C exists in the middle territory between high (colloquially right now) and "original" low-level programming. By all accounts, virtually any language that operates relatively close to the semantics of the machine in terms of operations and memory (pointers are a standard abstraction in assembler) is a low-level language. The only things that detract from C's low-level credentials are that it is more of a hybrid attempt at grafting a harvard machine onto von neumann machines and its functions. The functions/stack are a bit of an abstraction depending on which architecture you're using. Calling C high level isn't accurate or descriptive, but I'd be willing to concede that it's not truly low-level either if you know enough C to explain why. You don't, though.
- lucisferre 14y ago"You don't, though" Interesting, though I'm not sure how my knowledge of C is relevant to the conversation.
- heretohelp 14y agoYou made a false assertion about C. o o o Connect the dots.
- lucisferre 14y ago"C is not high level because you don't know C" is not exactly the most cogent of arguments. The rest of it I pretty much agree with, nonetheless the actual definition of "high level" language doesn't change just because you (or I) feel it should, which is why I said it was "technically" high level.
- RonPaul2012 14y agoNot if you live in the 2012
- qznc 14y agoOriginally, the term "high-level" meant that programs were portable between machine architectures. You can do this in C, but in assembly. This is a precise definition. I cannot find a precise definition, which puts C and Javascript on different levels. Has garbage collection? A big standard library?
- prodigal_erik 14y agoI think there's a spectrum around how many different ways the machine could choose to execute what you wrote. E.g., V8 creates hidden classes rather than naïvely following the prototype chain, where C pretty much dictates how things are actually laid out in memory.
- javert 14y agoThat's pretty true. However, in C, you can actually write interesting data structures and algorithms that come up in computer science. I think that makes for good "theory meets practice"-based learning. I'm not saying all algorithms classes should incorporate writing C code all the time. But probably every budding computer scientist or software engineer should take at least one such class. I'm also not saying C is the only language for which this is true. But it's definitely not generally true for interpreted languages. Also, C is pretty much the language everything higher-level is implemented in. So once again, at least some exposure to C can help someone conceptualize what's happening on the computer at every level.
- mistercow 14y agoHmm, can you give an example of a typical "learning CS" level algorithm that you can't implement in, say, JavaScript?
- z92 14y agoB-Tree indexes in JavaScript
- mistercow 14y agoGoogling around, I see a number of implementations. What's wrong with them, and why do you feel this is impossible? (And hint: it's guaranteed not to be impossible since JS is Turing complete)
- killahpriest 14y agoNot an algorithm, but used in many. Pointers.
- mistercow 14y agoEmulating pointers in JS is pretty easy; you just wrap the values in objects or arrays.
- 14y ago