News for hackers. Stuff that matters.
Re:Functional Programming using JavaScript by facorreia on Monday November 24, 2014 @12:40PM (#8653497)
Bravo for promoting functional programming and showing how it can be done in JavaScript. One issue concerns me, though: using strings to reference attributes. This makes static checking tools much less useful and can lead to difficult to find errors due to refactoring and typos.
Re:Functional Programming using JavaScript by CrossEye on Monday November 24, 2014 @02:10PM (#8654061)
That, I think, is working with the grain in Javascript. It's extremely difficult to do static checking in the language in any case, because in the language `foo.bar` is just syntactic sugar for `foo['bar']`. A FP approach in JS is by its very nature going to be different from one in something more strongly typed like Haskell; this is actually one of the easier differences to swallow.
Re:Functional Programming using JavaScript by blablabla123 on Monday November 24, 2014 @12:47PM (#8653533)
Promoting FP using SQL as an example for encoding business logic doesn't look to me like a nice example...
Re:Functional Programming using JavaScript by CrossEye on Monday November 24, 2014 @01:38PM (#8653868)
The idea was just to show that, contrary to many people's expectations, OOP is not the only widely used paradigm in business programming.