I occasionally get asked what I get out of writing. It's an easy question for me to answer.
First, even though I mostly write technical material, it's an important form of expression and creativity for me. I've been writing, in one shape or another, since I can remember. Secondly, it's a stimulating challenge. Organizing your content to tell a compelling and even entertaining story flexes my brain. Third, and probably most obvious, I like to help and teach people. In fact, it wasn't until very recently that I realized how much I enjoy it. I've long considered myself an amateur writer, but now I'm thinking maybe I'm an amateur educator as well. It's nice to know that you've helped people.
However, the main reason that I write, both blog posts and open source software, is to learn. You put your ideas and opinions out there, in the open, and give the opportunity for people to criticize you. My recent posts on client-side vs server-side rendering and minimalist markup are great example of this.
In my experience, programmers who fail to engage a greater community tend to be stuck in the past. They move at their own slow pace, developing with practices and tools which many of us left behind years ago, or adapted into something different. As a general rule, I've observed that programmers without an OSS presence or a technical blog, lag behind those that do. Significantly.
Good programmers don't blog nor contribute to OSS; instead, blogging and doing OSS is key to becoming a good programmer.