4 ms·
This article seems to rail against functional programming for no appreciable reason. For one, the entire diatribe about functional purity and elegance is a stra
by tikhonj 15y ago
This article seems to rail against functional programming for no appreciable reason. For one, the entire diatribe about functional purity and elegance is a straw man: nobody claims that all purely functional code is automatically elegant. If anything, Haskellers make fun of inelegant purely functional code; for example, there is a command to generate point-free code nicknamed "pointless" because everybody agrees its output is ugly.
It also complains about short examples. The reason these examples tend to be small is because they're examples. If somebody posted a couple thousand lines of Haskell, nobody except Haskell programmers (and not even most of those) would read it, however elegant it may be. That doesn't mean longer elegant programs don't exist!
Now, it is, of course, true that inelegant code can lead to a beautiful product. It would be silly to claim otherwise. But that is not optimal; just because it works, does not mean it couldn't be better.
Next the article claims that there is a "curious lack of concrete examples" of purely functional programs. This is patently untrue: there are plenty of great Haskell programs about on the internet. The canonical example is XMonad, which is particularly apt because it is short enough to read (< 3000 lines).
In the end he presents a false dichotomy: you can either have elegant code or focus on the product. Of course, the two are not mutually exclusive at all: writing elegant code can help you produce a more robust program that is easier to maintain.
- gaius 15y agoRead a few of the other articles on his site for context.
- batista 15y agoNext the article claims that there is a "curious lack of concrete examples" of purely functional programs. This is patently untrue: there are plenty of great Haskell programs about on the internet. The canonical example is XMonad, which is particularly apt because it is short enough to read (< 3000 lines). He probably means USEFUL examples, of what one is likely to build. No one will write an XMonad. And XMonad is not a product -- something users want and that solves a business need. It's a language's innards, a developer tool at the most basic.
- pnathan 15y agoXMonad is a tiling window manager. It is written in Haskell.
- batista 15y agoOh, my bad, was thinking he was referring to some the available built in monads in Haskell implementation. Still, the example is an obscure Window Manager? And a tiling one, at that? Not the premier example of what he asks for, end user successful complicated software that has had to mature and deal with lots of real world corner cases, bugs etc.
- tikhonj 15y agoIf anything, a tiling window manager is exactly that sort of software: it has to please a wide variety of extremely picky power users and has to deal with tons of corner cases--weird programs (the GIMP), weird layouts, multiple monitors, panels...etc. On top of that, it has to work well with an absurd amount of customization. The fact that XMonad manages all this with so little code is particularly impressive.