[LRUG] A snippet of code that some may find entertaining

Adam Cryer ad.mat.cryer at gmail.com
Fri Dec 22 10:26:38 PST 2017


Hi,

I understand the apprehension sharing bad code but I think it's fine to
highlight it when it's annonimised.  Especially considering as you said
they were high end consultants.   Made my crimbo.

Merry Christmas rubbers

Ad

On 20 Dec 2017 23:15, "Patrick Gleeson" <patrick.c.gleeson at gmail.com> wrote:

> As it's the season of giving, I thought I'd share with you one of the most
> fascinating pieces of code I've ever had the pleasure to inherit, back when
> I was working with an entrepreneur who had outsourced his webapp MVP to an
> agency.
>
> If you've ever worked with Mongoid you'll know that Mongoid::Document#all
> is, of course, widely known to be unperformant and buggy, and that any
> serious developer will write their own implementation as step one of
> building any sort of model layer for their application. This particular
> example demonstrates admirable innovation with respect to naming
> conventions, use of instance variables, `for` loops and method arguments.
> Sadly, the identity of the original author of these lines is lost in the
> mists of time (as the codebase sensibly eschewed 'version control' in
> favour of 'having multiple copies of each file and appending `__1` to the
> end of their names to mark older versions'), but I suspect they were the
> same person who took the time-saving step of hard-coding the production
> database credentials into both the production and development sections of
> `mongoid.yml`, so that there was no need to set up a local database.
>
> https://gist.github.com/patrick-gleeson/2932c2b2eb8418e1cee8c25a86d52273
>
> However much the agency in question charged the entrepreneur in question
> to write the codebase in question, I'm sure I've more than received value
> for money from the entertainment I have experienced by reading it.
>
> Merry Codemas, everybody!
>
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> Archives: http://lists.lrug.org/pipermail/chat-lrug.org
> Manage your subscription: http://lists.lrug.org/options.cgi/chat-lrug.org
> List info: http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20171222/a1d15210/attachment-0002.html>


More information about the Chat mailing list