Hacker News new | past | comments | ask | show | jobs | submit login

The nice thing of functional languages is the establishment of invariants. A large part of that lies in purity / isolated side-effects. However, much of it comes from the type system.

When ported to 'imperative' languages, those factors from the type system help establish invariant given that people don't use all the footguns. Whilst it is sad there are still footguns that can ruin your invariants, getting better types helps you move away from the footguns. Moreover, it is much harder to export purity to different languages than it is to export good type systems.

And really, the good thing that is being taken over is 'make it easier to reason about correctness through invariants'.




Functional languages don't establish invariants, invariants is an abstract math concept and math way of thinking. Side-effects, on the other hand, have an important place in programming and CS.


If you can't make hordes of side-effects sit up and beg, in a large, complicated program, you can't call yourself a computer scientist or developer.


The functional notation really helps to establish a variant. In fact, most proofs of correctness for imperative programs essentially consider e.g. the body of a for loop to be a function.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: