Lurker News
Cursed hacks, forcing proprietary software to do what you want through clever means, or just generally doing awful, beautiful things with technology?

Comments (499) 174 threads

Earlier comments
CharlieDigital3 replies#
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.

cr3ative1 reply#
"on error resume next" never died, it just became serverless!
pmontra1 reply#
A customer of mine wraps their Python code into try except pass so it never stops because of errors, it just skips what would have run in the code after the exception. I added some logging so we're slowly understanding what fails and why.
naikrovek3 replies#
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.

ricardobayes#
Microcontroller/embedded stuff also.
muzani1 reply#
Old games also didn't use a database, they saved everything in a giant text file.

I'm not sure if they were "extremely stable" though. Like Myspace, it might only work up until a certain point. What kills stuff is usually going viral.

naikrovek1 reply#
I think you maybe underestimate the utility and reliability of flat text files on a filesystem.

If you don’t trust a filesystem, you can’t trust anything that uses one.
Flat files don’t scale past a certain point, but that point is way higher than most believe it is.

Continue this thread — 1 reply

lmm#
Suppressing errors and continuing to run in a corrupt state is good for games (crashing is definitely not fun, continuing to run might be fun, unless it's the kind of game where you can get yourself locked out of winning long ahead of time) but not good for most other kinds of code - it's better for your accounting code to crash than to save the wrong numbers!
sevagh#
Are they hiring?
bluelightning2k1 reply#
There was a very early MMO game which leaked its server files & people started doing custom servers.

There was a VERY limited scripting language for the server. This had some commands but missed basics like variables. However you could track the number of NPCs in a room.
So this led to some rather interesting new primitives:
- "Chickens in a room" became my preferred method of counting / implementing any kind of persistent global state.
- For timers I would spawn an enemy and a guard. When the guard killed the enemy the timer was up. (The number of NPCs dropped back to 1).
Combined these concepts to implement "dungeon instances": copied the map (as in literally copied the file) 10 times, used chickens-in-a-room to track which one players would enter, and whether you were entering the current instance or incrementing to the next was determined by the guard-kills-mob timer.

qup#
I have some less-interesting stories of cramming functionality into places it was not intended. Like Salesforce's backend. And the Spree shopping cart library.

Makes me feel like macguyver. You kinda look around, see what you're working with, and figure it out.

fallinghawks#
My mom's place (about 100 miles from me) has a water heater that's of an age where it could fail, so I put together a Pico W and a water sensor. I had it notify me daily just to make sure it was still working. And for reasons unknown, every 8 days it would stop notifying. A reboot would resolve it. We tried logging errors and having it report upon reboot but I wasn't versed enough with Pi to figure out anything more than it being an HTTP POST error. So I changed the code so when it got to that error instead of logging it would just reboot itself, and all has been smooth since.
hennell1 reply#
Needed to get data out of a CRM system for specific printed orders - when it was printed, who processed it, what was on the order etc.

The process of authenticating with the CRM was complex and there wasn't a way to get anything at print time and most of the data was stored all over the place.
But I found the printed report knew almost everything I wanted, and you could add web images to the paperwork system. So I added a tiny image with variable names like "{order_number}.jpg?ref={XXX}&per={YYY}" and then one for each looped product like {order_number}/{sku}.jpg?count={X}&text=..." etc. After a few stupid issues (like no support for https, and numbers sometimes being european format) it was working and has remained solid ever since. Live time stamped data, updates if people print twice, gives us everything we wanted just by a very silly method.

azalemeth1 reply#
As a European I'd like to know how our numbers are differently formatted to yours! (Did you mean dates? The never ending source of pain!)
gia_ferrari1 reply#
To me (USA) 1,000 is one thousand and 1.000 is one, and to me (Italian) 1,000 is one and 1.000 is one thousand :)
azalemeth#
Ahh, that one. Do'h!

Load more comments