Sign in to follow this  

C++ - high-level & low-level

This topic is 3488 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've read on the net many times that C++ is a high-level language; almost as many as I've read that C++ is a low-level language. And people complain about being high-level OR low-level; and people praise it for being high-level OR low-level. 1) What's the truth: is it high-level or low-level? 2) Why is high-level good? Why is high-level bad? 3) Why is low-level good? Why is low-level bad? (Sorry about the abstract form of the text; just wanted to emphasize the absurdity of the situation). Thanks.

Share this post


Link to post
Share on other sites
Quote:
Original post by asdqwe
1) What's the truth: is it high-level or low-level?

It depends on your perspective. "High" and "low" are relative terms. C++ is higher level than assembly, but lower level than Java, for example.
Quote:
2) Why is high-level good? Why is high-level bad?

The higher level a language is, the further removed from the hardware it is. The advantages of this are several; cross-platform compatibility, no need to have knowledge about how the hardware actually works and so on. High-level languages are typically constructed in a way that makes them easy or practical to program in.

The tradeoff is, of course, speed and memory. High-level languages tend to be slow compared to low-level languages. This is not a property of the languages themselves, but rather on the way they are implemented; the really high-level languages are typically interpreted (or byte-code compiled) which is necessarily slower than native compilation.

There is one caveat to the speed aspect. There is a limit to what a human can do with low-level languages, because programs in those languages tend to become complex and unmaintainable quickly. For this reason, C++ often outperforms assembly for non-trivial tasks, simply because it's not possible in practice to do all the optimizations manually that the C++ compiler will do automatically.

Quote:
3) Why is low-level good? Why is low-level bad?

Low-level languages are good when you need speed or have limited memory. As opposed to high-level languages, the tradeoff is development time due to unintuitive or primitive language structure.

Share this post


Link to post
Share on other sites
Thanks for the clarification.

I think in the end its about picking the right langauge for the right job.

^__^ i guess even i learned something from the preveus post.

Regards Jouei.

Share this post


Link to post
Share on other sites
Quote:
Original post by Jouei
An example would be this C++ is built apon pearl like almost any computer langauge.

This is wrong. C++ is not built on Perl. Perl was influenced by C++, not the other way around.
Quote:
Java is built with C++ and a class based interface thus makeing it a higher level langauge.

the more langauges involded in creating the lagnauge you are currently useing the less you directly interact with the system in a way and vice versa.

This is also wrong. While it is likely that most Java implementations are written in C or C++, it is not necessarily so; they may as well be written in assembly. Conversely, there is nothing to prevent you from writing a perfectly good C++ compiler in Java.

In other words, high or low level has nothing to do with what language(s) was used to implement the compiler (or interpreter, or virtual machine, or whatever). It has more to do with the level of abstraction provided by the language (garbage collection versus manual memory handling, for example) and whether the language is compiled, interpreted, running in a VM etc.
Quote:
regards less of witch i don't think it matters if it is a high level or low level so long as it does the job required effincently.

When one picks a langauge for a project one should be picking one that is suited to the project and that can get the work done properly and accurtly as well as effiently and lets not forget with ease.

i hope that gives you some what of an understanding i may be incorrect on one or two details. but the underlieing fact is pick the langauge best suited for the job and don't worrie about what pepole say.

Regards Jouei.

This is true. When starting a project, pick a language suited to the task. C++ has its place, as does Python and Java and Assembler. Learn as many languages as possible so that you can make as informed decisions as possible when you need to choose between them.

ETA: Ninja'd:
Quote:
Original post by Jouei
Thanks for the clarification.

No problem.

Share this post


Link to post
Share on other sites

This topic is 3488 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this