Tacit programming
en.wikipedia.org
Tacit programming
1–10 of 95 posts
Re: Tacit programming
#2Re: Tacit programming
#3Re: Tacit programming
#4 quad a b c = let d = b * b - 4 * a * c in ((-b + sqrt d) / 2 * a, (-b - sqrt d) / 2 * a)
to ghci> import Control.Monad
ghci> quad = ap (ap . ((.) .) . ap (ap . (liftM2 (,) .) . flip (flip . ((*) .) . flip flip 2 . ((/) .) . (. sqrt) . (+) . negate)) (flip (flip . ((*) .) . flip flip 2 . ((/) .) . (. sqrt) . (-) . negate))) (flip ((.) . (-) . join (*)) . (*) . (4 *))
ghci> quad 1 3 (-4)
(1.0,-4.0)
[0] https://pointfree.io/Re: Tacit programming
#5For context, see this discussion: https://stackoverflow.com/questions/5671271/what-are-advanta...
Re: Tacit programming
#6Re: Tacit programming
#7I just hate reading the resulting code written by others. What information is expected to come in, and exactly what data passes from one step to the next, and in what position? Data type signatures only go so far.
Point-free means you have all that wiring in your head, without assistance from the notation.
Re: Tacit programming
#8Re: Tacit programming
#9If the intermediary result makes no sense, and only the function composition makes sense, I'll create a new well named function that does the chaining, even if it's single use.
This is literally the only way I've seen multi-year projects be maintainable, and anything else eventually breaks down into uninteligible code.
Writing code for other developers in the long-run is empathy for yourself, since you'll eventually forget all the context you once had.
Re: Tacit programming
#10I've never found this style readable unless with pipes (bash / elixir), where I love it. With any other syntax, I find it just adds mental overhead. Maybe because you have to read it backwards?