?

Log in

No account? Create an account
Semiformalishmaybe

Lessons from Refactoring

Recently, I've been going through a number of my programming projects and moved any function that's either generally useful or used in more than one project into a common library. Unsurprisingly, as I do a lot of programming this means I'm sometimes merging dozens of implementations of what's roughly the same idea (with different call semantics and return values; usually easily fixable with a bit of reworking of the calling code). I'm doing this in Perl and C (I do have some old Java code and a bit of Python, but I don't code a lot in either language regularly). Chances are when I get this done I'll force the condensed libraries to mirror each other.

I highly recommend this kind of thing. It's a fantastic learning experience; not the kind of thing where you get a particular set of ideas out of it (although using function pointers, be LISPy, and make introspection easy are great particular lessons), but more the kind where when you move your mind over a lot of code you get better instincts on how to code things better the first time.

Utterly conventional knowledge, I know, but just like having a monthly "Happy Backup Day" to remind you to do backups, the reminder can be helpful.

Oh, hey, Happy Backup Day. Go back your shit up so some hardware failure won't make you cry (more than it needs to, anyhow). Your data is more valuable than your machine. Your ideas are more ... nah, no philosophy for this post. ;-)

Comments

If you (the collective you, not you Pat) find yourself backing up a nontrivial amount of un-backed-up data on Happy Backup Day, consider setting up automated backups. I recommend the commercial backup software "CrashPlan". It can be configured, for free, to back up your machines to your other machines. If you pay money (and not very much), it can be configured to back up your machines to the cloud. The backups are encrypted in a correct and sensible manner. You have no excuses. Do it!