5 ms·
> C language is as simple as it gets Two types of files, compiler directives, pointers, malloc and friends, are you really sure about that? Any non-trivial C
by fenwick67 9y ago
> C language is as simple as it gets
Two types of files, compiler directives, pointers, malloc and friends, are you really sure about that? Any non-trivial C program will use these, on TOP of the basic syntax that first timers have to learn.
There is a reason it is usually not taught as a first language, and Java, Python, C# or even Assembly are.
- grayhatter 9y agoYes, if you look at it from a C coders point of view. You know exactly what your program is doing (excluding compiler optimizations). Java is taught a lot, not because it's better. But because once you learn Java, all you know how to do, is teach Java. Python is taught early because it's fun/easy, not because it's the best. No one teaches ASM first anymore, what did you mean by saying asm is one of the first taught languages. (Maybe in some embedded systems, but generally that's not first, not by any reasonable definition.)
- ufo 9y ago> You know exactly what your program is doing I think thd more accurate sentence would be "know exactly what the computer is doing". Lots of languages have clear and simple semantics that let you understand what your program will do. This is not the case for C though. The only way to understand what a C program does is to have a very complete mental model of the low level computer architecture, memory layouts, call stack organization and so on (aka knowing what the computer does). That is actually lot to go through for a first introductory course (hence why they are making a restricted language to teach before jumping to full C)
- verall 9y agoThe Computer Engineering program at UT Austin teaches assembly (and architecture basics) for an academic RISC machine, then ARM assembly, and then C, in that order. So it's not no one, even if it's not as common anymore. It definitely makes C make more sense as an abstraction of asm. I believe the CS school starts on Java.
- grayhatter 9y agoIs this the program where you literally build a computer from scratch, starting with a transistor, and working your way up. If so, you're comparing a top down approach, to a bottom up. Each with a different end goal. My comments are only meant to apply to a intro to CS top down approach, with the goal of creating programmers, not complete system engineers.
- khedoros1 9y agoJava was taught at my school because you don't need to learn much boilerplate to get started, the OOP parts of the language are relatively clean, memory management isn't manual,...and because they got a nice deal with Sun. Python has similar arguments. It's a clean but powerful language that gets out of the way of learning basic programming, data structures, and such. > But because once you learn Java, all you know how to do, is teach Java. Why is that true for Java or Python, but not for other languages?
- grayhatter 9y agoThat was meant a joke about Java being a worthless language. It's true about a lot of languages. But C isn't one of them. You can do a lot with C, you can do almost as much with with python and a lot faster as well. I can enumerate more, but those are the only two relevant ones. With Java, you can get a job where job performance is measured in LOC.
- jackmott 9y agomalloc isn't part of the language and not necessary for typical intro course projects usually.
- khedoros1 9y agomalloc is defined within the C1X standard document as part of the C standard library. If you mean that malloc isn't a language keyword, OK, sure. And there are cases where you'd write a non-trivial C program without any dynamic memory allocation. It seems misleading to say that it's not part of the language, though.