Skip to content

Instantly share code, notes, and snippets.

In a multithreaded environment, the lack of understanding and the resulting problems are greatly amplified, almost to the point of panic if you are paying attention. Programming in a functional style makes the state presented to your code explicit, which makes it much easier to reason about, and, in a completely pure system, makes thread race conditions impossible. - John Carmack

OO makes code understandable by encapsulating moving parts. FP makes code understandable by minimizing moving parts. - Michael Feathers

Characteristics of functional programming (from dev perspective)

First-class functions are typical for functional programming languages, that means, they behave like data. There have to be functions that can accept functions as an argument or return 'em. Therefore, they are called higher-order functions. Pure functions always return the same result when given the same arguments and can not have a side effect. They are the reason that Haskell is called a pure functional languag

@wi7a1ian
wi7a1ian / oop-design-patterns.md
Last active February 1, 2024 18:06
Design patterns in object-oriented programming

Any fool can write code that a computer can understand. Good programmers write code that humans can understand. - Martin Fowler

Legend:

  • 🔌 promotes decoupled architecture
  • 🎓 synergy with SOLID principles (ocp, srp, dip...)
  • ▶️ runtime focused (i.e: promotes reconfiguration)
  • 🛠 compiletime focused
  • 📝 configurable once (during initialization, usually from a config file)
  • 🆕 creational pattern
  • ⛓ structural pattern