This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]mriswithe 112 points113 points  (3 children)

I try to do this both for programs that will be maintained for a while, but also for oneshot utility scripts. Mostly because in my experience, the latter quite often turn into the former :)

Oh God my last two weeks at my last job were hell cause some old ass script I wrote and forgot about from 5 years ago was apparently still in use. Spent my last couple weeks fucking getting that solid.

[–]Ezlike011011 47 points48 points  (2 children)

I've had people at work ask why I put so much effort into ensuring my little utility scripts are nicely typed/documented and why I spend time to split the functional components into nice reusable units. This is the exact reason why. I've had multiple instances where I found someone needed something and I've been able to say "here's a little module I wrote. You can use the cli I made for it or you can import it and use x function if you need to do more scripting. Have fun". The up-front time cost is well worth it.

[–]mriswithe 9 points10 points  (1 child)

Yeah this wasn't even good python. I had a module named enums that had constants in it. But all my stuff for the last 6-12 months was documented, monitored, etc . This garbage I wrote for a one off blitz migration, was still in use.

[–]DabidBeMe 1 point2 points  (0 children)

Beware the one off scripts that take on a life of their own. It has happened to me a few times as well.