Perhaps what programmers of modern JavaScript should be doing is going back and revisiting things that have been considered harmful practices for quite a while. Some work in extending prototypes would make a huge difference to the readability of lots of code - yet everyone is told this is a bad practice because extending DOM elements is problematic and people are lazy when it comes to global namespace pollution. Real…
Trine – A utility library for functional programming in JavaScript
31–40 of 116 posts
Re: Trine – A utility library for functional programming in JavaScript
#32Perhaps what programmers of modern JavaScript should be doing is going back and revisiting things that have been considered harmful practices for quite a while. Some work in extending prototypes would make a huge difference to the readability of lots of code - yet everyone is told this is a bad practice because extending DOM elements is problematic and people are lazy when it comes to global namespace pollution. Real…
Extending prototypes seems like a great idea, until other code running in the same environment does it, and you realise why people stopped doing that.
Re: Trine – A utility library for functional programming in JavaScript
#33... said the person not understanding the language semantics.
Passing arbitrary data as this is a terrible idea. It has to be an object and as such all primitives end up boxed.
Re: Trine – A utility library for functional programming in JavaScript
#34Earlier quoted context omitted.
Extending prototypes seems like a great idea, until other code running in the same environment does it, and you realise why people stopped doing that.
And also because it has prevented the language itself from standardizing some features, e.g. String.prototype.contains had to be renamed to includes because shipping it as contains would have broken sites that use mootools.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
Re: Trine – A utility library for functional programming in JavaScript
#35> They're both (subjectively) wrong: the natural place for data in JS is the this parameter. ... said the person not understanding the language semantics. Passing arbitrary data as this is a terrible idea. It has to be an object and as such all primitives end up boxed.
Re: Trine – A utility library for functional programming in JavaScript
#36Perhaps what programmers of modern JavaScript should be doing is going back and revisiting things that have been considered harmful practices for quite a while. Some work in extending prototypes would make a huge difference to the readability of lots of code - yet everyone is told this is a bad practice because extending DOM elements is problematic and people are lazy when it comes to global namespace pollution. Real…
Extending prototypes seems like a great idea, until other code running in the same environment does it, and you realise why people stopped doing that.
Re: Trine – A utility library for functional programming in JavaScript
#37You could always use FP languages for FP and leave JS be...
Well you can't really. If you want to write frontend apps, for example, you have to use JS. You could technically use some FPLang-to-JS compiler, but those suck more often than not. Also, I don't see how "let's not make a thing better just because it was not meant to work this way" is an argument. I'm sure there is a fallacy name for this, but consider some other examples: "You could always use fridges for cooling an…
Features like the function bind syntax are only possible with Babel or another transpiler. It will likely be years before you can use them practically without a transpiler in the browser.
A lot of the new syntax/macros/APIs/etc should just be built as modules or Babel plugins rather than core language features. Just because [Syntax X] improves a couple of code snippets doesn't mean it needs to be shipped with the next version of JavaScript.
Re: Trine – A utility library for functional programming in JavaScript
#38Perhaps what programmers of modern JavaScript should be doing is going back and revisiting things that have been considered harmful practices for quite a while. Some work in extending prototypes would make a huge difference to the readability of lots of code - yet everyone is told this is a bad practice because extending DOM elements is problematic and people are lazy when it comes to global namespace pollution. Real…
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
But if people are concerned about syntax mangling now, those features are going to make things 100 times crazier.
Re: Trine – A utility library for functional programming in JavaScript
#39About halfway through the README, after some examples of the new bind syntax, it says "But why stop there?" Actually, please can we stop here? Just for a bit? This continual, persistent mangling of JavaScript's syntax really is starting to hurt. It's one thing to have to keep on top of the new frameworks springing up every five minutes - which you can, for the most part, ignore for at least six months until they star…
Most of it is just superfluous fluff that doesn't actually do anything but change the syntax to something they perceive as fundamentally better, when it's just a matter of taste and fashion.
Re: Trine – A utility library for functional programming in JavaScript
#40IMHO it's usually something to be avoided, not championed...