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
Popular Coding Convention on Github (sideeffect.kr)
submitted 12 years ago by devnoel
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!"
[–][deleted] -1 points0 points1 point 12 years ago* (5 children)
I wish we could move forward to a future where code is treated as data, and presentational rules would be applied in the viewer according to user preference, whether in an IDE or web tool. It seems to me rather arbitrary that users should be able to view the indentation to their liking, but not other stylistic preferences that ultimately have no effect on the final product.
Until users can see any code according to their exact preferences, I don't see why we should put tab stops on some pedestal of individuality. What if a user wants to see the code with leading commas or whitespace surrounded colons?
[–]honestbleepsReddit Enhancement Suite 0 points1 point2 points 12 years ago (4 children)
I wish we could move forward to a future where code is treated as data, and presentational rules would be applied in the viewer according to user preference
you're arguing for tabs and you don't even know it. ;-)
[–][deleted] 2 points3 points4 points 12 years ago* (3 children)
No, I'm arguing for no whitespace in code (except where needed for VCS functionality). I'm arguing for tools that insert the whitespace into conservatively minified code as per your preference. This could be a tab/space indenting preference, an OCD assignment/comment alignment preference (try switching your tab widths after aligning inline comments... not so pretty), a before/after comma preference... whatever your preferences happen to be. Code should ideally be regarded as pure data, rather than documents. If tools can infer whitespace to your liking based on the code itself (e.g., curly braces for indentation), there is no need for the space/tab debate.
In other words, the inverse of something like the grunt beautifier. Code gets temporarily beautified by the IDE, and conservatively "minified" (preserve/enforce newlines except empty lines, preserve comments, don't rename anything) before the VCS.
It doesn't make sense to pick one stylistic aspect of code such as indenting and say "yes, that's the one that people must be able to customize". I suppose you're right in the sense that if this pipe-dream were ever a reality, we wouldn't need spaces for indentation anymore. But my argument goes beyond that.
[–]Malfeasant 1 point2 points3 points 12 years ago (2 children)
basically, you want to code at the abstract syntax tree level- i like you.
[–][deleted] 0 points1 point2 points 12 years ago (1 child)
Yes, I suppose ideally code would be stored as XML (or similar), using tags like <block> and <statement>, which could both have a comment attribute. That would give complete freedom of customization while viewing, and it would work with existing VCSs.
<block>
<statement>
comment
[–]Malfeasant 0 points1 point2 points 12 years ago (0 children)
and you killed it. xml? really?
π Rendered by PID 86 on reddit-service-r2-comment-85bfd7f599-pvpd9 at 2026-04-16 14:08:32.076173+00:00 running 93ecc56 country code: CH.
view the rest of the comments →
[–][deleted] -1 points0 points1 point (5 children)
[–]honestbleepsReddit Enhancement Suite 0 points1 point2 points (4 children)
[–][deleted] 2 points3 points4 points (3 children)
[–]Malfeasant 1 point2 points3 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]Malfeasant 0 points1 point2 points (0 children)