What about code reviewers? Show me a code review system that lets you hover over the value to see the type… none of the ones I’ve used can do it.
For that matter anyone reading the code from a web browser in any other context.
Fwiw, I agree. I also pull down the branch under review in parallel to the web code review. You’d (probably) not be surprised by the number of times I’ve done this and the code doesn’t even build.
Re:C++26: A Placeholder with No Name
by ranger_danger on Saturday January 11, 2025 @01:07PM
(#42667711)
I wonder if most of the reason people use auto is just to save time when typing... if the IDE could auto-resolve the type in the source code when they use auto... would that be a better compromise?
Even without auto you have the problem.
return foo().bar();
No `auto` and you still don't know the return type of foo.
And knowing the type might not be the only reason you'd want an IDE anyway. What is `foo()` doing? I want to be able to easily jump to the definition of that function to verify that the assumption taken by the calling function are correct.This was probably rhetorical but metas code review tool runs LSP and gives you clickable types where clicking takes you to the definition.
Re:C++26: A Placeholder with No Name
by AlotOfReading on Saturday January 11, 2025 @11:05AM
(#42666763)
Editor type deduction is surprisingly unreliable sometimes.
You have to weigh up the cost of going through the code and changing all the type declarations
If you change the return type of foo here you don't have to change 300 call sites. Personally i'd rather change it in one place than 300.