Better HN
topnewbestaskshowjobs
Log inSign up

markusschlegel

22 karma · joined Sep 24, 2017 (9y ago) · 8 submissions

Submissions

1.

Why We're Teaching Programming Wrong: A Haskell Perspective [video](youtube.com ↗)

3 points · by markusschlegel · 3mo ago · discuss

comment 11mo ago · link · parent

Building websites seems straightforward. You pick a static site generator and start writing content. However, these websites quickly grow into full-blown software projects. Suddenly, your SSG – its rigid template system, scattered configuration and ad-hoc Markdown – is holding you back for its lack of proper abstraction mechanisms.

In this talk, we start fresh. Our design approach is driven by one simple insight: Static websites are just functions mapping URLs to HTML. This marks the beginning of our journey in developing our own SSG. In the end we arrive at a bespoke domain-specific language in OCaml.

While this exploration may sound theoretical – or even playful – it has substantial practical implications. By treating our website as a function, we can embrace robust engineering practices: clearly separating domain logic from presentation, following the single-responsibility principle, reducing coupling, and ensuring cohesion.

3.

Website as a Function from URL to HTML [video](youtube.com ↗)

2 points · by markusschlegel · 11mo ago · 2 comments

comment 1y ago · link · parent

As an argument in favor of pure functions, functional programmers often cite better testability: pure functions require no complicated test setup or mocks, are deterministic, parallelizable, etc. In tendency, this is certainly correct. Pure functions are often better suited for testing than their impure counterparts. However, this connection is not a neccessary implication in either direction: There are pure functions that are hard to test, and there are impure functions that are easy to test. Thus purity itself cannot be the substance that ensures a piece of program is properly testable. But then what is this substance?

5.

The Testability of Pure Functions(funktionale-programmierung.de ↗)

2 points · by markusschlegel · 1y ago · 1 comment

6.

Data Modeling with Sums and Products(funktionale-programmierung.de ↗)

54 points · by markusschlegel · 2y ago · 20 comments