3 ms·
I've heard and read about this time and again over the years, but am yet to find a blog post -- including this one -- or video that take an existing set of code
by justboxing 9y ago
I've heard and read about this time and again over the years, but am yet to find a blog post -- including this one -- or video that take an existing set of code snippets that is un-necessarily complex, and then refactored / re-written that code to be dumb code that performs similarly but is easier for any rookie to understand and maintain.
Can anyone point me to real examples for C# or Java?
- ssivark 9y agoI haven't programmed in C# or Jave, but I was recently looking into expository literature on why functional programming helps write more modular code [1]. I found the following Haskell-based example to be really enlightening: http://yannesposito.com/Scratch/en/blog/Haskell-the-Hard-Way/#functional-style http://yannesposito.com/Scratch/en/blog/Haskell-the-Hard-Way... I think it's okay to skim over the Haskell specific parts; what I really liked how the end result (version 10 of the program) is nicely composed out of orthogonal pieces, compared to version 1, which is a monolithic blob, while "simple". So, if you want to solve a related but different problem, you can reuse everything you've written instead of duplicating code. So any bugfixes/improvements to one part can trivially be propagated to all other use cases. [1]: https://blog.acolyer.org/2016/09/14/why-functional-programming-matters/ https://blog.acolyer.org/2016/09/14/why-functional-programmi...
- pdimitar 9y agoMartin Fowler -- Refactoring. Best software practices book I've ever read, even though I don't use Java for a while now. It's FULL of practical examples. Most of the book is examples, and it's not a small one.