News for hackers. Stuff that matters.
Re:C++26: A Placeholder with No Name by jcelerier on Saturday January 11, 2025 @10:01AM (#42666306)
I have never seen anyone come back to typing types everywhere after using auto for more than a couple months.

Use types when they are needed and use the tools at your disposal (IDEs BT every text editor has clang language server integration nowadays)

> with light documentation which means reading the code,

You have to read the code anyways, documentation is impossible to trust. There isn't one big library for which I didn't have to go read the code at some point. Two weeks ago I had to go read the internals of msvcrt, Microsoft's C runtime, to understand undocumented features of process setup on windows. I had to go read standard library code thousands of times, and let's not talk about UI libraries.

Re:C++26: A Placeholder with No Name by coffeeaddict1 on Saturday January 11, 2025 @03:33PM (#42668711)
> Use types when they are needed and use the tools at your disposal (IDEs BT every text editor has clang language server integration nowadays)

While I agree that auto is helpful, the amount of times I had to wait for clangd (or whatever the IDE is using) to parse a .cpp file and deduce the underlying type is frustrating. It happens too often with every IDE (Qt Creator, CLion, VS Studio, VS Code, etc...) I've tried whenever I'm programming with a non-desktop machine that's not super beefy.

Plus I often use Github to search for code when I'm trying out a new lib so having the type spelled out is extremely helpful.

Re:C++26: A Placeholder with No Name by menaerus on Sunday January 12, 2025 @07:26AM (#42673083)
Plus assuming that your codebase is clangd parseable. Many aren't out of the box.

Plus assuming that you're not reading/modifying code on a (remote) machine where you don't have access to IDEs but simple editors only.

Otherwise, I also find auto helpful but I use it sparingly, mostly where type is obvious, e.g. can be easily deducted from the local scope.

Re:C++26: A Placeholder with No Name by cma on Sunday January 12, 2025 @09:08AM (#42673647)
One approach is use auto while coding, auto convert to full types when finalizing/commiting except where they hurt readability.