Better HN
topnewbestaskshowjobs
Log inSign up

physicles

1,822 karma · joined Feb 3, 2019 (7y ago) · 645 submissions

Submissions

comment 1y ago · link · parent

> Then you end up with something where you can write "TimoutSec=60" as well as "TimeoutSec=1min" in the case of systemd :)

But that's wrong too! If TimeoutSec is an integer, then don't accept "1min". If it's some sort of duration type, then don't call it TimeoutSec -- call it Timeout, and don't accept the value "60".

comment 1y ago · link · parent

Right, your type system can quickly become unwieldy if you try to create a new type for every slight semantic difference.

I feel like Go strikes a good balance here with the time.Duration type, which I use wherever I can (my _msec example came from C). Go doesn’t allow implicit conversion between types defined with a typedef, so your code ends up being very explicit about what’s going on.

comment 1y ago · link · parent

That’s not automatically bad. There are two kinds of Hungarian notation: systems Hungarian, which duplicates information that the type system should be tracking; and apps Hungarian, which encodes information you’d express in types if your language’s type system were expressive enough. [1] goes into the difference.

[1] https://www.joelonsoftware.com/2005/05/11/making-wrong-code-...

comment 1y ago · link · parent

The root cause here is poorly named settings.

If the original setting had been named something bool-y like `help.autocorrect_enabled`, then the request to accept an int (deciseconds) would've made no sense. Another setting `help.autocorrect_accept_after_dsec` would've been required. And `dsec` is so oddball that anyone who uses it would've had to look up.

I insist on this all the time in code reviews. Variables must have units in their names if there's any ambiguity. For example, `int timeout` becomes `int timeout_msec`.

This is 100x more important when naming settings, because they're part of your public interface and you can't ever change them.

comment 1y ago · link · parent

Nope, on principle. I’ve tried to make YouTube as “healthy” as possible — disable shorts, disable watch history, only watch subscribed channels — and I’m still not convinced it’s a net positive in my life.

The trick is finding something else to replace it during that time at the end of the day when I don’t feel like I have the mental energy for anything else.

comment 1y ago · link · parent

The first one is known in the Pragmatic Programmer as “select isn’t broken.” Summarized at https://blog.codinghorror.com/the-first-rule-of-programming-...

comment 1y ago · link · parent

Related: decrease your iterating time as much as possible. If you can test your fix in 30 seconds vs 5 minutes, you’ll fix it in hours instead of days.

comment 1y ago · link · parent

For humans, the notion of “self” is also an illusion. We’re just atoms dancing to physics. But that’s not the right level of abstraction from which to do psychology.

Is the notion of an LLM operating on a document useful for building an intuition about how the LLM operates? That’s the more interesting question.

comment 1y ago · link · parent

Are you crossing your eyes (focusing nearer than the object) or diverging them (focusing past it)? Diverging is a harder skill to learn.

comment 1y ago · link · parent

ScriptyScript

comment 1y ago · link · parent

This mindset is such a trap. It leads to worse outcomes.

Out of all the people you can pair-bond with, and for some definition of soulmateness, one person is the greatest.

In the space of all the decisions you could’ve made in your life, there are some paths that would’ve indeed led you to that person.

But that person’s identity, and that path, are simply unknowable. Even if they were knowable, odds are you’d screw up somewhere down the line, and know that you did so, and that could destroy a person.

Similarly, your life definitely isn’t as meaningful as it could possibly have been (for some definition of meaning), and it definitely has fallen short of its potential. Your life is suboptimal. Everyone’s is.

This is human. This is ok.

To be clear: it’s up to you to decide whether this is ok. If you decide it’s not ok, then as you agonize over the delta between your hypothetical maximized self and your actual self, you will miss your life.

That hypothetical maximized self doesn’t exist. Fuck ‘em. You exist. You’re the only version of you that matters.

comment 1y ago · link · parent

Wouldn’t she have died from exposure if you hadn’t found her?

There’s a beautiful quote from a 2019 episode of the podcast The Anthropocene Reviewed, Auld Lang Syne. John Green recounts some advice he got while in college and working as a chaplain at a children’s hospital: “Don’t just do something. Stand there.”

comment 1y ago · link · parent

This is related to how I define technical debt: the delta between what exists, and what you would write if you could start from scratch and had infinite time. Paying down technical debt is therefore the process of moving the system toward that clean-slate state.

Of course, if you look at all those little deltas between the current and clean-slate states, some of them are much more expensive to live with or solve than others. This definition doesn’t help you decide which changes to make first, only what your North Star should be.

comment 1y ago · link · parent

Also, the amazing story of Helena Valero, kidnapped by an Amazon tribe, survived just on her wits, and escaped years later: https://news.ycombinator.com/item?id=41758857

comment 1y ago · link · parent

You’re right. Going back over some notes (including go.mod’s history), we’ve been at this for six years, not four. And a dozen build breaks is probably an overestimate — it’s more like one every 12-18 months. Most upgrades are uneventful, everything just continues working.

comment 1y ago · link · parent

If you're working at a large company and downtime is extremely expensive, this checklist is a good guide. Otherwise, if you have good test coverage, you can get by with something simpler. It's super rare to have a breaking change in go.

We do quarterly upgrades of all services in a monorepo (about 20-30). The steps are basically this:

- Upgrade all dependencies to their latest versions, fixing build and test breaks (I read release notes for Go, but not for dependencies)

- Look for deprecated packages and replace them

- Upgrade all toolchains, including CI/CD containers, go.mod, etc.

- Run all tests

- Deploy to the test environment and make sure everything is green

- Deploy to staging and do some sanity checks

- Deploy to prod, keeping an eye on metrics for an hour or two

We're on k8s and the state of all clusters (i.e. which images are running) is tracked in git, so a rollback is just git revert + apply.

In practice, after about four years of this, we've seen maybe a dozen build breaks, and I can only remember one regression caused by a breaking change in a library[1].

[1] https://github.com/golang/go/issues/24211

comment 1y ago · link · parent

If you write code that uses a hash map, would you insist on using SQL to query it? This makes no sense.

comment 1y ago · link · parent

According to the article, the mistake wasn’t that X10 got too far out in front of the team (the initiative to build svc was supposed to be a lone effort), it was Org’s failure to orchestrate a hand-off from X10 to team.

comment 1y ago · link · parent

I suspect systemization would require quantifying some of the variables involved, which include things like

- The size and complexity of the code base (for some definition of size and complexity)

- The quality of the code and docs (for some definition of quality)

- The skill and experience of the people involved

In four years in a big tech role, my team twice inherited and had to modify a code base without any input from the original authors. One was a quagmire, the other was a resounding success:

- The first was a media player control that we had to update to support a new COM interface and have a new UI. We decided that it was too complicated, and nobody understood it, so we’d reimplement it from scratch. One year later it mostly worked, but still had bugs and performance issues that the original version didn’t have. In hindsight, I suspect it would’ve been cheaper to try to revive the original code base.

- The second was a music database for an app running on a mobile device. Our current one was based on the version of SQL available, but some principal engineers on another team suggested replacing it with a custom in-memory database that already shipped in another device. We argued that the original authors had left and the code was unwieldy; they argued that “it’s just code, we can read it” and its performance was known to be better. They did the work to revive it and successfully integrated it into our app. Wild success.

The flip side of “it’s impossible to revive a dead system” is “don’t rewrite a working system from scratch”. Absent more research, the only way to correctly guess which situation you’re actually in is to have tons of experience.

comment 1y ago · link · parent

If you’ve thought a lot about shoelaces, I assume you’ve seen https://www.fieggen.com/shoelace/. I switched to a square knot a few years ago and my shoes basically never come untied.

comment 1y ago · link · parent

Yep I meant check-in.

comment 1y ago · link · parent

Maybe I’m missing something, but this doesn’t seem like what the article is talking about at all. These events are just telemetry — they’re downstream from everything, and no service is ingesting them or relying on them for actual operational data.

comment 1y ago · link · parent

The trains in China are amazing. Most of the current track has been built in the last ten years. They’re done connecting major cities, so now we’re seeing high speed lines to places like Beijing suburbs, which turn multiple-hour car rides into 40 minute train rides.

For trips up to about 1500km I’ll favor the train because it’s just more comfortable — security checks are sane, no luggage check, and more leg room. Beijing to Shanghai could be faster by train or by plane depending on which airport you fly into, and where your destination is within the city.

Beijing to HK is a different story. The fastest trains to Shenzhen (right across from HK) are currently 7h50m, compared to a 3.5 hr flight. An overnight sleeper is a good option, especially if you have 3 friends to travel with.

comment 1y ago · link · parent

I was on an iPhone X for six years (bought it used one year old), and had the battery replaced three times. No big deal.

The reason I upgraded was that I was wasting literal minutes per day waiting for apps to load. I live in China, and for some reason the apps here are beyond outrageous in the amount of resources they use. Showing a QR payment code in WeChat, or opening a shared bike in Meituan, frequently took on the order of 10 seconds. I assume the phone was just chewing on a terrifying amount of JavaScript.

I could only keep 2 of these monster apps open at a time. Opening a third would OOM kill one of the other two.

iPhone 16 pro and these actions are basically instant.

Fucking nauseating.

comment 1y ago · link · parent

Also just turned 40 this year, coding straight since I graduated college. If you do need to go back to work, there are ways of making it feel more sustainable and not life-draining.

I was feeling close to burnout a couple years ago in my current job, but was lucky enough that they let me drop back to four days a week. And the company is fully remote, so I end up traveling about three months out of the year. I have a hobby that helps me meet people when I travel.

Maybe living overseas also helps life feel less like it’s passing me by.

Ideally I’d be able to take a few month sabbatical, now that I’ve been in my current role for 8+ years. Still working on that…

comment 2y ago · link · parent

Do you mind getting into specifics about how you've been using AI to restructure your code? What tools are you using, and how large is the code base you're working with?

comment 2y ago · link · parent

You say “origins”, but someone who takes a more skeptical stance would say “extraordinary supernatural claims for which there’s no evidence at all.” In my case, I absolutely need to discard that stuff if I have any chance of taking what’s left seriously.

comment 2y ago · link · parent

That’s amazing. How did you regularly monitor your blood pressure?

comment 2y ago · link · parent

> I live in a rural working class region. I have beers with these guys all the time. They're my best friends and I'm the odd coder guy that works from home.

This is what America needs more of — people from different worlds just having beers together, and realizing that we’re all normal people trying to get by.

Do you know of anyone who can articulate a compelling case of why Trump would make a good president? I’m left-leaning but I want to understand where others are coming from.

comment 2y ago · link · parent

Actually it’s on the driver. Uber will be just fine either way.
1
789
22