
On Sun, Apr 19, 2020 at 11:54 AM Richard Damon <Richard@damon-family.org> wrote:
When it comes time to refactor—now we need to rename 'telephone' as 'home_phone' and add 'cell_phone'—finding all the locations to change is a PITA. If only we could grep 'person_record' globally, it would have been easy.
My personal thought on the case you are presenting, is that I would be tempted to grep for telephone, to change that because the change likely affects not just this given structure, but may also impact related structures which also assumed a single phone number.
Sure. But what I gave was a simple case. There are all kinds of complications like this person_record being passed around from call to call without actually accessing `.telephone` in a particular scope. Or doing something dynamic with the attributes/keys that won't show up in a `grep telephone`. Or the string telephone occurring lots of times in unrelated structures/objects. Or lots of other cases where lots of name changes makes refactoring more difficult. I mean, I've DONE it, and I'm sure you have as well. Clearly refactoring isn't impossible with different names across scopes... and this goal is one of several in picking names, not the single predominant one.
-- Richard Damon _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-leave@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/PFSCBT... Code of Conduct: http://python.org/psf/codeofconduct/
-- Keeping medicines from the bloodstreams of the sick; food from the bellies of the hungry; books from the hands of the uneducated; technology from the underdeveloped; and putting advocates of freedom in prisons. Intellectual property is to the 21st century what the slave trade was to the 16th.