▲ | hombre_fatal 7 days ago | |
Functions also pollute the scope the same way. And you don't want to be forced to extract a function that is never reused just to hide intermediate values; you should only have to extract a function when you want the abstraction. The pipeline transformation specifically lets you clean this up with functions at the scope of each ephemeral intermediate value. | ||
▲ | ckdot 7 days ago | parent | next [-] | |
You definitely want to extract code into functions, even if you don’t need to reuse it. Functions names are documentation. And you reduce the mental load from those who read the code. | ||
▲ | skoskie 7 days ago | parent | prev [-] | |
That’s why we have classes and namespaces. Anyone can write good or bad code. Avoiding new functionality and syntax won’t change that. |