Hacker News new | past | comments | ask | show | jobs | submit login

Oh wow, I had a virtually identical experience.

I was a junior programmer helping out with a Java applet game that ran in the browser. It had performance issues, which I narrowed down to a “ticker tape” text animation. The position of the text in pixels was being updated by a background thread, and that thread would leak each time when the user switched screens. If you clicked around enough there would be hundreds of threads all updating the same shared variable.

I replaced a thousand lines of that nonsense with a single line of code:

    return getTicks() * velocity % tickerWidth;
It looked identical except that now there weren’t any threads used and the animation was silky smooth.

I got in trouble for “making a mess”. The developer responsible for the previous code had been busy (for weeks!) “fixing” this code and couldn’t merge his change. So it got reverted and they spent another month tuning the threaded code for better performance.

I waited until they got distracted and gave up, then re-merged my one-liner. They were convinced they had “fixed it” and never looked at that code again.

The responsible coder got a pat on the back for his hard work and I got a disciplinary meeting to discuss my “behaviour”.

This was at a startup that burned through ten million dollars and then was shuttered because the software was basically garbage and couldn’t be sold to anyone.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: