4 ms·
I have to object against reusing the 'data' var. Make up a new name for each assignment in particular when types and data structures change (like the last step
by 3np 1y ago
I have to object against reusing the 'data' var. Make up a new name for each assignment in particular when types and data structures change (like the last step is switching from strings to ints).
Other than that I think both styles are fine.
- hiq 1y agoI agree with this comment: https://news.ycombinator.com/item?id=43759814 https://news.ycombinator.com/item?id=43759814 that this pollutes current scope, which is especially bad if scoping is not that narrow (the case in Python where if-branches do not define their own scope, I don´t know for Ruby). Another problem of having different names for each step is that you can no longer quickly comment out a single step to try things out, which you can if you either have the pipeline or a single variable name.