Live data from Hacker News

Ask HN: What's your "it's not stupid if it works" story?

news.ycombinator.com

31–40 of 510 posts

Re: Ask HN: What's your "it's not stupid if it works" story?

#32

I worked at a startup where the core backend was 1 giant serverless Function. For error handling and recovery, the Function ran in a while loop. For all its faults, it worked and it was generating revenue. Enough that the startup got to a sizable Series A. That experience completely changed how I think about writing code at startups.

this is great. if you look at older game source code you find things like this. things that we view as horrible hacks which are both extremely stable and perform well. i see no reason to stop using these types of solutions, when appropriate.

Microcontroller/embedded stuff also.

Re: Ask HN: What's your "it's not stupid if it works" story?

#33

I worked at a startup where the core backend was 1 giant serverless Function. For error handling and recovery, the Function ran in a while loop. For all its faults, it worked and it was generating revenue. Enough that the startup got to a sizable Series A. That experience completely changed how I think about writing code at startups.

Are they hiring?

Re: Ask HN: What's your "it's not stupid if it works" story?

#34

In a previous role, I automated an unholy amount of business processes by adding doGet() / doPost() handlers to expose google sheets as basic web services. It's a bit slow for large sheets, but was quite nice to work with and troubleshoot, and the built-in history in google sheets allowed me to experiment with little risk of data loss/corruption.

Investment banking analysts: “this is a hack??”

Re: Ask HN: What's your "it's not stupid if it works" story?

#36
A company I worked for had a website where you could order mobile phones and subscriptions from different providers. This was just a frontend, and behind the scenes, they just ordered them directly from those providers. But those providers had terrible sites still written for IE6 (this was in 2010 I think). And yet those sites where all they had (for some reason; I don't know the full background).

So what happened is: the customer would order their phone subscription on the front end, that would create a job file that would be sent to a scheduler that managed 10 Windows VMs that used a Ruby Watir script to direct IE6 to fill in the data from the job file on the old decrepit website.

It's the most horrific hack that I ever touched (I forgot exactly, but I had to make some adjustments to the system), but it worked perfectly for a couple of years until those providers finally updated their websites.

Re: Ask HN: What's your "it's not stupid if it works" story?

#37
post #5

I had an old boiler that would sometimes trip and lock out the heat until someone went down and power cycled it. (It was its own monstrous hack of a gas burner fitted to a 1950s oil boiler and I think a flame proving sensor was bad.) Every time it happened, it made for a long heat up cycle to warm the water and rads and eventually the house. So I built an Arduino controlled NC relay that removed power for 1 minute ou…

I have a similar one. Our boiler has a pump to cycle hot water around the house - this makes it so you get warm water right away when you turn on a faucet and also prevents pipes in exterior walls from freezing in the winter. This stopped working, the pump is fine but the boiler was no longer triggering it. I just wired up mains through an esp32 relay board to the pump and configured a regular timer via esphome. Temp…

I eventually switched to an ESP32 and added temperature graphing: https://imgur.com/a/VM7nD74

IIRC, I used an RTD that I had left over from a 3D printer upgrade, but an 18B20 would fine as well. A 10K NTC resistor might even be good enough. For what I needed (and I think for what you need), just fixing the sensor to the outside of the pipe [if metal] will give you a usable signal. That sensor was just metal HVAC taped to the front cast iron door of the burner chamber.

But a dead-simple timer solution gets you pretty far as you know.

Re: Ask HN: What's your "it's not stupid if it works" story?

#38

`sed` text files as a replacement for templating. In the text file you have something you want to template (or "parametrize") from an outside variable, so you name that something like @@VAR@@ and then you can sed that @@VAR@@ :-)

That's how we do it. Not with sed exactly, but string replacement. One is a bull email sender that only supports VBScript, the other is C#, but the users aren't supposed (or need) to have full templating powers, so this way it's easier.

Re: Ask HN: What's your "it's not stupid if it works" story?

#40

Monkey patching vendor code. They agreed their code didn’t work and produced wrong results, but the correct version would be slower, so they didn’t want to change it. So I dynamically replaced the part of their code that was wrong. That monkey patch has run years and is still going :)

Who cares if it's wrong, as long as it's fast?
Post reply on HN