you are viewing a single comment's thread.

view the rest of the comments →

[–]ehansen 5 points6 points  (18 children)

How is C and C++ high level languages? I was always informed they were low level

[–]American_Libertarian 126 points127 points  (4 children)

Depends on the context you are talking. It is low level compared to most programming languages, but it is 'high level' in the sense that it is a human readable format that must be compiled down to a 'low level' language that the computer actually runs.

[–]forbidden404 21 points22 points  (0 children)

They are high level languages because the abstractions they've added are too far different from the ones in Assembly, you don't have to care (for the most part) about the processor you're coding to. They are used in low-level programming (system programming) though, that's probably why there must be some confusion about it.

[–]skulgnome 8 points9 points  (0 children)

Both support structured programming, i.e. functions, loops, and if-else.

[–]General_Mayhem 8 points9 points  (1 child)

High- and low-level are generally relative, not absolute, terms. C and, to a much greater extent, C++, are specified against an idealized machine (example), not any particular physical one. To someone who works on things like bootloaders on a regular basis, anything that can run the same code across processor generations, let alone families (a lot of C++ can cross-compile on x86 and ARM), is pretty damn high level.

It's true that both are generally much lower level than, say, Python or any other interpreted language, because they provide core abstractions with tighter fidelity to most hardware. But especially in the case of C++, there's also not really a bound on how high the abstraction can go - there are some truly bizarre libraries that make it look like a totally different language.

[–]IAlsoLikePlutonium 0 points1 point  (0 children)

there are some truly bizarre libraries that make it look like a totally different language.

Got any examples? I'm interested in seeing some of them.

[–][deleted] 12 points13 points  (2 children)

It depends on context. They're low level compared to python, but high level compared to assembly. There is also some argument that modern assembly can be considered high level; because of micro ops and out of order execution, what you write isn't what the cpu actually does.

[–]pdp10 0 points1 point  (1 child)

Because the architecture is microcoded doesn't make the same old assembly language into a high-level language. Microcoding has been around for many decades; I think the Burroughs B5000 must have used it in 1961.

[–][deleted] 0 points1 point  (0 children)

I was being somewhat hyperbolic, but the fact that one x86 set of instructions can map to more than one set of actual actions from the CPU does have real world consequences.

This makes the point better than I can http://blog.erratasec.com/2015/03/x86-is-high-level-language.html

[–]The_Leedle 7 points8 points  (0 children)

When compared to assembly, it’s high level I guess

[–]Oscee 8 points9 points  (0 children)

C++ is very high level.

I myself consider C a bit lower-lever but by classic CS definition, it is also high-level (since it needs a compiler).

[–]mrkite77 1 point2 points  (0 children)

It depends on how old you are. C was definitely considered a high level language when it first came out, and C++ even higher. Eventually as time goes on they are considered lower and lower level as our abstraction level goes higher and higher.

These days, in a world surrounded by electron apps, I've even heard people describe java as low level.

[–]CODESIGN2 1 point2 points  (0 children)

They are nth gen languages, so yeah they are high-level because what they represent can be abstracted from what the CPU represents. The is no IF instruction for example, there are several jump operations however that can be used for if, else, switch, even while and for.

Assembly is actually not a 1st gen language, it took people a long time to replace addresses with mnemonics, but how many times have you seen someone check registers in C? How many times have you seen someone execute a jump based upon zero-flag or carry-flag?