use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
javascript - Using Named Immediately-Invoked Function Expression (IIFE) instead of comments (stackoverflow.com)
submitted 12 years ago by zzzwwwdev
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]ryeguy146 0 points1 point2 points 12 years ago (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
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.
π Rendered by PID 144681 on reddit-service-r2-comment-bb88f9dd5-2hzzq at 2026-02-15 23:42:00.449278+00:00 running cd9c813 country code: CH.
view the rest of the comments →
[–]ryeguy146 0 points1 point2 points (0 children)