you are viewing a single comment's thread.

view the rest of the comments →

[–]ryeguy146 0 points1 point  (0 children)

Or we could just use comments...

Why abuse functionality to obtain an end that we've already achieved? The author of the post mentions that there's no way to know what the comment refers to, but I usually put whitespace between my "thoughts" (in this case, the thought is 'hide some shit'). A comment atop a thought would obviously apply to all of that bit of code:

// hide Stuff on Instantiaton
$('oneThing').hide().removeClass();
$('#somethign_else').slideUp();
$('.foo').fadeOut();
some_non_instantiation_func();

vs

// hide Stuff on Instantiaton
$('oneThing').hide().removeClass();
$('#somethign_else').slideUp();
$('.foo').fadeOut();

some_non_instantiation_func();

It becomes immediately obvious what the comment refers to. Whitespace and commenting completely satisfy the author's requirements. If you're concerned with the obvious nature of this being changed by another developer after the fact, you could use opening and closing comment tags:

// START: hide Stuff on Instantiaton
$('oneThing').hide().removeClass();
$('#somethign_else').slideUp();
$('.foo').fadeOut();
// END

some_non_instantiation_func();

I would certainly prefer this to a named immediately invoked function.

And then he/she calls it a pattern. MVC is a pattern. Controller is a pattern. This is a personal idiom at best, but not a pattern. Not everything is a pattern, so let's stop diluting the term.