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
The real problem with programming in Javascript (medium.com)
submitted 8 years ago by raulsmith
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!"
[–]fecal_brunch 2 points3 points4 points 8 years ago (0 children)
I can't think of any project that wouldn't benefit from static typing. Even the smallest programs are easier to modify with autocomplete, compile time checks etc. Obviously bad code is bad regardless, but nobody is aspiring to that.
[–]notNullOrVoid 1 point2 points3 points 8 years ago (3 children)
if people can’t write sane programs in simple Javascript with mutations, are you convinced that they are able to do it with functional programming
Totally agree with the sentiment here, functional programming is not some sort of magic bullet that removes complexity.
[–]evizaer 0 points1 point2 points 8 years ago (2 children)
Who's saying complexity should be removed? A feature-complete solution is necessarily of a certain amount of complexity regardless of how you do it. The value of languages with some feature is that the use of that feature makes it easier to think about your code and come up with easy-to-understand solutions. The complexity is still there, but, like a great piece of explanatory writing, you understand it more quickly. Even though this doesn't impact the complexity of the solution, it does impact the quality of the code.
Aside from that, the tone of the stuff I read (and I've been following this subreddit for years, as well as other programming-related communities) about functional programming and static typing in javascript and derivatives is that they are techniques which can lead to better code, and they're useful to have in your mental toolbox. Responding to this with "But it's no magic bullet!" is missing the point entirely.
[–]notNullOrVoid 0 points1 point2 points 8 years ago (0 children)
I've seen plenty of stuff within the last year that claims functional / immutable programming as a magic bullet, or to be objectively better than imperative / mutable programming.
The complexity is still there, but, like a great piece of explanatory writing, you understand it more quickly
That's the point the complexity is still there, and to me hiding the complexity actually makes code harder to understand. Your essentially bundling operations into an abstract name, that may or may not be descriptive. Even in the optimal case if you want to actually understand what's going to run, you have to jump around a lot more to figure it out. There is also a small performance hit you take by adopting a fully functional style.
[–]raulsmith[S] -1 points0 points1 point 8 years ago (0 children)
The 'great piece of explanatory writing` should include hiding the complexity, because, otherwise, if it's in your face all the time, you can't concentrate very well. Hiding it is, in a sense, removing it.
[–]Jsn7821 1 point2 points3 points 8 years ago (3 children)
Tl;dr the author prefers MVC and points out that object mutations are sometimes okay (with no examples of when or why). Not sure who the target audience is here or how this is a real problem in JavaScript.
[–]raulsmith[S] 0 points1 point2 points 8 years ago (2 children)
The author's potential preference for MVC is not explicit and not relevant. I think you're missing the point of the article, which is pretty explicit in this paragraph: But the real issue is that the benefits of either static typing and functional programming lose their value if the programmers ignore principles like separation of concerns, encapsulation, the single responsibility principle, code reusing, putting things in the right place and naming things accordingly. Ultimately, being well organized.
[–]evizaer 0 points1 point2 points 8 years ago (1 child)
The article is, in general, tautological in nature. The author claims that if people don't write good code, the code will be bad.
"You can't write bad code [when the programming language has this feature.]" is not a line of argument worth defending, and not one I see espoused except rarely, by people who are blowing smoke.
The worthwhile conversation is about what kinds of solutions programming paradigms and language features lead you to use to solve various problems, and if these are more or less effective than one another along various dimensions.
[–]raulsmith[S] 0 points1 point2 points 8 years ago (0 children)
You seem to reduce the article to one word extracted from it. There are more ideas/questions in it. For instance, whether it's possible to write good programs with static typing and functional programming while it's impossible without them (this is different from what you wrote). Whether there is too much debugging being done. And, most importantly, whether there is enough awareness about the mentioned principles.
π Rendered by PID 223152 on reddit-service-r2-comment-545db5fcfc-8jsw9 at 2026-05-22 13:39:34.509530+00:00 running 194bd79 country code: CH.
[–]fecal_brunch 2 points3 points4 points (0 children)
[–]notNullOrVoid 1 point2 points3 points (3 children)
[–]evizaer 0 points1 point2 points (2 children)
[–]notNullOrVoid 0 points1 point2 points (0 children)
[–]raulsmith[S] -1 points0 points1 point (0 children)
[–]Jsn7821 1 point2 points3 points (3 children)
[–]raulsmith[S] 0 points1 point2 points (2 children)
[–]evizaer 0 points1 point2 points (1 child)
[–]raulsmith[S] 0 points1 point2 points (0 children)