Refactoring and asking for forgiveness
everydaysuperpowers.dev·31w
📄File Formats
Preview
Report Post

Recently, I had a great interaction with one of my coworkers that I think is worth sharing, with the hope you may learn a bit about refactoring and python.

My colleague came to me to help him think through a problem that surfaced with a change to a project. The code in question sends a file to a remote storage service. It looked like this:

This method will read the file at file_path and send it to the file service, where it will be named file_name , and it would be placed in the folder remote_pathLooking at it now, it’s not the best signature for a function. It would be much better as (local_path, remote_path) . It sure would be nice to fix that. But that’ll be a different post. .

The change that my colleague was working through is that before now, this method would expe…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help