1,822 karma · joined Feb 3, 2019 (7y ago) · 645 submissions
comment 1y ago · link · parent
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
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
[1] https://www.joelonsoftware.com/2005/05/11/making-wrong-code-...
comment 1y ago · link · parent
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
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
comment 1y ago · link · parent
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
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
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
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
comment 1y ago · link · parent
comment 1y ago · link · parent
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].
comment 1y ago · link · parent
- 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
comment 1y ago · link · parent
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
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
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
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.