Comment

Comment by ChrisRackauckas

Maybe you'd like str |> x->parse(Int,x) |> abs ?

>I like when the code reads like a sentece, it's just less mental overhead.

But the OOP version is further from a real sentence here. You're taking the absolute value of the string parsed as an integer, not "for the string grabbing the parser to apply the change to an integer to take the absolute value".

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton