Vernice inherited a legacy web app. By "legacy" in this case, we mean "lots of jQuery." jQuery everywhere. Nested callbacks of HTTP requests, no separation of concerns at all, just an entire blob of spaghetti code that was left out on the counter and is now stuck together as a big blob of sauceless starch. And as for documentation? There isn't any. No technical documentation. No comments. The code didn't even pretend to be self-documenting.

For the past few months, Vernice has been tasked with adding features. This generally meant that she'd find the code she thought was responsible for that section of the app, change something, see nothing happen, realize she was looking at the wrong module, try that three more times, finally find the actual code that governed that behavior, but as it turns out it had downstream dependents which broke.

Adding a single textbox to a form was a week long process.

So imagine Vernice's joy, when she opened a file and saw neat, cleanly formatted code, a compact function, and her text editor showed her the telltale color of comments. There were comments! Had she finally found the "good" part of the application?

Then she read the code.

<script> $(function() { $('.notification-exp').bind('click', function() { var confirmation = confirm( 'Confirm expiration?' ); // confirm if(confirmation) return true; // don't confirm else return false; }); }); </script>

Finding this, after all of her struggles, Vernice writes: "I found this small snippet of self-documenting yet excessively documented code, I had strong feelings about this oasis and had to submit it."

[Advertisement] Ensure your software is built only once and then deployed consistently across environments, by packaging your applications and components. Learn how today!