by jim-jim-jim · 6y ago · 0 comments
1. The focus on verbs can make things clearer.
2. Under ideal circumstances, it's no more complex than Unix pipes.
But I'm still not 100% convinced it makes for more readable code. Sometimes I still need variable names for documentation purposes. This isn't so bad in Haskell, since the type signature can make the intention known, but something like J...
BUT! I tried to cheat a little bit to make things more readable. Take this example from the min front page, which showcases its concatenative style:
. ls-r
(mtime now 3600 - >)
filter
Can you guess what it does? You might, but what about this: . ls-r :files
((mtime > (now - 3600)) ><) =changed-in-last-hour
@files #changed-in-last-hour filter
Now ok, I went insane with sigils and weird operators but:
- creating variables helps
- using infix notation via the infix-dequote (><) operator makes expressions much more readableWhy would I use this rather than a traditional language? It helps reasoning in terms of point-free function composition and in some case it is faster to work with, i.e. processing rules, pipelines, task sequences etc.
A little red-faced here but I don't know if you're saying it's good or bad (suspect former but not sure). Matters as upon it depends whether I read the article or not, so... help me out? :)