Live data from Hacker News

Code is run more than read (2023)

olano.dev

31–40 of 110 posts

Re: Code is run more than read (2023)

#33
post #15

Earlier quoted context omitted.

What if there's an efficiency in engine design by placing the filter in the middle that leads to a +2mpg improvement for the driver? Or that it fails, on average, 22k miles later into it's life? Not all hard-to-repair-yourself designs are malicious...

If it is a part with a regular maintenance schedule, it should be designed for maintainability. Most maintainability conflicts come from packaging and design for assembly. Efficiency more often comes into conflict with durability, and sometimes safety.

Right but what I'm getting at is that there can be tradeoffs that might make designing for maintainability mean optimizing for something less important to the end user.

Do you optimize an engine for how easy it is to replace a filter once or twice a year (most likely done by someone the average car-owner is already paying to change their oil for them), or do you optimize it for getting better gas mileage over every single mile the car is driven?

We're talking about a hypothetical car and neither of us (I assume) design engines like this, I'm just trying to illustrate a point about tradeoffs existing. To your own point of efficiency being a trade with durability, that's not in a vacuum. If a part is in a different location with a different loading environment, it can be more/less durable (material changes leading to efficiency differences), more/less likely to break (maybe you service the hard-to-service part half as often when it's in a harder to service spot), etc.

Re: Code is run more than read (2023)

#34

I've worked at some of the "top tier" finance firms over the years. It is absolutely astounding how much of them run on code that is: - very reliable aka it almost never breaks/fails - written in ways that makes you wonder what series of events led to such awful code For example: - A deployment system that used python to read and respond to raw HTTP requests. If you triggered a deployment, you had to leave the webpag…

Which is great until you have to make changes to this kind of code, not to mention a massive refactoring.

That's the opposite of 'great'. Good code is that which can be refactored.

Re: Code is run more than read (2023)

#35
post #21

Earlier quoted context omitted.

What if there's an efficiency in engine design by placing the filter in the middle that leads to a +2mpg improvement for the driver? Or that it fails, on average, 22k miles later into it's life? Not all hard-to-repair-yourself designs are malicious...

If the engine failed due to missing oil change because of the difficulty, the whole car is gone. The waste in cost, material, and environmental impact far outweighs the savings in 2mpg improvement.

Glad to know in this hypothetical car scenario the owner decided to not get an oil change leading to the total loss of the vehicle. That seems very realistic and definitely something that car designs should be optimized around.

Or, we consider that 2mpg across 100,000 cars can save 3,500,000 gallons of gas being burned for the average American driving ~12k miles per year. And maybe things aren't so black and white. You're argument, in this hypothetical, is that negligent car owner who destroys their car because they're choosing to not change the oil is worth burning an extra 3.5millon gallons of gasoline.

Re: Code is run more than read (2023)

#36

Earlier quoted context omitted.

Most cars sold in the US are not aerodynamic so it seems a couple of mpg isn't the focus anyway

The US is filled with bubble cars like everywhere else. There isn't really much difference between cars across the world. Well, China is unique with like 100 automakers all searching for customers, but for most of the world, it's Toyota, VW, Hyundai/Kia, Stellantis, GM, Renault/Nissan, Ford as the top global producers and they sell everywhere. Sure there are some special models in local markets, but those are mostly…

https://en.wikipedia.org/wiki/Decline_in_insect_populations?...

Um I’m pretty sure that’s not the only evidence for insect population declines.

Re: Code is run more than read (2023)

#37

And cars are driven more than worked on, but putting the oil filter inaccessibly in the middle of the engine block is still an unforgiveable sin.

Try replacing the battery. Seems accessible enough at first, but ingenious engineering has made batteries the modern rubik's cube of auto maintenance.

Re: Code is run more than read (2023)

#38

Earlier quoted context omitted.

What if there's an efficiency in engine design by placing the filter in the middle that leads to a +2mpg improvement for the driver? Or that it fails, on average, 22k miles later into it's life? Not all hard-to-repair-yourself designs are malicious...

I’m no mechanical engineer, but I would assume those extreme tradeoffs occur more often when repairability is not prioritized from early iterations. I.e. “boss we’re 90% into the design cycle why are you bringing up the position of the oil filter now?” There’s definitely a programming equivalent as well…

That is fine if you are say building a race car that will be essentially rebuilt anyway in between races, or in general where 0.1% extra performace/less weight from non-repair-friendly placement might be worth it.

Not for normal car

Re: Code is run more than read (2023)

#39

And cars are driven more than worked on, but putting the oil filter inaccessibly in the middle of the engine block is still an unforgiveable sin.

What if there's an efficiency in engine design by placing the filter in the middle that leads to a +2mpg improvement for the driver? Or that it fails, on average, 22k miles later into it's life? Not all hard-to-repair-yourself designs are malicious...

This is like saying you can get a 10% improvement in battery life by changing where you position the RAM on your motherboard.

There is just no universe in which placing an oil filter in one location or another is going to make such a difference. You'd have to mount it completely outside the engine, say sitting as a cylinder on top of the hood, and even there you are not going to get a 2mpg improvement.

Re: Code is run more than read (2023)

#40
post #15

Earlier quoted context omitted.

If it is a part with a regular maintenance schedule, it should be designed for maintainability. Most maintainability conflicts come from packaging and design for assembly. Efficiency more often comes into conflict with durability, and sometimes safety.

Right but what I'm getting at is that there can be tradeoffs that might make designing for maintainability mean optimizing for something less important to the end user. Do you optimize an engine for how easy it is to replace a filter once or twice a year (most likely done by someone the average car-owner is already paying to change their oil for them), or do you optimize it for getting better gas mileage over every s…

Only TCO matters, that is the efficiency you actually optimize for, ie dollar per mile[1]not miles per gallon.

If the car is going to need to be in shop for days needing you to have a replacement rental because the model is difficult to service and the cost of service itself is not cheap , that can easily outweigh any marginal mpg gain .

Similarly because it is expensive and time consuming you may likely skip service schedules , the engine will then have a reduced life, or seizes up on the road and you need an expensive tow and rebuild etc .

You are implicitly assuming none of these will change if the maintenance is more difficult , that is not the case though

This is what OP is implying when he says a part with regular maintenance schedule to be easily accessible.

[1] of which fuel is only one part , substantial yes but not the only one

Post reply on HN