I've been doing a little big of programming for fun in recent months, and I wanted to do a little big of blogging here to explain myself, so expect that over the next few days.
By way of creating the facade of suspense--which the astute among you will be able to spoil by way of looking at my github--this post isn't going to mention the actual projects, but rather answer two questions that are more interesting from a higher level:
- Why have you done this?
- What have you learned about yourself as a programmer?
Why Have You Done This?
First, while I've been writing Go for a long time, I must confess that I was a long time generic skeptic and hold out. Writing some code for myself and I wanted to get a better feeling for how they worked, now that they're here.
In my day to day work, I have found myself writing similar code again and again: while I have definitely have a class of problems that I tend to work on, I'd be ok if I never wrote another function to bridge the gap between a context.Context and a sync.WaitGroup (and I'm not holding my breath for this in the standard library.)
Finally, over the years I've written a few projects that I've worked on professionally have been open source, and a few of them I've even rather liked, and I wanted to see what it would be like to revisit some of these projects with (potentially) wiser eyes and fingers.
What Have You Learned?
I actually think I've learned a lot:
- While I'm a big fan of the part of software development which is "deleting code" in my professional work, it was really interesting to take that to code that I knew I'd written (or directed the writing of) and been able to see what I could cut.
- I'm better at writing tests and writing testable code than I was even a few years ago. While I believe in writing defensive code, I found myself writing an implementation and then going through and deleting a lot of code that wasn't useful or was (fundamentally) superstitious when I discovered that there was no way to trigger a potential case.
- Because I've spent a few years mostly working on relatively high level projects and not having the bandwidth to work on lower (mid?) level infrastructural code, in practice I've spent more time assessing other people's libraries and I was keenly aware that I was developing code that would only be used if someone chose to, and in thinking about how those decisions are made.
- This isn't new, but I care a lot about the erognomics of software. I think 5 or 6 years ago, ergonomics meant "code which was easy to use and provented users from doing wrong things," and I think my view of erognomic code has expanded to include interfaces that are easy and obvious to use, and promote the users of my code to write better code.