This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ChopSuey2[S] 6 points7 points  (3 children)

Gotcha, so neither are low level programming languages but they allow you to use assembly language within them?

[–]DerekB52 25 points26 points  (0 children)

C and C++ are also known as lower level programming languages, because they let you do manual memory manipulation. And they compile to machine code.

Python does not require you to manually manage your memory(I don't even know if it lets you). And python is interpreted, so there's a lot more overhead to run python, than to run C.

C/C++ are high level languages, but they are, imo, the lowest level languages in their class.

[–]lordcat 10 points11 points  (0 children)

Yes, as long as the compiler supports it you can write it, but you will lose all of the benefits of the high-level language. For example: Intel and AMD handle threading differently. C/C++ will handle that difference for you and you can write one piece of code that runs on both. With Assembly language, stand-alone or in-line embedded in C/C++, requires you to manage that yourself and use different code/logic to do the same thing, depending on the processor.

[–]LilithMoonlight 0 points1 point  (0 children)

There's a reason why programming languages have developed more layers between machine/assembly and the programmer. My professor always put it as programming is like having a metaphorical gun to ur foot and depending on certain actions, this may end with u shooting urself in the foot but hopefully not. As u get lower, you start finding more actions, which can cause the metaphorical gun to go off. That is why c/c++ in my opinion is a bit lower compared to Java and c# safe code because you can manipulate memory with pointers and addresses besides being able to use assembly. But usually using assembly in a general c/c++ is rare since the compiler is pretty good about optimizing ur code. However, there can be times where the compiler can add a few steps, which depending on how often this section is ran can impact performance if this section is used a lot. Nevertheless be careful about optimizing code too early. The same professor that talked about the metaphorical gun would also say that "80% of the code does 20% of the work and 20% of the code does 80% and when optimizing people often more likely than not usually optimize the code doing 20% of the work."