News for hackers. Stuff that matters.
Re:Software reuse is more like an organ transplant than snap... by mcv on Thursday June 25, 2020 @06:26AM (#23638984)
This is something that also works well in the nicer parts of javascript. Now nobody is ever going to accuse javascript of being a good functional language (disparage away), but at its core, you've pretty have arrays, maps, numbers, strings, booleans and functions. An Object is really just a map of key-value pairs where some values are functions. You can .map() an array of objects to an array of strings by feeding it a function that turns an object into a string. It's really nice to build those little blocks and cobble them together into something that accomplishes something more complex.
Re:Software reuse is more like an organ transplant than snap... by crimsonalucard5 on Thursday June 25, 2020 @03:56PM (#23644866)
I use to be pretty negative about JS, but typescript saves the day. The lego aspect of functional programming always becomes more evident when you have static types.
Re:Software reuse is more like an organ transplant than snap... by mcv on Friday June 26, 2020 @04:33AM (#23649922)
I've been getting more mixed about Typescript lately. Quite often, you end up with everything being `any`, and every time you write something, the compiler makes you hunt down the missing types.

But being able to specify interfaces for lambdas is absolutely fantastic. Something like: "this function takes an object and returns a function that can take either a string or a number and returns a number" is easy to do in Typescript, and useful for figuring out where the lego block fits.