4 ms·
It's easier, but there are several considerations: - There's workarounds. Eg. in F# you can redefine the pipe operator in debug mode [0] so it can be stepped i
by piaste 5y ago
It's easier, but there are several considerations:
- There's workarounds. Eg. in F# you can redefine the pipe operator in debug mode [0] so it can be stepped into and inspected.
- I think some IDE plugins are also working on allowing pipeline contents to be automatically inspected.
- And of course, there's the good old tee operator for printf debugging. FP style rarely mutates variables, so a few print statements are just as good as a live object inspector.
As for why you actively wouldn't want to have those variables... much like comments, sometimes variable names add precious information and should be typed out, but sometimes they're just unnecessary noise, mental overhead, and scope pollution.
E.g. compare:
let suppliers = getSuppliers()
let sortedSuppliers = sortBy getSupplierPriority suppliers
let bestSupplier = first sortedSupplier
to:
let bestSupplier =
getSuppliers()
|> sortBy getSupplierPriority
|> first
[0] https://stackoverflow.com/a/4966892 https://stackoverflow.com/a/4966892