Live data from Hacker News

A single line of code cost $8000

pietrasiak.com

11–20 of 423 posts

Re: A single line of code cost $8000

#11
I would also put into question if you _really_ need to check for updates every 5 minutes. Once per startup is already enough, and if you're concerned about users who leave it on for days, it could easily be daily or even less often.

Re: A single line of code cost $8000

#12
Bugs are great chances to learn.

What might be fun is figuring out all the ways this bug could have been avoided.

Another way to avoid this problem would have been using a form of “content addressable storage”. For those who are new, this is just a fancy way of saying make sure to store/distribute the hash (ex. Sha256) of what you’re distributing and store it on disk in a way that content can be effectively deduplicated by name.

It’s probably not so easy as to make it a rule, but most of the time, an update download should probably do this

Re: A single line of code cost $8000

#13
I am always kind of a stickler about code reviews. I once had a manager tell me that I should leave more to QA with an offhand comment along the lines of "what is the worst that could happen" to which I replied without missing a beat "We all lose our jobs. We are always one bad line of code away from losing our jobs"

The number of times I have caught junior or even experienced devs writing potential PII leaks is absolutely wild. It's just crazy easy in most systems to open yourself up to potential legal issues.

Re: A single line of code cost $8000

#14
post #11

I would also put into question if you _really_ need to check for updates every 5 minutes. Once per startup is already enough, and if you're concerned about users who leave it on for days, it could easily be daily or even less often.

IIRC, Every 5 minutes used to be the standard interval between email checks, back in the days of dialup and desktop email clients.

How the times have changed ..

Re: A single line of code cost $8000

#15
post #6

Ever consider not using cloud for everything? Hosting this on traditional hosting would have limited the problem and the cost.

And in that case, the problem would not be discovered until 1) someone opened a bug report, which rarely happens, because any competent user would just disable auto-updates, and 2) that bug report would be investigated, which also rarely happens.

Re: A single line of code cost $8000

#16
Why in the world does it need to check for updates every 5 minutes?

The author seemed to enjoy calculating the massive bandwidth numbers, but didn’t stop to question whether 5 minutes was a totally ridiculous.

Re: A single line of code cost $8000

#17
post #11

I would also put into question if you _really_ need to check for updates every 5 minutes. Once per startup is already enough, and if you're concerned about users who leave it on for days, it could easily be daily or even less often.

Yeah but that should be a variable anyways. Maybe even a variable provided by the server.

Re: A single line of code cost $8000

#19
post #11

I would also put into question if you _really_ need to check for updates every 5 minutes. Once per startup is already enough, and if you're concerned about users who leave it on for days, it could easily be daily or even less often.

Yeah but that should be a variable anyways. Maybe even a variable provided by the server. But in this case it should be on demand. with the old version cached and only downloading the new one when there is a new version once a day.

Re: A single line of code cost $8000

#20

Bugs are great chances to learn. What might be fun is figuring out all the ways this bug could have been avoided. Another way to avoid this problem would have been using a form of “content addressable storage”. For those who are new, this is just a fancy way of saying make sure to store/distribute the hash (ex. Sha256) of what you’re distributing and store it on disk in a way that content can be effectively deduplica…

> out all the ways this bug could have been avoided.

The most obvious one is setting up billing alerts.

Past a certain level of complexity, you're often better off focusing on mitigation that trying to avoid every instance of a certain kind of error.

Post reply on HN