News for hackers. Stuff that matters.
Re:‘This’ in JavaScript by christophilus on Thursday August 03, 2017 @05:51AM (#14918228)
I almost never use "this" in my JS code. I find that when you use a functional style of development, you largely avoid the "this" pitfall.
Re:‘This’ in JavaScript by mattmanser on Thursday August 03, 2017 @08:27AM (#14918916)
That debate is long over.

If there's anything that a decade of functional style being "the next big thing" has taught us, functional style is not "the next big thing" and most programmers don't work well in it.

Re:‘This’ in JavaScript by disantlor on Thursday August 03, 2017 @09:57AM (#14919584)
i strongly disagree with this. half of my posting history on here is evangelizing FRP in javascript (in my case via bacon.js).

it has dramatically reduced the amount of time i spend on these and many other sorts of problems. honestly it makes programming way more fun. maybe haskell is a bit extreme for most situations but the concepts are not.

Re:‘This’ in JavaScript by mattmanser on Thursday August 03, 2017 @11:31AM (#14920432)
While you may love functional, and I'm not saying you shouldn't, I think you're strongly disagreeing with the statement you think I'm saying, "functional is bad", rather than the actual statement I'm making which is "functional programming's had many chances to become a mainstream language and it never takes off (outside a few specialities)".

What evidence do you have that functional is taking off? Since this board was around, every couple of years there's been a flurry of 3 months when a chunk of the community bangs on about functional programming.

First it was Lisp, then Erlang, then Haskell, then F#, then Scheme. I might have got the order wrong.

And it never, ever, ever takes off because while 10% of programmers find functional truly brilliant, the other 90% can't work with it.

For context, in that time Ruby (via Rails), Python (via Django and use in Science), javascript server-side (Node.js), Go, Swift, Rust and now possibly Kotlin have all taken off. Plus various other techs like NoSQL.

Re:‘This’ in JavaScript by christophilus on Saturday August 05, 2017 @02:40AM (#14934503)
Hm. I guess it depends on your definition of mainstream.

In the front end space, functional programming is taking off, I think. Could be wrong, but React + Redux + immutablejs is a popular and very functional approach to UI.

Elixir appears to be on the same trajectory as Rails in it's early days. Anectodally, I know a lot of Rails devs and shops that are now primarily Elixir.

Most mainstream languages have adopted functional styles and best practices. Higher order functions, a general acknowledgement of the benefits of immutability, etc.

Fp may not be mainstream, whatever that means, but it's more popular than I can ever remember it being.

Re:‘This’ in JavaScript by zhte415 on Thursday August 03, 2017 @11:12AM (#14920258)
This could depend on industry. In finance, functional is not the next big thing, but required. Needs context.