282 karma · joined Sep 25, 2026 (2mo ago) · 249 submissions
comment 2w ago · link · parent
When the language got operator overloading there was the question of how to convert the arguments from the operator itself to its implementation. You wanted to write a+b, not &a+&b but most versions of operator+ were going to want const pointers for efficiency. One option was to make the & implicit, another was to introduce a type of argument that didn't need & but acted like a pointer. So references were born.
I ignore people who advise to use references when something can't be null. A null reference is UB just like a null pointer, it just shifts where the UB is, but the compiler is likely to produce the same code either way and the program is just as likely to crash. Instead, I use pointers to make it obvious that something is a pointer, and references when it should be invisible, just like with operator overloading.
comment 2w ago · link · parent
Do you know C? Everything that works in C works in C++, modulo a few minor syntactic changes (void* doesn't implicitly convert). You can get acquainted to C++ features on an as-needed basis. Other people will surely disagree with me on this.
With pointer types in particular, I'd say use C-style pointers long enough to know how frustrating they are but also how they work. Then you'll know what unique_ptr and shared_ptr are doing to help you. (And those are the only two you need 99% if the time. weak_ptr is a spin-off of shared_ptr that you'll know if you need it. observer_ptr is just stupid ivory-tower stuff.)
comment 2w ago · link · parent
How about "the purpose of a system is not something it doesn't do" or "the purpose of a system is some of the things it does" but that's not as catchy.
comment 2w ago · link · parent
I actually don't think anyone involved gives a shit about the carbon dioxide. Even oil barons don't - they care about selling oil, and if an emissionless way to burn oil were discovered, they wouldn't mind. "... using oil" may be part of the purpose.
comment 2w ago · link · parent
Let's focus on one of the examples he gives:
> [POSIWID implies that] The purpose of the New York bus system is to emit four billion pounds of carbon dioxide [and this is obviously absurd]
But that's not what the bus system does, is it? That's only one thing it does and it's the least purposeful thing it does, as if you chose that one on purpose.
I'd sooner think the purpose of the NYC bus system is to move money from government coffers to oil barons, or to placate left-wing protestors, or to satisfy a sustainability checklist item, or to increase the employment rate in NYC than to think the CO2 is the point.
comment 2w ago · link · parent
The basics in this case are not some natural law. There are, in fact, a large number of powerful people who force the rest of us to execute fiat-currency capitalism.
comment 2w ago · link · parent
Go is about as far as you can "go" to the efficiency end without becoming Rust. It's a low-overhead language (like C) but with a GC that ensures memory safety. If you want to manage memory yourself and still prove safety it gets very complicated, as we see in Rust.
comment 2w ago · link · parent
At least the command is still called sudo or run0. Changing it to doas would have been a much more breaking change.
Alas, TFA blocks me with no workaround because I'm using Tor Browser so I can't read about the nature of the changes.
comment 3w ago · link · parent