Get the latest tech news

Functional Programming Self-Affirmations


Dmitrii Kovanikov writes posts about enterprise software development and functional programming, both entertaining and serious. I never used a functional programming language (such as Haskell or OCaml) at work, but several ideas from functional programming have become popular in mainstream general-purpose programming languages such as Swift (which I mostly write).

Parse, don’t validate Make illegal states unrepresentable Errors as values Functional core, imperative shell Smart constructor The latter makes an excellent point why people do not often go all the way — it often requires flipping assumptions about a system, and also not wanting to bother defining a type (for example) for a container that can hold either one or three items: While they are practiced more there, and functional programming languages generally have strong type systems that help implement these constraints, we “regular” developers can use most of these concepts when writing our mostly imperative code to make it simpler.

Get the Android app

Or read this on Hacker News