I am a beginner at programming; so far all the compilers I have used can check for errors, and can refer to the line with the error. Are there any compilers, maybe for a certain language, that do not do this? at least at the professional level? The error-checking is great.
3
The answer is yes and no.
Yes, compilers will report locations with errors
A compiler stores a piece of data that represents the program you wrote. Remember, a compiler isn’t magical it’s just another program working just like the one you wrote! This piece of data will “tag” the relevant areas of code with locations. During compilation if the compiler encounters an error it’s very easy to spit out the tagged location and so pretty much all of them do.
If your program does really crazy things, like generate code or let the compiler infer and generate parts of your program then sometimes the line numbers are utterly useless, but they’re still there!
In fact, compilers usually give a lot more than just the line number. They try to tell you what exactly went wrong and why it happened. How successful they are varies a lot. A compiler that I worked with for example would occasionally just barf
Error:some line: internal failure
It’s error handling algorithms were a bit dodgy to say the least. Most are very good though.
No, Not every language gets as much error checking
This is actually somewhat of a religious war in the programming world. How much checking should your compiler do? A compiler can’t magically detect all errors, so really it just forces you to follow a bunch of rules it decides upon. The goal is that these rule limit you to writing “good” programs. The problem is those rules will always cut out a bunch of perfectly reasonable programs!
Some software developers want their compilers to back off and just let them deal with making their programs correct. This means it’s easier to write a legal program, but you have to work a lot harder to ensure it’s correct.
Some software developers want their compilers to check as much as possible. They have to work a lot harder to write the original program so that it follows all the rules of the compiler. Once it compiles though, they don’t have to test as much (if at all) because the compiler checked a lot of things before hand.
Deciding where on this spectrum you end up takes time. A lot of time. It also takes you experimenting with different languages to figure out what you want from a compiler. A lot of people even change their minds as time goes on. However, you can find professionals pretty much all along the spectrum.
TLDR
Yes, all compilers will give you information about your error. What errors compilers catch though varies a great deal.
3