[-] 5C5C5C@programming.dev 16 points 8 months ago

It's incredibly disingenuous to call this average Rust code and further erodes your credibility. I may as well point to hundreds of lines of preprocessor macros in a C++ header and call it average C++ code.

This is not what an average Rust developer is writing 99% of the time. If someone on my team submitted a PR with an implementation of sum that uses macro_rules! I would almost certainly reject it.

[-] 5C5C5C@programming.dev 16 points 1 year ago

I think it's debatable whether RAII should be called "memory management". Whether dealing with Rust or modern C++, you don't need to "manage" the memory beyond specifying a container that will determine its lifecycle behavior, and then you just let it drop.

You could certainly choose to manage it more granularly than that in Rust or C++, but in the vast majority of cases that would be considered bad practice.

That's a qualitatively different user experience than C or pre-2011 boostless C++ where you actually need to explicitly delete all your heap allocations and manually keep track of which pointers are still valid. Lumping both under "memory management" makes the term so broad that it almost loses its significance.

[-] 5C5C5C@programming.dev 16 points 2 years ago* (last edited 2 years ago)

It's the trans people who pass so well as cis who will be in the most danger. By law they'll have to use the opposite bathroom of where they obviously belong, and then a group of big burly bigots will use that as an excuse to beat them up. The bigots defend themselves from criminal charges by insisting they were "defending women from a predator", and even if the trans person can prove they were just following the law and not harming anyone, the bigots will still get off scot-free because the court will rule they had a "reasonable suspicion" for their actions. Gay/trans panic is still effective in many places where these anti-trans laws are passed. And in many cases the trans person may be too scared to even press charges.

Ultimately the point of all of this is to force trans people out of society. You can't participate in a communal space where you're not able to safely relieve yourself.

[-] 5C5C5C@programming.dev 16 points 2 years ago

Rabid dogs are also themselves suffering so much that putting them down is a mercy.

[-] 5C5C5C@programming.dev 17 points 2 years ago

Yeah... I'm all for compassion and understanding, but if someone is missing the voice in their head that says "Hey, we shouldn't be killing people" then their circuitry is broken, no matter what age they are or what their circumstances are. And that broken circuitry poses a real and present danger to everyone in that person's orbit.

I don't support punitive incarceration, but the general public has the right to exist with a reasonable degree of certainty that they're not likely to encounter a cold blooded murderer on any given day, and part of ensuring that is to incarcerate people who are known to kill others, at least until such a time that we can have a high degree of confidence that they won't be doing that again.

The person being a child doesn't really change that part of the social contract. I promise you won't be any less upset if someone you love is murdered by a child than by an adult.

[-] 5C5C5C@programming.dev 15 points 2 years ago

Also since when is open exchange of ideas and concerns equated with control?

Am I trying to control you if I suggest that you not leave your tap running in California because fresh water is a precious resource in drought-plagued land?

Am I trying to control you if I suggest that you reduce your plastic consumption because we have a major microplastic crisis so severe that human babies are being born with plastic already in their body?

Am I trying to control you if I point out that the modern meat industry is ecologically unsustainable, so you're going to have to switch to being vegetarian sooner or later since the meat production will literally collapse itself, so you may as well start now before it's a global crisis?

If I suggest that you not hit yourself in the head with a hammer, is that me trying to control you, or is that just an act of very basic concern for your well being? And if hitting yourself in the head with a hammer becomes trendy, am I trying to control everyone if I suggest that we shouldn't be doing that because brain injuries will make us dumber as a society?

[-] 5C5C5C@programming.dev 16 points 2 years ago* (last edited 2 years ago)

And even if you do get to use pure modern C++ you'll still get burned by subtle cases of undefined behavior (e.g. you probably haven't memorized every iterator invalidation rule for every container type) that force you to spend weeks debugging an inexplicable crash that happened in production but can only be recreated in 1/10000 runs of your test suite, but vanishes entirely if you compile in debug mode and try to use gdb.

And don't even get me started on multi-threading and concurrency.

[-] 5C5C5C@programming.dev 15 points 2 years ago

A little disingenuous, yes, but the reality is that if we redirected the meat industry's subsidies towards a supply chain that centers around plant based diets, we'd have a more sustainable industry as well as a more affordable food supply for everyone.

Sustaining the status quo of meat consumption is a constant battle against the laws of physics.

[-] 5C5C5C@programming.dev 17 points 2 years ago

Surprise surprise, the congressman is literally a defense contractor. I wonder how many hundreds of thousands of innocent souls are hanging over his head.

[-] 5C5C5C@programming.dev 16 points 2 years ago

I've had the privilege of switching from C++ to Rust almost completely in my professional work. I can tell you in no uncertain terms, the language itself makes an enormous difference.

When I was doing highly concurrent multi-threaded programming in C++, I would sometimes have to waste entire weeks hunting down subtle data race bugs, despite the fact that I have a solid understanding of concurrency and multithreading. In some cases the bugs would originate in third party libraries that I was using, even though those libraries came from credible sources like Microsoft, Google, and GNU.

Switching to Rust, those bugs are gone. By the time my code compiles there's at 95% chance that it will work exactly the way it's intended to without any debugging. The remaining 5% is silly little logic accidents like saying if condition { ... } when I meant to say if !condition { ... } and those bugs are trivially caught by writing a few simple unit tests (and Rust also makes it easier to write unit tests than any other language I know of).

When I see my colleagues struggle with debugging problems in their JavaScript, Python, or C++ code, almost every time it turns out to be something that would've been trivially caught by the Rust compiler.

By no means does using Rust guarantee that your code will be completely bug free. But the language alone gets you so close to that goal that it hardly takes any special effort beyond compiling to get all the way there.

I think this is a huge reason that the ecosystem grows as quickly as it does: it's so easy to write code that you can feel confident enough about to publish for anyone to use that many people go ahead and do that, and others feel confident using the work of others because the compiler does so much to ensure quality. It creates a virtuous cycle where people can develop faster by taking advantage of other people's efforts and then release their own effort back into the community.

[-] 5C5C5C@programming.dev 16 points 2 years ago

You're making fantasy the enemy of reality.

The article states it very clearly: the technology does not actually exist. When people talk about how carbon capture will be necessary to reach net zero, they're talking about a speculative technology, not a real one.

But it's a very appealing speculation. So appealing that fossil fuel companies and heavy polluters are using simply the idea of it to make the public complacent and avoid conversations about how seriously we need to transform society to avoid total collapse.

And it would be a mistake to assume that some kind of engineering wizardry will make the technology suddenly feasible on a timeline that lets us avoid collapse if we just throw enough money at it (which we're not even doing at the moment). Fossil fuel companies prey on the public's "science optimism", the comforting belief that science can magically solve our problems.

But scientists and engineers still need to contend with the laws of physics and so far entropy has always had the upper hand on us. It would be delusional to think that's going to change any time soon.

The only realistic answer forward is to massively transform society or go extinct. If you believe that we can't get a handle on these polluting industries in a rapid time scale (and you may very well be right) then brace yourself for extinction.

view more: ‹ prev next ›

5C5C5C

0 post score
0 comment score
joined 3 years ago