3 ms·
I think there is merit to the argument that if naming is one of the hard problems, programmers writing that code are having to do a lot of ‘naming’ and that is
by jameshart 4y ago
I think there is merit to the argument that if naming is one of the hard problems, programmers writing that code are having to do a lot of ‘naming’ and that is hard for them. The proposed pipe operation eliminates those names and lets the programmer just use %.
But these variables are rarely the kind of thing it’s hard to name, so it feels like a slightly disingenuous argument.
- 8note 4y agoNaming is hard because names are useful. Getting rid of the name moves the hard problem, rather than solve it
- kbp 4y agoUsually that effort should go toward naming functions rather than their results, though, and if the functions have good names, the results don't need them. In this example, `other_function` could have been named `get_user_data`, `new_function` could have been called `extract_user_details`, whatever. Once you have good function names, which you should generally be spending a lot more effort on than good local variable names, you won't find any value in adding variables like `var foo = get_foo()`.