Live data from Hacker News

A single line of code cost $8000

pietrasiak.com

301–310 of 423 posts

Re: A single line of code cost $8000

#301
post #274

Earlier quoted context omitted.

Tauri has been a thing for a while, it baffles me people still choose Electron without a good reason to do so. Also webapps are just great nowadays most OS support install PWA's fairly decently no? ffs

Tauri is not as platform-agnostic as Electron is because it uses different web views depending on the platform. I ran into a few SVG-related problems myself when trying it out for a bit. For example, on Linux, it uses WebKitGTK as the browser engine, which doesn't render the same way Chrome does (which is the web view used on Windows), so multi-platform support is not totally seamless. Using something like Servo as a…

>on Linux it uses WebKitGTK

It's about time Linux desktops adopt some form of ${XDG_WEB_ENGINES:-/opt/web_engines} convention to have web-based programs to fetch their engines as needed and play nice with each other.

Re: A single line of code cost $8000

#302
post #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 abso…

Code reviews kill velocity - introduce context switching, and are make work, it feels like you’re doing something to make a PR etc but your not. The context it makes the most sense is accepting code from strangers in a low trust environment. The alternative to trying to prevent mistakes is making it easy to find and correct them. Run CI on code after it’s been merged and send out emails if it’s failed. At the end of…

The up-front cost of code review can be easily be tripled or quadrupled when it’s distributed over several weeks after the fact in the form of unplanned work, each instance of which incurs its own cost of context switching, as well as the cost of potential rework.

The purpose of such a review is a deliberate bottleneck in the earlier stage of development to stop it becoming a much larger bottleneck further down the line. Blocking one PR is a lot cheaper than blocking an entire release, and having a human in the loop there can ensure the change is in alignment in terms of architecture and engineering practices.

CI/CD isn’t the only way to do it but shifting left is generally beneficial even with the most archaic processes.

Re: A single line of code cost $8000

#303
post #7

Just amazed that ‘better testing’ isn’t one of the takeaways in the summary. Just amazed. Yea ‘write code carefully’ as if suggesting that’ll fix it is a rookie mistake. So so frustrating when developers treat user machines like their test bed!

How do you adjust your testing approach to catch cases like this? In my experience, timing related issues are hard to catch and can linger for years unnoticed.

I imagine they’d have to start testing first…

Re: A single line of code cost $8000

#304
post #7

Just amazed that ‘better testing’ isn’t one of the takeaways in the summary. Just amazed. Yea ‘write code carefully’ as if suggesting that’ll fix it is a rookie mistake. So so frustrating when developers treat user machines like their test bed!

I don't think the author is wrong for saying that certain kinds of code should be written carefully. I object to the implication that other code shouldn't.

From TFA: "Write your auto-updater code very carefully. Actually, write any code that has the potential to generate costs carefully." So the focus is on code that "generate[s] costs". I think this is a common delusion programmers have; that some code is inherently unrelated to security (or cost), so they can get lazy with it. I see it like gun safety. You have to always treat a gun like it's loaded, not because it always is (although sometimes it may be loaded when you don't expect it), but because it teaches you to always be careful, so you don't absent-mindedly fall back into bad habits when you handle a loaded one.

Telling people to write code carefully sounds simplistic but I believe for some people it's genuinely the right advice.

Re: A single line of code cost $8000

#305

Earlier quoted context omitted.

Could you expend on what is an "override backoff" ?

The client might have a feature to retry certain failures, and it’s using a particular rate, probably not retrying n times one right after the other in rapid succession. This is called backoff. The server can return an override backoff so the server can tell the client how often or how quickly to retry. It’s nice to have in case some bug causes increased load somewhere, you can flip a value on the server and relieve…

Exactly. Without going too deep into the architecture, the clients are sending data to the backend in real time, but often that data is not actionable during certain periods, so the backend can tell the clients to bundle the data and try again after a certain amount of time, or just discard the data it's currently holding and try again later (i.e. in 5/10/n seconds)

Re: A single line of code cost $8000

#306
post #234

Earlier quoted context omitted.

The lack of dependency awareness drives me insane. Someone imports a single method from the wrong package, which snowballs into the blind leading the blind and pinning transitive dependencies in order to deliver quick "fixes" for things we don't even use or need, which ultimately becomes 100 different kinds of nightmare that stifle any hope of agility.

In a code review a couple of years ago, I had to say "no" to a dev casually including pandas (and in turn numpy) for a one-liner convenience function in a Django web app that has no involvement with any number crunching whatsoever.

Coincidentally, Copilot has been incredibly liberal lately with its suggestions of including Pandas or Numpy in a tiny non-AI Flask app, even for simple things. I expect things to get worse.

Re: A single line of code cost $8000

#307

$8000 is nothing for most companies, if you have 10 developers making 100k a year your burn rate is $4000 a day just for salaries.

$8000 also seems pretty cheap for 2PB of traffic? Looking at google cloud storage egress rates, $0.02/GiB (which is on the lower end, since it depends on destination) would be about $40k for 2PB.

Re: A single line of code cost $8000

#308
post #128
post #114

For people finding this thread via web search in the future: screen.studio is macOS screen recording software that checks for updates every five minutes. Somehow, that alone is NOT the bug described in this post. The /other/ bug described in this blog is: their software also downloaded a 250MB update file every five minutes. The software developers there consider all of this normal except the actual download, which c…

When I built an app that “phones home” regularly, I added the ability for the backend to respond to the client with an override backoff that the client would respect over the default.

Wish people would actually do things like this more often.

Plenty of things (like playstation's telemetry endpoint, for one of many examples) just continually phones home if it can't connect.

The few hours a month of playstation uptime shows 20K dns lookups for the telemetry domain alone.

Re: A single line of code cost $8000

#309

Reminds me of some Twitter lore from 2012. I was just an intern.... This is back in the Rails days, before they switch to Scala. I heard that there was a fail-whale no one could solve related to Twitter's identity service. IIRC, it was called "Gizmoduck." The engineer who built it had left. They brought him in for half a day of work to solve the P0. *Supposedly*, he got paid ~50K for that day of work. Simultaneously…

If a half day fix from a former employee costs that much, it’s likely because the company deserved it for some reason.

Re: A single line of code cost $8000

#310

Earlier quoted context omitted.

I make CPUs for a living. I'm happy these people exists, we'll always need faster CPUs.

The big clouds love these people too. So much of the software industry is just an outrageous combination of inexperience and "YOLO". Every problem can be solved by just giving AWS another $100,000 this month because we don't have time (and don't know how) to make even basically optimized software. So just burn the gas and electricity and give more money to the YAML merchants at Amazon.

> outrageous combination of inexperience

Correction--many have years of inexperience. Plenty of people that do things like this have "7 years designing cloud-native APIs".

Post reply on HN