Recent submissions

Comment · 1 year ago
I've only been bullied once, so it's hard for me to really talk outside of that single time. I'm different and I've never given too many fucks about social norms or hierarchies, and I guess a bully from two grades above me took that as a sign I would be a good victim. Anyway, I knew what way he walked home, so the day after he had bullied me I hid in a bush. When he walked by I ambushed him with a stick and demanded he give me his school bagpack... I hoisted it into the school flagpole the next day... Like a total psychopath. Looking back on it, it's frigthening how few consequences there was for what was obviously way out of line. I guess the early 90ies were just a different time.

He probably had a shit life, but I never saw him bully anyone again.

Comment · 1 year ago
I'm mid fourties and I remember bordercrossings were annoying back in the 90ies. I'm Danish so we didn't enter Schengen until around 2000. I guess it didn't help that I was young enough that we traveled by bus. Once when we were on a school trip to Prauge we had the Slovakia borderpatrol go through our entire bus while waving machineguns around.
Comment · 1 year ago
I think it's more of an EU problem. We have so many public apps that rely on two big American tech companies solely because the EU has yet to figure out an alternative app store with enough security to make those apps available. This likely made sense 10 years ago, but today with all the talk about digital sovereignty it's frankly a little weak. It's not the OS that is the issue though, I could use graphene or similar just fine, but they wouldn't let me run a single of the apps that are the sole reason I have a smartphone. Well.. maybe the Microsoft authenticator?

I mean, I have to write exit strategies from Azure because the EU might demand our industry to leave non-EU infra. Yet ironically the digital company ID I would need to sign new contracts with within Europe aren't available without one of the two app stores. It's not that I can't sign those contracts without the ID, but I'd probably have to go to Germany in person.

Comment · 1 year ago
As cool as this is there won't be an European alternative as long as all the apps you'd want to use on a smartphone require either Google Play or the Apple App store.
Comment · 1 year ago
Microsoft did some research on it 15-20 years ago for .NET which showed that sync doesn't scale for I/O workloads. The rest of the world sort of "knew" at this point, and all the callback and statemachine hell which came before was also leading the world toward async/await but the Microsoft research kind of formed the foundation for "universal" acceptance. It's not just for single threaded JS programs, you almost never want to tie up your threads even when you can have several of them because it's expensive in memory. As you'll likely see in this thread, some lower level programmers will mention that they prefer to build stackful coroutines themselves. Obviously that is not something Microsoft wanted people to have to do with C#, but it's a thing people do in c/c++ and similar (probably not with C#), and if you're lucky, you can even work in a place that doesn't turn it into the "hell" part.

I can't say why Diesel.rs doesn't need async, and I would like to point out that I know very little about Diesel.rs beyond the fact that it has to do with databases. It would seem strange that, anything, working with databases which an I/O heavy workload would not massively benefit from async though.

Comment · 1 year ago
We're a much smaller scale company and the cost we lose on these things is insignificant compared to what's in this story. Yesterday I was improving the process for creating databases in our azure and I stumbled upon a subscription which was running 7 mssql servers for 12 databases. These weren't elastic and they were each paying a license that we don't have to pay because we qualify for the base cost through our contract with our microsoft partner. This company has some of the thightest control over their cloud infrastructure out of any organisation I've worked with.

This is anecdotal, but if my experiences aren't unique then there is a lot of lack of reasonable in DevOps.

Comment · 1 year ago
I think the OO hatred comes from how academia and certain enterprise organisations for our industry picked it up and taught it like a religion. Molding an entire generation og developers who wrote some really horrible code because they were taught that abstractions were, always, correct. It obviously weren't so outside those institutions, the world slowly realized that abstractions were in many ways worse for cyclomatic complexity than what came before. Maybe not in a perfect world where people don't write shitty code on a thursday afternoon after a long day of horrible meetings in a long week of having a baby cry every night.

As with everything, there isn't a golden rule to follow. Sometimes OO makes sense, sometimes it doesn't. I rarely use it, or abstractions in general, but there are some things where it's just the right fit.

Comment · 1 year ago
Both score 7 now though.

This scores 6: function a(b) { return b[0]; }

This scores 3: const a = (a) => a;

Comment · 1 year ago
I'm not sure how you can infer types on this. Even if you input an array of users from a different function. How would we know that data[0] is a User and not undefined?
Comment · 1 year ago
Maybe I'm doing things wrong, but I assume this tool is meant to focus on cognetive complexity and not things like code quality, transpiling or performance, but if that's true then why does this:

(score is 7) function get_first_user(data) { first_user = data[0]; return first_user; }

Score better than this:

(score is 8) function get_first_user(data: User[]): Result<User> { first_user = data[0]; return first_user; }

I mean, I know that the type annotations is what gives the lower score, but I would argue that the latter has the lower cognetive complexity.

Comment · 1 year ago
Comment · 1 year ago
If it goes by WIFI and not the wired network it'll be rather of useless in every enterprise organisation I've ever worked in. I'm not sure I've even worked in a place where the WIFI wasn't a guest network. Don't get me wrong, I'd like the feature. I work in a fully flexible place, but part of that is setting your status to be "working from outside the office" when you're not there. If that could happen automatically that'd be great.
Comment · 1 year ago
Was MERGE too slow/expensive? We tend to MERGE from staging or temporary tables when we sync big data sets. If we were on postgres I think we'd use ... ON CONFLICT, but MERGE does work.
Comment · 1 year ago
I have smart lighting, but that's only because it means I can turn everything in the area living and eating room on/off with a single button/switch (not sure what the right English term is). In a typical Danish townhouse like mine that would be 4-8 buttons otherwise.

If I had an electrician redo the wiring, I'd do the same thing without the "smart".

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton