4 ms·
I architect my code in layers. Generally OO based then specifically functional based; I find that works best for me.
by rafaelvasco 7y ago
I architect my code in layers. Generally OO based then specifically functional based; I find that works best for me.
- IggleSniggle 7y agoYou should do whatever works for you! But, have you encountered the idea of "Functional core, imperative shell?" https://www.javiercasas.com/articles/functional-programming-patterns-functional-core-imperative-shell https://www.javiercasas.com/articles/functional-programming-...
- maximente 7y agoi think the original talk by Gary is basically perfect for this bc it shows the power of mixing FP and non-FP in an imperative but flexible language (ruby) it's... a little different in Haskell bc it basically makes you work in this paradigm already, so not a huge value add imo all that is to say, just watch the original talk: https://www.destroyallsoftware.com/talks/boundaries https://www.destroyallsoftware.com/talks/boundaries
- VHRanger 7y agoNot sure that everything should be "OO core". When I look at architecture, often some entire components can be viewed as a FP-style function. Adding the code to make it behave so is well worth it for the long term benefits. If you start out writing this module as a class you instantiate, it can make the whole component more stateful as it evolves -- classes naturally push towards more stateful code. Overall I think OO, FP and simple procedural programming should be at the disposal of everyone. Just that historically the last ~20 years of enterprise programming (with Java, C# and OO-heavy C++ code) have really outsized OO's influence compared to how often it's the right tool