MHN

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

441 points by _bbih·1074 days ago·Show in HN

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

Add a comment on Hacker News →
2 of 499 comments
  1. A long time ago I was building a data entry system is Visual Basic for forms that, once entered, need to both store the input in a database and print out the form. There were hundreds and hundreds of different forms.

    So, instead of making an interface for data entry and then a system to print the forms, the data entry UI for each form looked exactly the same as the forms themselves. Scrolling was needed because at the time there were only low resolution CRT screens.

    However, for printing, I would draw the filled out form at a very high resolution in video memory "off screen" and print that.

    So, the work to create one form resulted in supporting both data entry and printing.

    It turned out that since the people doing the data entry also knew the forms really well, they were able to enter the data 2.5 times faster than initial estimates.

  2. At university we were tasked with making an Android application for a real client. This was part of our course and was really fun to do. Especially because we did this in two groups competing with each other. The app was some sort of geocaching mixed with a quiz to discover a city in groups. We also built a server side app that accompanied the clients. This app was targeting Android 2.3 and ran on some sort of old Xperia device.

    Building the app was a lot of fun and it worked pretty well most of the time. During beta testing however, we were given all the resources that were crreated by a third party. This mostly included UI elements and other images that made up the UI. Testing it out, again, it worked pretty good. Until one time it didn't...

    After about an hour or so of playing, the app would consistently crash. After some OS troubleshooting, we came to the conclusion that apparently Android (at the time) had the habit of not putting images in managed memory, but separately. And whenever this space overflowed, an app would simply crash. To resolve this you would need to manage this space yourself and clear out memory.

    However we only discovered this a week or so before the deadline. And implementing memory management would be nigh impossible to do. So I came up with the hackiest solution that I ever built. I added a crash handler to the app, which would start another instance. I also added a serializer / deserializer to the app and whenever you reached the main menu all play progress was serialized to storage. Whenever the app crashed and restarted, this was read again and letting the users resume play. The only side effected was some weird app flickering because of the crash and restart.

    A week later when we delivered the app to our clients, they wanted to try it out and play test it. So we did, along with the other group. And lo and behold, after an hour or so the app crashed. And restarted. Unlike the other group, were the app crashed and had to be restarted manually.

    In the end the client was really happy with the result. Because it just worked. AFAIK the app is still in production the same way it was about 10 years ago.