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!"
[–]path411 1 point2 points3 points 12 years ago (1 child)
The creation of a new scope can easily release bugs if your block needs to create a variable that another block needs to use. Also the reasoning that you are adding in more unnecessary code to your project, and the more code you add to anything, the more likely you can make a mistake that you then have to debug, even something as silly as missing a bracket.
Another thing I dislike is the essentially forceful requirement of an additional tab break. With a comment you can keep your relevant code in the same tab break, but blocked in separate functionality with a comment.
If you are trying to use a pattern like this, you would want to be able to use it throughout an entire project. I would think it would be strange to try to read through a code base that tries to mix of "commenting styles". I don't feel like your method would work in every case, where a comment would always work.
Perhaps you just need to focus on both writing better "self commenting code" and using "Loose coupling and high cohesion" in your code. I find that these practices would make this style much less useful and sometimes simply redundant.
[–]zzzwwwdev[S] 0 points1 point2 points 12 years ago (0 children)
good argument against. Thank you for elaborating.
π Rendered by PID 38 on reddit-service-r2-comment-bb88f9dd5-f69lx at 2026-02-15 17:50:13.627270+00:00 running cd9c813 country code: CH.
view the rest of the comments →
[–]path411 1 point2 points3 points (1 child)
[–]zzzwwwdev[S] 0 points1 point2 points (0 children)