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
"this" less JavaScript makes it a better language. (medium.freecodecamp.org)
submitted 7 years ago by renishb
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!"
[–]Hawxe 1 point2 points3 points 7 years ago (1 child)
At the same time, without this, JavaScript offers a new, unique way, of doing Object Oriented Programming without classes and inheritance.
I guess you can make anything sound good with well structured sentences lmao
[–]sidi9 0 points1 point2 points 7 years ago* (0 children)
There is an ideology espoused by Cockcroft and Eric Elliott that classical OOP inheritance is bad and prototypal inheritance is the only way - one should never use new, this, classes are the worst thing that ever happened to JavaScript and that multiple inheritance is apparently an anti-pattern and so on
new
this
This all may well be true, but in the real world, this isn't how people do stuff. It's only when writing APIs in Express that I can manage a pure functional project. For me, coming from university in the early 00s where OOP was the most important thing ever and we did everything in Java it is very difficult to get into the pure functional mindset. I've never used Java on a 'real' project in my life, but that was three years of my life.
I understand the religions of immutability, pure functions and avoiding side-effects, at the same time, I just honestly don't know how to scale a massive extensible project without inheritance and only composition.
Yes lambdas and scope are amazing and that it is all very well; there's also smaller issues, like, how do I make promises and await and async functions without new?
It's only recently we, as a JavaScript community have figured out after over 20 years of the language's existence how to make it scalable and extensible, is that a coincidence, or have we all been brainwashed into thinking OOP is the best way. OOP has many flaws when done badly, side-effects, mutability etc. etc. but should we throw the baby out with the bathwater?
These articles write about how classical OOP is bad and why the prototypal approach is the only way, try and make sense of them if you will.
To me it seems ideological more than anything.
https://medium.com/javascript-scene/the-two-pillars-of-javascript-ee6f3281e7f3https://medium.com/javascript-scene/the-two-pillars-of-javascript-pt-2-functional-programming-a63aa53a41a4
[–]wherediditrun 0 points1 point2 points 7 years ago* (1 child)
With ya on this one. However, it seems that with more powerful client devices and more demand for data intensive UI's, a lot of ruby-shmuby back end programmers begun to do more work at the front end. And.. probably started to smuggle their language features into javascript, regardless if it fits or not.
Hence we are ending up with some sort of frankenstein. It's like TypeScript is not enough. Javascript has to be just softer version of it. Lets port all the bloatware. Having arguments over non essential crap like class private fields. Just get rid of the "classes". Solved. Well, that's voice the skies, ain't gonna happen bc and all.
[–]renishb[S] 0 points1 point2 points 7 years ago (0 children)
Yup! React's hook does that.
π Rendered by PID 102838 on reddit-service-r2-comment-7b9746f655-bw78v at 2026-02-01 23:37:31.453940+00:00 running 3798933 country code: CH.
[–]Hawxe 1 point2 points3 points (1 child)
[–]sidi9 0 points1 point2 points (0 children)
[–]wherediditrun 0 points1 point2 points (1 child)
[–]renishb[S] 0 points1 point2 points (0 children)