3 ms·
It depends on what your goals are... I haven't read 'Practice and Principles', but I assume it focuses mostly on the OOP programming paradigm. I'd explore the
by Leftium 4y ago
It depends on what your goals are...
I haven't read 'Practice and Principles', but I assume it focuses mostly on the OOP programming paradigm. I'd explore the functional programming paradigm. I say paradigm because it's possible to implement the functional paradigm in a traditionally imperative/OOP language like C++. (And it's possible to implement OOP/imperative paradigm in traditionally functional languages like Scheme/Lisp.) So learning functional concepts can improve your C++ programming, at both the "strategic" (program design) and "tactical" levels (implementation in code).
Quick summary of the promises of functional programming:
1. Program design/code that is easier to reason about/debug.
2. Programs that are shorter, yet more descriptive.
3. Programs that are more performant.
4. Programs that can be easily parallelized.
I believe SICP teaches functional concepts (via Scheme/Lisp), but recently I found more accessible/practical resources. (My university's intro to programming class used parts of SICP, mostly the beginning but FP didn't truly "click" until I found the resources below.)
Here is my short list of best introductions to practical FP, strategies and tactics:
- https://hw.leftium.com/#/item/18043058 https://hw.leftium.com/#/item/18043058
- https://hw.leftium.com/#/item/21879368 https://hw.leftium.com/#/item/21879368
- https://youtu.be/8JKjvY4etTY https://youtu.be/8JKjvY4etTY
- More: https://project-awesome.org/stoeffel/awesome-fp-js https://project-awesome.org/stoeffel/awesome-fp-js
---
How to Design Programs is also a good book: https://htdp.org/ https://htdp.org/
- boppo1 4y agoThanks for the list! Is HTDP functional programming?
- Leftium 4y agoWell, HtDP uses Racket, a flavor of Scheme/Lisp. So HtDP teaches with a functional language. But the contents seem to be about general program/algorithm design. (Like SICP, I started but never finished HtDP.) I don't think HtDP/SICP explicitly cover topics from my short list of best introductions to practical FP. For example they don't seem to cover "monads" and "functional composition," which are a big part of practical FP programming. "Monad" is a fancy mathematical term for a concept that allows you to write programs without worrying about exceptions/errors/IO cases until the very last moment. So you can keep your "happy" path code completely separate from the "sad" path code. Explained graphically: https://www.adit.io/posts/2013-04-17-functors,_applicatives,_and_monads_in_pictures.html https://www.adit.io/posts/2013-04-17-functors,_applicatives,...