No code review? I'll make you start having them!

Posted 14 June 2012 - 09:17 PM

So, we all know that bad developers come up with really terrible/laughable solutions. After seeing enough in my current job to fill this entire forum while pushing for code review and getting denied, I decided to take matters in my own hands. If they can come up with helmet wearing unreadables without trying, surely a better engineer can design something completely impossible to maintain.

The basics of it were this. Django Template (almost any templating language with inheritance will work). The first is a base template, several hundred lines long, and within is a neat little block like:

Then there is the template that inherits from the base, also several hundred lines long. It gets to a point like:

<script type="text/javascript>
//this function does stuff
//because i like to describe functions in english
//because i write so terrible, name my variables so poorly, have no sense of data structures
//that you cannot figure out wtf my original task was
//there's blocks of code here that i comment out as well
//because i'm too scared to press the delete button out of fear that i might need to
//copy paste {% block buttonoverride %}javascript_function_that_actually_executes_LOL_gl_finding_this(){%endblock%}
//some of this old code that's commented out. I mean, most people ignore this stuff
//or even worse delete these without thinking. Because why would you, it's a comment
//who would ever put functional code inside a comment, is that even possible? Oh wait..
function javascript_resumes(){
var do_more = "mind_numbing_stuff";
var loopvar = 0
while(loopvar < 1)
console.out.log('LOL You'll never find the problem');
}
</script>

Now, this post completely gives away the fact that I've hidden functional code inside a comment. However, imagine that instead of a bunch of sarcastic code it's actual business logic that conforms to the rest of the way the terribly written project works. Now imagine a low level "experienced" developer who commits the sins you see on this forum try to debug a minor problem with that function.