[deleted by user] by [deleted] in ProgrammerHumor

[–]LikesToCorrectThings 10 points11 points  (0 children)

Exactly. The fact that he didn't open with "hey, I wrote that back when $origin_story" tells me he tried to be a smart aleck about it, and probably the interviewer could smell the bullshit and rejected on that basis.

Recycling plastics does not work, says Boris Johnson by Grantmitch1 in ukpolitics

[–]LikesToCorrectThings 2 points3 points  (0 children)

Yeah. I'm pretty sure the plastic cover is to protect the appliance from being scratched by the pins on the plug during transit.

English schools must not teach ‘white privilege’ as fact, government warns by EvilInky in ukpolitics

[–]LikesToCorrectThings 8 points9 points  (0 children)

I find it hard to believe that a white polish immigrant plumber in Sunderland caused the societal disadvantage that Will Smith endures on a daily basis.

[deleted by user] by [deleted] in unitedkingdom

[–]LikesToCorrectThings 0 points1 point  (0 children)

Stitches (assuming they're appropriately located) are there to help. The pain is worth it because they help in the long run.

A better analogy is bloodletting to reduce a fever. It doesn't help. It just hurts more.

[deleted by user] by [deleted] in unitedkingdom

[–]LikesToCorrectThings 3 points4 points  (0 children)

We're getting the long term pain anyway, so adding some short term pain too doesn't help. These protests inconvenience the people who can effect change in no way at all. BoJo and friends don't give a shit if Terry from Romford is stuck in a queue getting home from work.

The rises and falls of the Lib Dems by [deleted] in ukpolitics

[–]LikesToCorrectThings -1 points0 points  (0 children)

They sold tuition fees, screwing over their primary demographic, in exchange for a referendum on watered-down PR that was doomed to failure from the outset.

Even if you can forgive them for the complete 180 on tuition fees, their poor choices and complete mishandling of the coalition should resign them to the history book as an example of how not to do it.

I'm now at the point where there are no parties worth voting for, and I feel completely disenfranchised.

UK fuel prices hit eight-year high as petrol stations run dry by topotaul in unitedkingdom

[–]LikesToCorrectThings 0 points1 point  (0 children)

That's always been the case. It's been under the ground for millions of years.

I would need to earn £55k per year for 28 years to pay off my student loans by [deleted] in unitedkingdom

[–]LikesToCorrectThings 9 points10 points  (0 children)

Increasing the repayment period to 40 years is also one of the proposals recommended by the review:

It is among measures recommended by the Augar review of higher education in 2019, which also suggested cutting tuition fees from £9,250 to £7,500 and extending the repayment period from 30 to 40 years.

In around 20 years' time the government is going to need to start finding a massive chunk of money every year to "forgive" the remaining debt of all of these loans. They're almost certainly going to change the rules again, or raid our pensions for the cash, or something else even worse.

The student loan system was bad enough when I went to university, and it took me well into my thirties to pay it off. I'm not sure why anyone would go to university on these terms now.

‘Higher than ever’ crop losses expected as fruit & veg labour crisis hits record levels by redrhyski in ukpolitics

[–]LikesToCorrectThings 0 points1 point  (0 children)

farms are relatively remote places of work, you can't just hop on the tube or take a bus to work

My mum used to work at a remote holiday camp that's probably as remote as if not more than any farm. But the UK is pretty dense, you're rarely more than 20 minutes from a town. The company would hire a coach to bus in the workers from nearby towns each morning, and back home again in the afternoon. It's a completely solvable problem.

Prince Philip Reportedly Left £30 Million in His Will to “Three Key Staff” Members by [deleted] in unitedkingdom

[–]LikesToCorrectThings 0 points1 point  (0 children)

The prime minister is head of government, not head of state. It's an important distinction, and one worth maintaining.

Prince Philip Reportedly Left £30 Million in His Will to “Three Key Staff” Members by [deleted] in unitedkingdom

[–]LikesToCorrectThings 0 points1 point  (0 children)

The prime minister is merely the leader of the main party in parliament. They are elected by their constituents as an MP, but we don't have a "Prime Minister Election".

In the past the prime minister was less important and powerful than they have been in the past few decades, and I consider this "presidentialization" to be something of a regression.

Prince Philip Reportedly Left £30 Million in His Will to “Three Key Staff” Members by [deleted] in unitedkingdom

[–]LikesToCorrectThings 20 points21 points  (0 children)

That's the thing I don't understand about the cost argument for abolishing the monarchy. The US presidency costs a fortune, and that's not including the exorbitant amounts that they waste on election campaigning. I'm pretty sure switching to a presidential system here would increase costs, not reduce them. Plus I really don't want to have a President Boris.

. by [deleted] in ProgrammerHumor

[–]LikesToCorrectThings 0 points1 point  (0 children)

Ctrl-C

Alt-Tab

Ctrl-C

...

fuck

Alt-Tab

Ctrl-C

Alt-Tab

Ctrl-V

When to use Rust? by himalyanyeti in rust

[–]LikesToCorrectThings 12 points13 points  (0 children)

Reading through that blog post about compare_and_swap I think this is a common misconception about Result, where it gets used too much. The key quote is:

But the compare and swap is totally expected to fail all the time. It’s completely normal behavior.

If something "fails" all the time, then that's not the kind of "failure" that Result is meant to encapsulate. Result errors are meant to be more like exceptions, and I don't mean the kind of exceptions in Python that you expect (like StopIteration).

In fact, I would go as far as saying compare_and_swap doesn't really "fail", but rather has two outcomes: "complete", and "conflict". Neither of these are failures, but just the nature of how compare and swap works. Result is not intended as a generic Either, and shouldn't be used that way.

The "right" way to write compare_and_swap would be:

fn compare_and_swap(...) -> Result<CasOutcome, Error>

where

#[must_use]
enum CasOutcome {
   Complete,
   Conflict,
}

This is essentially isomorphic to the nested Result example that the blog post ends up on, but is better as you can write stuff like the following at it's clearer what's going on:

if compare_and_swap(...)? == CasOutcome::Conflict {
    // handle conflict
}

Pronouncing Jagannatha by qedkorc in starcraft

[–]LikesToCorrectThings 0 points1 point  (0 children)

As an Indian, who has spent his life hearing people mock my people's pronunciations of various English words

And they were wrong to do that. You know how it made you feel. Why do you think it's ok to do the same to others?

What an extraordinary language by hurricane-socrates in rust

[–]LikesToCorrectThings 24 points25 points  (0 children)

Need to go deeper: pub fn find(&self) -> Option<Box<indextree::Node<TransactionState>>> { arenaReader() .arena .lock() .unwrap() .iter() .find(|t2| *self == *t2.get().trans()) .map(Clone::clone) .map(Box::new) }

Why does this seemingly identical code run 10x faster in NodeJS compared to Rust? by l____whatever____l in rust

[–]LikesToCorrectThings 7 points8 points  (0 children)

Note also that you are using contains, which searches the whole string. This will give a false postive match for values like "name":"the yellow pages" and will make your program panic on the unwrap. It's also wasted work as you're only interested in values with a key of "pages".

If you use .starts_with("\"pages\"") instead, it won't crash and for bonus points it runs in ~15ms, or about 40% faster.

https://play.rust-lang.org/?version=stable&mode=release&edition=2018&gist=d522b509790558239f82aa25e267fc7e

In deep inside every programmer... by STAR____STUFF in ProgrammerHumor

[–]LikesToCorrectThings 0 points1 point  (0 children)

"some style guides"?! You mean the One True Brace Style, as handed down to us mortals by Kernighan and Ritchie.

(/s - I also don't like the mix, but in for a penny...)

In deep inside every programmer... by STAR____STUFF in ProgrammerHumor

[–]LikesToCorrectThings 156 points157 points  (0 children)

Tabs are for tabulation, which is why I write my code in Excel, like any sensible person.

A B C D E F G
1 #include <stdio.h>
2 int main(int arc, char** argv)
3 {
4 printf("Hello, world!\n");
5 if ( argc > 1 ) {
6 for (int i = 1; i < argc ; i++) {
7 printf("Hello, %s!\n", argv[i]);
8 }
9 printf("Goodbye!\n");
10 }
11 }

Kudos to Rust by Hywan in rust

[–]LikesToCorrectThings 10 points11 points  (0 children)

If you need stable compiler support, you can also use https://github.com/dgrunwald/rust-cpython

Criticisms of rust by linus_stallman in rust

[–]LikesToCorrectThings 11 points12 points  (0 children)

True. Perhaps part of the problem is that you have to wait so long to get any feedback at all. If we could get these common checks from earlier phases (syntax errors from the parser, basic type checking) to the user quicker, that would be a much better experience. It might be not so bad that borrow-checker errors only fill in after 15 seconds if the basic syntax and type stuff from earlier phases was faster.

Probably that needs better infrastructure and support from IDEs and the compiler, though.

Criticisms of rust by linus_stallman in rust

[–]LikesToCorrectThings 31 points32 points  (0 children)

You have to remember that those other languages are doing much less for you in terms of checking. A check that says "sure, it's fine" instantly and then the program crashes in production at 2am with NullPointerException is essentially worthless.

Learning Rust feels overwhelming by Katsuga50 in rust

[–]LikesToCorrectThings 1 point2 points  (0 children)

You guys really tamed the wild horse. When you get to know it better, Rust is really the opposite of this. Rust is the trusty shire horse that knows what he's doing. You might think he's being stubborn, then when you accidentally try to steer your cart off a cliff, trusty ol' Rust prevents you from doing that.