Confusion on level 2 certificate in understanding programming specifically "high and low level languages"
Posted by ChoiceAd5790@reddit | learnprogramming | View on Reddit | 14 comments
Hi, i am trying to learn to code and am currently taking a course for "level 2 certificate in understanding coding". I have no previous experience in coding and am currently stuck and becoming more and more confused on the third question.
In my introduction email it states "Please avoid copying directly from course materials and using Artificial Intelligence (AI)."
In the workbook provided they go through several languages "C, C++, C#, Java, JavaScript, Python, Ruby, R, Swift, PHP, SQL" and explain in basic what they are how they can be used.
However my confusion comes from question 3.
"Identify different coding languages available, giving two examples. Include whether it is high-level or low-level and what it is commonly used for. (A.C. 1.3) C, C++, C#, Java, JavaScript, Python, Ruby, R, Swift, PHP, SQL"
After reading the workbook I had planned on using Python and R as my examples after reading through the workbook as in the explanation given it states in it that Python is high level "This is one of the easiest high-level coding languages to learn and is very popular with those who are new to coding" and that R is a low level language "This is a highly specialised coding language that is primarily used in academic fields and by large tech companies. It is a low-level language aimed at statistical computing and graphical techniques."
However upon doing my own research i have come to the understanding that a low level language is machine or assembly code which the course doesn't really cover and merely skims over in mentioning them as being low level.
after a bit of googling i am under the understanding that all the the languages mentioned above would be considered high level to some degree and a low level language would be closer to binary. Also if it put the question directly into AI it states the workbook is incorrect.
"While your workbook is correct about R's specialised use in academia and big tech for statistical computing, its classification as a "low-level" language is technically incorrect. In computer science, R is considered a high-level language." which adds to my confusion. I have also found that the internet seems to list some of them as a mid level language which the workbook does not mention at all! also i keep seeing that C would considered low level
At this stage in so confused and feel im unable to answer the question correctly without directly using the workbook as gospel, if anyone is able to ELI5 and help me clear this up or assist me with an answer that would better fit i would greatly appreciate any advice given.
Sorry for the long post thank you for reading this far.
ImprovementLoose9423@reddit
R is high level since it is not close the machine code. C is definitely low level as it works with machine code plus the fact that C is considered the granddaddy of languages
ChoiceAd5790@reddit (OP)
Frustrating and confusing that the workbook provided lists them the other way around. Thank you for the reply
FloydATC@reddit
C is very close to what's really going on inside the CPU in that it forces you to think about things like exact byte counts and pointers to real memory addresses. This is what we commonly refer to as "low level" because it sits just above assembly language, which is really just machine code made "readable" for people on the spectrum.
Compare and constrast this with Python and R, where the focus is on abstractions and we don't really think about exactly how the CPU performs each task or exactly how many bytes are used to represent a number. This lets the programmer focus on other things.
Note that it is possible to import libraries of abstractions into low level languages like C and get things done almost without touching the "low level" stuff. I mean, technically, the reference implementation of the Python interpreter itself is written in C.
Conversely, it's technically possible to do certain lower level things in Python, but this isn't what the language does best and the resulting program might even end up more complicated than the same thing just written in a lower level language to begin with.
What this exercise is really all about is understanding why each type of language exists, roughly categorizing them, then picking two of them and showing how they suit different purposes. In this context, Python and R are fairly similar level so I would probably go with either one of them and then compare with a low level one for contrast.
ChoiceAd5790@reddit (OP)
My main issue or worry is the workbook states C being high level and R being low level but my tutor and the entire internet stating C is low to mid level.
So from what I'm understanding after all this, is going by what's stated in the workbook I would infact get the answer incorrect by being correct if that makes sense, if the assesment is based off the workbook provided?
lfdfq@reddit
In the end, high vs low is not well-defined.
However, it's well accepted that what makes a language high-level is the level of abstraction of the underlying hardware. R is very abstract, so it's definitely a high-level language.
I think whoever wrote that workbook was confused. It is specialised in some sense, so it's not a general-purpose language in the same way Python is (although R is still pretty general).
ChoiceAd5790@reddit (OP)
Thank you reply,
would u consider any of these languages to be "low level"
C, C++, C#, Java, JavaScript, Python, Ruby, R, Swift, PHP, SQL
My tutor has said that "C is sometimes referred to as a middle level language and also sometimes low level." i have also read C referred to as low level on the internet, however i don't believe this has helped my get any closer to an answer to the question.
The workbook describes C as "This is one of the most established and widely-used programming languages in use today. It was first released back in 1972 and is a complex, high-level language that has influenced the development of many other languages, such C++, Java and Python." which also leads me to more confusion.
lfdfq@reddit
If we group them up I would say C is more low-level than C++ which is more low-level than {C#, Java, Python, JavaScript, Swift, etc} which are more low-level than {SQL, PHP, etc}, purely based on the latter building more abstractions than the former ones.
The history of a language, how it influences other languages, how many people use them, how complex it is etc are all completely unrelated to what abstractions the language provides, and ths if is it high-level or not.
It's clear that C has some abstractions above the hardware (e.g. it has the concept of variables and functions and memory allocation, things the hardware does not), so it's not the lowest possible level you could imagine (compared to e.g. the assembly language for that machine), but it's also far away from being a high-level language like Python or Java or whatever. You cannot put a number on how abstract a language is, and therefore how high-level it is, so two reasonable people could argue about how high-level C really is; it's not a binary choice nor is there a right answer.
ChoiceAd5790@reddit (OP)
Thank you I appreciate your time and response
Key_Use_8361@reddit
a lot of beginner certifications make more sense once you combine them with actual practice instead of treating them as proof that you fully understand programming already
ChoiceAd5790@reddit (OP)
At the moment I understand nothing except and apparently including what is written in the workbook provided with the assesment. I'm just treating the workbook as if it was written by someone that understood the assignment and gave me enough info to answer the questions at least but even my tutor is contradicting what is says. The question asks for two examples, I chose two according to the workbook 1 low and 1 high level but the more I dig the less it is correct. From what I understand the best low level example would be C from the options given
bird_feeder_bird@reddit
Low level languages deal directly with machine instructions. So machine code (binary) and assembly (shorthand machine code). For every unique computer architecture, there is a unique assembly language. Forth is low level as well, since each word in forth corresponds directly to assembly instructions. To write in a low level language, you have to treat the computer like a calculator, like “load from this memory address into this register, perform these calculations, and store it in this memory address.”
Most languages are high level. You don’t write the exact machine instructions, but the logical flow of the actions you want to perform. Then you run your code through a compiler or an interpreter to turn it into instructions the computer can run. So every unique architecture needs its own compiler/interpreter, but the code you write can generally stay the same. C is a high level language, but sometimes people call it low level because it maps pretty closely to assembly language compared to all the other high level languages.
So low level = writing exactly what the computer is doing. High level = writing the logic of what you want to do, while abstracting what’s going on under the hood. More abstraction = higher level.
Sad_School828@reddit
I consider C low-level because it operates on raw numeric output from API calls, and ASM can be inlined in C via any legit compiler.
I consider C++ high-level because it generates Exceptions.
Everything else is for script-kiddies, not programmers.
high_throughput@reddit
So
-fno-exceptionslets you toggle between high and low?Sad_School828@reddit
No, not at all. I left off the rather obvious statement, "anything which requires you to know which calling convention your function needs to use per-OS is low-level," for the same reason.
The difference between "low-level" and "high-level" is strictly defined by how much you don't even need to learn in order to produce a functional program.