Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ask HN: Just Finished Stroustrup's 'Practice and Principles'. What Next?
6 points by boppo1 on Feb 6, 2023 | hide | past | favorite | 6 comments
I'm a self-taught programmer and I've done lots of messing around in Python, but I want to bridge the gap between what I know and what I would have learned in school. There's lots of 'everyday' stuff that was tripping me up before this book ("what's a constructor?"). I've found Principles super helpful in moving me from a place where I'm writing python recipes in jupyter to thinking about how to construct and write larger programs.

I've taken a crack at SICP, but found it brilliant but a bit more 'high-minded', like trying to learn Beethoven before I can play twinkle twinkle little star. Also, I already have SICP on my shelf, but that seems more like a good reference than a 'read-it-straight-through' kind of book.

So what would you recommend next?



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/21879368

- https://youtu.be/8JKjvY4etTY

- More: https://project-awesome.org/stoeffel/awesome-fp-js

---

How to Design Programs is also a good book: https://htdp.org/


Thanks for the list! Is HTDP functional programming?


Well, 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,...


Without reguard to fustration/curiosity/knowlege/time ratio:

1) coding practice challenges

   * use different languages / paradigms within same language)
2) check out esoteric languages (try doing stuff in #1 in esoteric language)

   * http://esoteric.codes/

   * http://www.dangermouse.net/esoteric/
3) Research problems language intended to solve / language paradigm. try solving in language/paradigm that supports the problem vs. one that does not. (aka apl vs. mumps)

   * pragmatic programmers has a book series that looks at languages & example problems a given language was inteded to help with [1]
4) Check out old/new language / application change logs [2]

   * figure out how to use macros/scripting with an editor
5) Take a look at a decent size program. Figure out how to impliment that from the command line using the ~200 'do one thing well' unix commands.

6) Programming topics of autonoma & of programming grammars tends to be heavily dependent upon theory. Using 1 through 5 above to impliment autonoma & grammars does help with things like [3].

  * On simplier side, comparing 'older version' of a language book with current version of language does give hints.

after 1-6, should have a good idea of what type of documentation / coding standards / tools / levels of abstraction want to have/see for a projects source code/deliverable. :-)

[1] : http://github.com/Blackgu/ebooks/blob/master/ebooks/2012-2-1...

[2] : http://peps.python.org

[3] http://medium.com/codex/say-goodbye-to-loops-in-python-and-w...


Ah, guess could just stick within the common lisp REPL libraries as source material for learning the use case/implimentation a given library macro/command.


Either this [0] or build something that scratches an itch.

[0] https://teachyourselfcs.com/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: