News for hackers. Stuff that matters.
Re:3.5 Years, 500k Lines of Go by taco_emoji on Friday March 24, 2017 @12:50PM (#13950261)
I really appreciate this definition of "magical"... reminds me of some code I was reviewing that was something like this:

HTML:

    <button class="does-stuff" id="foo">Foo</button>
    <button class="does-stuff" id="bar">Bar</button>
    <!-- etc -->
JS:

    var handlers = {
        fooClicked: function() { /* stuff */ },
        barClicked: function() { /* stuff */ },
        /* etc */
    };

    $('.does-stuff').each(function() {
        $(this).click(handlers[this.id + "Clicked"]);
    });
And like... OK, that's clever, but when I'm debugging the fooClicked() method 4 months from now, I can't just do a Find All for "fooClicked" and track down where it's being called from.

There are no comments on this comment yet.