DEV Community

Discussion on: 😱 Spooktober : Whats your most horrifying dev-bug?

Collapse
 
kayis profile image
K

Had to maintain a legacy PHP project.

One file was 7000 LoC and had one class that was used all over the code-base.

This application was basically a bad PHP version of GWT. So all it did was creating hundreds of lines of JavaScript code on the server and sending them to the browser on every click, all neatly nested with with().

The debugger would crash if I set a breakpoint in the big class and the client code would change every click.

As you can imagine, there were multiple bugs in this code-base and I don't really know how I fixed it in the course of two years, but somehow it was stable at the end.

Collapse
 
picocreator profile image
Eugene Cheah

Getting it stable is one thing, how fast could you get it to respond with all that bloat .... on every click?

Collapse
 
kayis profile image
K

I don't know why, but performance was okay-ish.

Probably because most logic was handled already in PHP and it was much, but simple, JavaScript.

Thread Thread
 
picocreator profile image
Eugene Cheah • Edited

That itself is a horrifying miracle - know the original programmers who did the implementation?

Had similar experiences with several thousand of lines of PHP code, by multiple people, with many easy to miss performance hits (at its time), that took forever to refactor out.

And by refactor, it meant rewrite in a another language XD