Category talk:JavaScript: Difference between revisions

changed paradigm distributions
No edit summary
(changed paradigm distributions)
Line 36:
::Lots and ''lots'' of programming languages support first class functions. If you put basically every language into the functional category it is going to become a basically meaningless word. So rather then making the word functional meaningless I set a bit of a higher standard. Functional languages should have immutable data structures and some good way to avoid side effects.
::JavaScript is one such language that lacks immutable data structures. Static typing allows you to limit what an object can mutate to. For example, with static typing you can prevent somebody from replacing a function with a number. Since JavaScript doesn't have immutability or static typing you can replace any value with any other value. To add fuel to the fire JavaScript puts everything in a global name-space so that anyone can overwrite things and cause a collision. Furthermore, all properties are late-bound. All these things compounded make JavaScript worse off in terms of side effects then any language I know of.
::Perhaps it shouldn't be a black and white thing that you are either functional or you are not. Perhaps it should be said that JavaScript is 9590% prototypal 8% procedural and 52% functional or something along those lines. Prototypal programming is a community practice for a reason. The language makes it hard to get away with anything else. –[[User:Jhuni|Jhuni]] 03:41, 1 January 2011 (UTC)
 
::: Well, ultimately the functional paradigm's been pretty successful, though the strict functional less so (precisely because so many problems are very coupled to their state). That's an indication of a reasonable degree of success for the paradigm. (We probably ought to take this part of the discussion somewhere more general.) For my money, the fact that authorities outside of RC say that JS is functional is sufficient evidence for me to admit its description as such here. –[[User:Dkf|Donal Fellows]] 10:56, 1 January 2011 (UTC)
Anonymous user