Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on 3.5 Years, 500k Lines of Go. Parent comment
HTML:
<button class="does-stuff" id="foo">Foo</button> <button class="does-stuff" id="bar">Bar</button> <!-- etc -->
var handlers = { fooClicked: function() { /* stuff */ }, barClicked: function() { /* stuff */ }, /* etc */ }; $('.does-stuff').each(function() { $(this).click(handlers[this.id + "Clicked"]); });
There are no comments on this comment yet.
HTML:
JS: 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.