4,017 karma · joined Mar 10, 2017 (9y ago) · 930 submissions
comment 1y ago · link · parent
fvs, err := features.AppendWithNames(..)
if err != nil {
// this will NEVER break
panic(err)
}
Ultimately I don't think language design can be the sole line of defence against system failures; it can only guide developers to think about error cases214.
The Cloudflare outage was a good thing(gist.github.com ↗)
10 points · by zero_shift · 1y ago · discuss
comment 1y ago · link · parent
I think you want to use a TypeScript compiler extension / ts-patch
This is a bit difficult as it's not very well documented, but take a look at the examples in https://github.com/nonara/ts-patch
Essentially, you add a preprocessing stage to the compiler that can either enforce rules or alter the code
It could quietly transform all object like types into having read-only semantics. This would then make any mutation error out, with a message like you were attempting to violate field properties.
You would need to decide what to do about Proxies though. Maybe you just tolerate that as an escape hatch (like eval or calling plain JS)
Could be a fun project!
comment 1y ago · link · parent
It's better to have diverse, imperfect infrastructure, than one form of infra that goes down with devastating results.
I'm being semi-flippant but people do need to cope with an internet that is less than 100% reliable. As the youth like to say, you need to touch grass
Being less flippant: an economy that is completely reliant on the internet is one vulnerable to cyberattacks, malware, catastrophic hardware loss
It also protects us from the malfeasance or incompetence of actors like Google (who are great stewards of internet infrastructure... until it's no longer in their interests)
comment 1y ago · link · parent
My answer right now is to try and build more things myself. Small apps, CLIs, retro games. Not libraries or much OSS stuff so much as actual "products" that give me creative control and concrete outputs. It's hard to make the time though.
Outside of my career I'm also trying to cultivate other works, like my YouTube channel and my writing. Creating a video that 250k people enjoy is at least as meaningful to me as crushing my OKRs
We are all mortal beings: there will inevitably be more things to do than time to do it, and it's easier to ruminate on options than commit to something that feels "suboptimal".
To give an example of that. I spent a lot of time wondering if I should have gone into academia / literary criticism rather than tech, because of a vague sense that because I was very good at something, that's where I should put my efforts. Is that sound reasoning though? I probably achieved more "value" for society working as a programmer, than writing about Chaucer.
So to summarise it may be a choice of making peace with the lower scope / autonomy of hands on work, and finding that satisfaction outside work. If that suggestion makes your soul revolt, though, it may be you have to compromise and take the managerial path
comment 1y ago · link · parent
Saying "it's better to complete something imperfect than spend forever polishing" - dull, trite, anyone knows that. Saying "effort is a utility curve function that must be clamped to achieve meta-optimisation" - now that sounds clever
If I was going to be uncharitable, I think there is are corners of the internet where people write straightforward things dressed it up in technical language to launder it as somehow academic and data driven.
And you're right, it does show up in the worse parts of the EA / rationalist community.
(This writing style, at its worst, allows people to say things like "I don't want my tax spent on teaching poor kids to read" but without looking like complete psychopaths - "aggregate outcomes in standardised literacy programmes lag behind individualised tutorials")
That's not what the blog post here is doing, but it is definitely bad language use that is doing more work to obscure ideas than illuminate them
comment 1y ago · link · parent
AMZN for example overhired in various functions because it expected demand that never materialised. Admitting that is bad for the share price, but writing some woo about "AI and agility" will convince at least some investors to keep the faith.
comment 1y ago · link · parent
As part of the Family Hub™
software update, we are
piloting a new widget
for select Cover screens
themes of Family Hub™
refrigerators. The
widget will display
useful day-to-day
information such as
news, calendar and
weather forecasts, along
with curated
advertisements.[11]
Wow!! Elevating!!!comment 1y ago · link · parent
Will it? Investors would prefer full price fridges with full price ads.
Most consumers won't even know they've installed adware until the appliance is turned on, and what are they gonna do? go to all the effort of returning and buying another fridge?
Captive audience
comment 1y ago · link · parent
Instead of
type Saver interface {
Save(data []byte) error
}
You could have type saves func([]byte) error
Seems less bulky than an interface, more concise to mock too.It's more effort when you need to "promote" the port / input type to a full interface, but I think that's a reasonable tradeoff to avoid callers of your function constantly creating structs just to hang methods off
comment 1y ago · link · parent
comment 1y ago · link · parent
P1: The type and its method vtable
P2: The value
Once I understood that I could intuit how a nil Foo was not a nil Bar and not an untyped nil either