3 ms·
You are largely correct about Ruby I think, although it's broader than that. Functional programming is popular because mutable data is a major cause of bugs, i
by aneth 16y ago
You are largely correct about Ruby I think, although it's broader than that. Functional programming is popular because mutable data is a major cause of bugs, is hard to debug, and creates unnecessary complication. In Ruby, all data INCLUDING the executable code itself, is mutable and regularly mutated. Integration and extension, including throughout the Rails codebase, is accomplished by changing object prototypes. This means that you can never rely on an object behaving in a certain way or following a certain code path, and your code or any third party code can easily be broken by a single line of rouge code from a library - and yes this happens often.
Regarding Scala, I don't think type inference means that you stop thinking about types, particularly when writing in a functional style where the returned value is the only thing that matters.
- samstokes 16y agoRegarding Scala, I don't think type inference means that you stop thinking about types I didn't mean to imply that it did - quite the opposite in fact (that even if you didn't write the type, you'd still be encouraged to think about it, because of the compile-time checking).