← Back to context

Comment by preg_match

1 day ago

C++ is an IDE type language in my opinion. C is not, because C doesn’t have an expressive enough type system anyway to justify it.

Yes, just use and IDE. This is a problem in Rust as well. And C#, Java, and others.

IMO you should use auto as much as possible. If the code can be written with auto, it should be. There’s no reason to repeat type definitions.

If you can use auto, what that means is the type is already statically known. C++ is a statically typed language; the compiler and tools know what type things are. So, just ask the tools, because they’re not wrong.

> Yes, just use and IDE

The best the IDE can do is display a tooltip or something like that which is cumbersome when reading the code because you need to move over everything to figure out what the types are. And sometimes for whatever reason even that fails.

And this is only useful in the context of using an IDE: code can be found outside IDEs too, even if all you do is use an IDE for your development (not everyone does), the code can still be found in patch files, pull requests and code review platforms none of which have any IDE functionality to know what the types are.

> There’s no reason to repeat type definitions. If you can use auto, what that means is the type is already statically known

I'm not a compiler though.