There are a lot of things I like about programming in Python, but one of my favorites is how well Python allows code reuse. Between the excellent import semantics and the outrageous level of introspection in Python, just about any piece of Python code (assuming it’s generic enough) can be reused across a wide range of projects. However, since you can only reuse code that you know about, I thought I’d share a few of my favorite little Python utility modules.
These are mostly things that I’ve written (often more than once) myself, but never managed to generify, package and release. Fortunately, other people out in the Python community are more disciplined than myself.
Here we go…
Making the Windows command line suck (slightly) less
If you’re a developer who’s ever worked on Windows, you’ve had to deal with the Windows Command Prompt, a.k.a. cmd.exe. So you know it’s terrible. It hasn’t changed appreciably in almost 20 years (since Windows 95), and even then it was pretty bad, especially if you had ever used a Unix shell (bash, zsh, even csh) or the Vax shell.
But if you still have to use it, there are ways to reduce the amount of pain you have to suffer. Read on…
Developers tend to have to deal with lots of machines (especially if you include virtual machines). Developers also tend to be pretty picky about their development environments, and the tools they use. That means they tend to want to be able to install a particular set of software on any given machine they’re going to do development work on. I know I certainly do.
On Linux, this isn’t a huge problem, since Linux distributions pretty much always have a general package management tool like apt or yum or emerge, which makes installing software a breeze. These tools make it easy to install a whole set of software packages at once, so if you maintain a list of the packages you want installed into your "standard" development environment, it’s basically one command to install all the software you need to… build more software.
But then there’s Windows…
My plan for this blog post was to introduce my preferred "front-end framework", Zurb Foundation. But then the folks over at Zurb saw fit to sabotage my effort by releasing a new version of Foundation. Can you believe the nerve? So instead I’ll just give a quick rundown of why I like Foundation better than that "other framework", and then show off what’s new in Foundation 4.
The best laid plans…
It started out so simple. The thing you originally designed was just some simple HTML, a bit of CSS, and just enough jQuery to talk to your server back-end and update the DOM. What you ended up maintaining, however, has mutated into a sprawling giant with a "front-end framework" (Bootstrap or Foundation), dynamic CSS (like less or sass), jQuery and fifty-three plugins for it, some utility libraries (a la underscore), templating libraries (maybe mustache or handlebars), etc. ad nauseum.
"My back-end doesn’t look like this," you think. "It’s all nicely organized, and
easy to keep straight. But my front-end is a mess! Where did I go wrong?"
Silly rabbit, you didn’t use Bower. (more…)