Re:Learn Modern C++
by 3836293648 on Tuesday December 26, 2023 @03:20PM
(#38775648)
I 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)
I'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.
When 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.
Re:Learn Modern C++
by angiosperm on Tuesday December 26, 2023 @02:55PM
(#38775403)
Multiline macros and complex templates are rare in modern C++. What you describe is workarounds for features the language used to lack.
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).