TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

C++26: A Placeholder with No Name

96 pointsby jandeboevrie4 months ago

8 comments

carom4 months ago
I am so shocked at how many people use `auto` in C++. I can not think of a worse thing to do to your code in terms of readability and future maintainability. Maybe it is OK if you use an IDE to identify types for you but I still hate it. I am trying to learn a new library right now with light documentation which means reading the code, and between typedefs, auto, and technical debt, it is a tedious exercise to figure out something's type, to go look up its function, to see what type that is returning.
评论 #42666306 未加载
评论 #42667020 未加载
评论 #42665623 未加载
评论 #42666924 未加载
评论 #42665683 未加载
评论 #42667441 未加载
评论 #42666479 未加载
评论 #42666558 未加载
评论 #42666220 未加载
评论 #42666509 未加载
评论 #42666166 未加载
评论 #42666796 未加载
评论 #42667986 未加载
评论 #42666807 未加载
评论 #42667000 未加载
评论 #42667336 未加载
评论 #42668341 未加载
评论 #42666756 未加载
评论 #42669092 未加载
评论 #42666537 未加载
评论 #42668108 未加载
评论 #42666138 未加载
评论 #42668865 未加载
评论 #42668013 未加载
评论 #42667645 未加载
评论 #42669372 未加载
评论 #42667443 未加载
评论 #42669834 未加载
评论 #42665728 未加载
SideburnsOfDoom4 months ago
See c#:<p>&quot;A discard communicates intent to the compiler and others that read your code: You intended to ignore it.<p>You indicate that a variable is a discard by assigning it the underscore (_) as its name.&quot;<p><a href="https:&#x2F;&#x2F;learn.microsoft.com&#x2F;en-us&#x2F;dotnet&#x2F;csharp&#x2F;fundamentals&#x2F;functional&#x2F;discards" rel="nofollow">https:&#x2F;&#x2F;learn.microsoft.com&#x2F;en-us&#x2F;dotnet&#x2F;csharp&#x2F;fundamentals...</a><p>2020: <a href="http:&#x2F;&#x2F;dontcodetired.com&#x2F;blog&#x2F;post&#x2F;Variables-We-Dont-Need-No-Stinking-Variables-C-Discards" rel="nofollow">http:&#x2F;&#x2F;dontcodetired.com&#x2F;blog&#x2F;post&#x2F;Variables-We-Dont-Need-No...</a>
评论 #42668127 未加载
agumonkey4 months ago
Makes me wonder when &#x27;_&#x27; was first used as a token to denote unused information. Prolog ? ML ?
评论 #42665237 未加载
评论 #42665164 未加载
评论 #42665310 未加载
kookamamie4 months ago
What a convoluted mess.
评论 #42667362 未加载
评论 #42667808 未加载
评论 #42665446 未加载
wild_pointer4 months ago
&quot;In addition, there are some variables such as locks and scope_guards that are only used for their side effects&quot;<p>...<p>&quot;This solution is also similar to other languages’ features or conventions&quot;<p>As far as I know, in Rust you can&#x27;t use &quot;_&quot; for that, as the value will be dropped right away, so the mutex&#x2F;resource&#x2F;etc. won&#x27;t live for the scope.
评论 #42665369 未加载
emcell4 months ago
every time i see stuff like this, I hope I never have to work on c++ projects again.
ulbu4 months ago
<a href="https:&#x2F;&#x2F;www.london-fire.gov.uk&#x2F;media&#x2F;2045&#x2F;london-frie-brigade-carers-hoarding_template_landing-page-panels.jpg" rel="nofollow">https:&#x2F;&#x2F;www.london-fire.gov.uk&#x2F;media&#x2F;2045&#x2F;london-frie-brigad...</a> C++
wiseowise4 months ago
Not every &quot;problem&quot; needs a solution.<p>At this point only LLMs will be able to decipher every intricacy of C++.
评论 #42667829 未加载
评论 #42665687 未加载
评论 #42668140 未加载