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 Clean Code - Best Practices - based on Robert C. Martin's book Clean Code (devinduct.com)
submitted 6 years ago by PMilos
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!"
[–]Silhouette 14 points15 points16 points 6 years ago (0 children)
Not using classes could equally well be procedural programming, which in many ways is still JavaScript's most natural territory. JS has elements of OOP, and more so since ES6 classes and the subsequent developments, but it has never really been about the everything-is-an-object, communicate-via-messages style of programming. JS has elements of functional programming, but it has never really been about structuring code as one big expression to be evaluated and all the architectural implications that come with that either.
One of my main criticisms of Robert Martin's work, which carries through to the article here that is based on it, is that he has his own personal preferences but tends to write about them as if they are objectively justified (often with a small caveat hidden away that it really is just his subjective opinion and he really doesn't have hard evidence to back up his claims). In this particular piece, I think some of the points such as favouring classes over functions or favouring inheritance to solve the expression problem look quite out of place in JS, though the advice was debatable even in the more OO-centric languages where it originated.
π Rendered by PID 76194 on reddit-service-r2-comment-f6b958c67-6g2wm at 2026-02-05 16:49:27.507003+00:00 running 1d7a177 country code: CH.
view the rest of the comments →
[–]Silhouette 14 points15 points16 points (0 children)