3 ms·
Fwiw in the final iteration I would still place each clause on a seperate line aligned by their leading '.' because I find it much easier to scan.
by abstractspoon 1y ago
Fwiw in the final iteration I would still place each clause on a seperate line aligned by their leading '.' because I find it much easier to scan.
- sieep 1y agoAgreed. That's how I would write it in a professional codebase. I added it to show the transformation from separate functions -> LINQ one-liner. Cheers!
- Etheryte 1y agoHaving things on one line is not an upside. Just think of all the Bash one-liners that are write once edit never. Doubly so in what's essentially a tutorial.
- sieep 1y agoMy intention wasn’t to promote one-liners as a best practice, but to illustrate how declarative style can evolve from imperative code. In production, I agree that clarity should come first.