I keep hearing that C is no longer a High Level Programming Language because it is no abstractions, has pointers, have to handle memory on our own, no string data type, unsafe etc.
Do you think that C is not a high level language anymore? I am against this because it's still readable as any other high level and usable as ever and has many libraries and still been updated.
Oldest comments (77)
Being high level or low level has nothing to do with it's readability. Higher level languages usually have GC and memory management, whereas low level languages do not.
Well, when you have a CPU, the lowest programming language that most of us, mere mortals, can write for the CPU is assembler.
What C compiler does is none other than translating C syntax to assembler. It is still so low that In fact you can insert assembler snippets in C source code. There’s quite a lot of assembler code snippets in Linux kernel C source code.
So yeah, I think it’s pretty low level language because with C you can do almost everything that assembler can do and assembler is the lowest language you can write in.
Yeah, that takes me back. That's real programming. Not like the namby-pamby memory managed languages I use these days.
If this is sarcasm, it's a little too good 😂
That it's such a boomer thing to say. Both low and high level programming languages serve their purpose. It's true memory managed languages can be quite slow in execution time and can be resource hungry. On the other hand, you can use C# for example for almost everything and it's suitable for advanced design patterns that are just impossible to implement on C. Unless of course you write your own abstraction level, in which case congrats you just re created C++. Furthermore, C# can be optimized to run almost as fast as C and all executables can be stripped down to run even faster. For Gods sake even python can be optimized to run relatively fast. It all depends on the requirements and the context of the application.
And you can always write C modules that you then import into Python.
Yeah, where have all the real programmers gone?
Thanks very much for that link. A copy of same was posted up in the common-room when I was at Uni, and was in my thoughts when I posted my comment, which was, of course, tongue-very-firmly-in-cheek.
I agree with you for the most part, but that last paragraph is baseless.
I can insert assembler to Common Lisp and Rust. Both of those out match Python, Javascript, or C++ in abstraction power, so by definition, they are high languages. That doesn't mean that they can't reach down to lower levels of abstraction when they need to do so.
This is really not true at all.
A modern C compiler does quite a lot of interesting work to try to make C code competitive.
Things are reordered and elided and optimized in ways that are often surprising.
Consider what this does in C.
If you think it requires the program to loop forever, you are mistaken. :)
Beyond that, there is a great deal that C cannot do which assembly can.
C has no concept of registers (the register storage class just makes a variable unaddressable).
C has no concept of op codes.
C has no concept of the CPUs memory model -- C has a segmented memory model.
C programs run in the C Abstract Machine, and understanding this is essential to writing C programs that do not work only by accident.
Consider the following snippet -- what do you expect it to do in C?
It's as much a high level language as it ever was.
As a generic syntax and semantic that can express any behavior desired succinctly to be translated into any assembly, be it x86, ARM or you name it, yes. I would consider "high-level language" to be analogous to "can be made to compile into any instruction set".
Technically going by the definition, C could be considered high level. I don't really see how it makes a difference, at the end of the day C nowadays is only employed in niche use cases like embedded systems, kernels, drivers, etc. The reason why it is avoided is because it doesn't have many abstractions, i.e. it is considered too low level for general programming.
Depends on who you ask. Some people who only know languages like ruby or javascript could look at some C code and maybe think "I can do all of that in one line of [prefered language]". Maybe that's the reason why they think C is no longer high level.
Depends on from which direction you are looking.
If you are looking from above (Javascript, Java, Python, etc.), it's low level.
If you are looking from below (machine code, assembly, etc.), it's high level.
itDepends
So it's mid level or old high level.
Levels don't have ages.
Unless they are normalised.
Ben,
I agree with your point of view - machine code and assembly are definitely lower level than C while Java, Javascript, Perl, and Python are higher level. I will say Pascal is at the same level as C.
-- Olu Adegoke
I agree, Pascal (and probably Fortran) are on the same level as C.
It's relative to what you're comparing to. I'd say it's lower level than some other languages, which is not a bad thing.
Arguably, one can consider most high level languages like Ruby, Python, Java, etc to be not that high level either because you still need to actually write instructions instead of just something more declarative and leaving the implementation up to the language.
You might be interested in 3GL and 4GL definitions. However it's somewhat outdated.
From 1 to 10, if we say assembly is number 1 and languages like Javascript and Python are number 10, then you can say C is about 7 (or maybe 6).
Let's not forget the visual languages and DSL that are 10. I think Python and other so said high level languages are just unfortunate missteps of technology when quality and amount didn't not meet.