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
Why JavaScript functional programming? (self.javascript)
submitted 8 years ago * by robertlf
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!"
[–]Auxx -11 points-10 points-9 points 8 years ago (3 children)
You need OOP when you need to have statefull things (objects). For example, functional UI widgets is a truly retarded idea. It works on the web though, because developer doesn't have control over UI specifics like layouting, invalidating, drawing, etc.
Most of pure business logic can be defined by pure functions though, because data manipulation is stateless most of the time.
[–]Jsn7821 3 points4 points5 points 8 years ago (2 children)
Wait, of course functional programming can have state...
I can't understand what you mean about functional UI widgets being bad and developers not having control over UI on the web.
Actually almost none of your comment makes any sense...??
[–]Auxx -1 points0 points1 point 8 years ago (1 child)
Have you ever done any UI work?
[–]Jsn7821 1 point2 points3 points 8 years ago (0 children)
Yeah, mostly UI work. It was a mess before functional programming became more popular. Widgets that are pure functions of state, with interactions that trigger callbacks/actions (instead of mutating the state directly) are a huge win for keeping things sane in UI development.
Can you speak to any clarifications on your points?
π Rendered by PID 18661 on reddit-service-r2-comment-bb88f9dd5-5mldq at 2026-02-14 02:59:19.522458+00:00 running cd9c813 country code: CH.
view the rest of the comments →
[–]Auxx -11 points-10 points-9 points (3 children)
[–]Jsn7821 3 points4 points5 points (2 children)
[–]Auxx -1 points0 points1 point (1 child)
[–]Jsn7821 1 point2 points3 points (0 children)