3 ms·
You just read the first error message, and find where it says "at line #N" to see where the problem is. You can ignore everything after, however many pages you
by angiosperm 3y ago
You just read the first error message, and find where it says "at line #N" to see where the problem is. You can ignore everything after, however many pages you get, which is usually just a list of the functions you might have been trying to call, and can be long if there were lots of possibilities.
Linux Torvalds has not looked at C++ since the '90s. C++ is a wholly different language now. The experience coding in it now much more fun, and it is easy now to write code that works the first time it is run (as is also seen with Rust).
- ljm 3y agoI'd say this is the typical case for most languages, especially if they try to compile the entire codebase and only report errors at the end. Take TypeScript, for example: if you bugger up a type definition or function call in one file, you'll have to wade through the errors of everything depending on it. Oftentimes you can go from 30 errors to just 2 or 3 with one simple change. The alternative is they fail at the first error but you don't get the root cause and end up fixing shit one by one if the problem isn't obvious. Especially with a new project in an unfamiliar language - start small and compile small, incremental changes. You won't end up with something you can't fix, which can't be said for installing dozens of dependencies up front and hoping for the best.
- f1shy 3y agoWhen working with code with multiline macros, or complex templates, it is impossible to understand some errors. OP is gold right in that. C++ is so complicated, it is just impossible to make an efficient compiler that gives goos error messages. Also having to ignore the pages after one error, to me, is a shittines indicator.
- angiosperm 3y agoMultiline macros and complex templates are rare in modern C++. What you describe is workarounds for features the language used to lack.
- f1shy 3y agoI describe working with real life code, where there are many old libs and code, often in plain C, with which you have to interface with.
- 3836293648 3y agoI wish. I had an issue where I accidentally passed a double literal instead of a float literal and the error was longer than my terminal history (so more than 10k lines) and even when I actually got the full message by piping it into less it didn't point at the correct line. (Clang did though so clangd could spot it)