posts tagged with the keyword ‘python’

2010.11.10

I stand here today not to condemn Perl, but to defend it… Perl

And when I say “Perl” I want you to feel free to substitute any other language you see fit… Visual Basic, Fortran, Lisp, COBOL, Smalltalk, or even… Java.

I was given a programming assignment this week. Given a list of 2000 names, I was to provide 400 names randomly. (Yes, this was for work, and was a real-world assignment, not just some exercise.) I proceeded to open my ~/scripts folder, which contains well over 1,000 Perl scripts, and grabbed some existing code, and wrote some new code, and ran a few tests, and quickly had the list of 400 names.

I used Perl because it worked for me. I probably could have written in it PHP (as it’s another language I am pretty comfortable with) but since I’m more familiar with Perl, and have done very similar thing before with Perl, and had a gigantic library (nearly 15 years worth) of Perl scripts to pull from… I used Perl.

I’m sure others could tell stories just like this substituting Java, or Python, or Erlang, or whatever they have around, that they are the most familiar with… and that’s fine.

This is about using the appropriate tool for the job, and this case, with the job being performed by me, the tool was Perl.

I wasn’t creating some new framework, or building upon an existing application, or pushing some code to GitHub that I wanted others to collaborate on… it was a quick ‘n dirty task that needed to get done as fast as possible.

Much of the programming world (maybe it’s mostly in the web-programming world) gets hung up on the latest and greatest. There’s a chance that using Ruby someone could have completed this task in half the time… but that person would not have been me, as I’ve spent probably less than an hour using Ruby and I’m not familiar enough with it to bang out the needed code quickly. I’d like to have some time to dig into Ruby (or, whatever, pick a language) and get familiar enough with it to use it effectively, but I don’t know when that will happen.

I’m not even a programmer… I’m a hacker, and I think Perl is a hacker’s language. Make something work. Solve a problem. Do it quickly, and move on.

To some degree you could say I’m trapped in Perl, because it is so easy for me to get what I want done quickly, and yeah, there’s a module for almost everything… Where I mainly feel the pain is when I look for example code and narrow my search to Perl (or PHP) because I’m most familiar with them. I needed some code this week to do some serial port communication, and found only one good example written in Perl. I should probably task myself with re-writing the code in Ruby, or Python, or some other language I’m not as comfortable with as an exercise in forced learning.

And then there’s a part of me that just says “screw it, I’m gonna work with what I know, and get things done, and move on.”

2004.12.16

Let’s mix it up a little… Perl, Python, HTML-TemplateAtom, RSS… Words, Photos, Links, and Objects of Desire…

Say what?

Say Planet Planet!

Or say Planet RasterWeb!

There are billions and billions of planets out there, well, ok dozens maybe. (Heck, there’s even a WordPress Planet.) the one that was the tipping point for me was Planet Burningbird, which is explained in It’s the Oddest Thing.

After seeing Planet Burningbird, I said “Heck, let’s do it!”

The Planet website has no real documentation and very little explaining things. (True geek software, eh?) I downloaded whatever version I could from whatever link I found, and took a look. Python. I mean, I completely gave up on Python earlier this year, but, well, OK. We’ll give it a try…

Now, on Mac OS X I did have a hiccup or two. Searching…. Ok, this post about Mac OS X fixed things. After that it was on to templating. Ah! HTML-Template, but done in Python. (Gosh, where have we heard about HTML-Template before?)

So templating was fairly simple, since I knew the tags. What’s next? Feeds! Yes, we need some feeds… I grabbed my own feed from this site, as well as my feeds from del.icio.us and Flickr and… Is that it? Hmmm, I need more feeds. Luckily I had been experimenting with a Perl module named WWW::Amazon::Wishlist to create an RSS feed of my Amazon Wish List. Of course some of the stuff on my wish list was from the year 2000, so I had to update it. (Honestly I don’t expect anyone to ever actually buy me a gift, but you know, if you want to, the option is there… hint, hint. Aw, who am I kidding? I can barely get feedback on the stuff I do here…)

So where was I?

Ah yes, Feed the Planet, yes… Oh, PubSub! I got two feeds there! One for sites that link to RasterWeb! and one for sites that “mention” RasterWeb!. You’d think if they mention it, they’d link to it, but they seem to have different results. So in theory now, if you link to this site, you should show up on the planet. (This might go sour in the future, we’ll see…)

Is there more? Sure! Though Planet doesn’t seem to handle enclosures in any way, we also have RasterWeb! Audio, which is one of those “podcasting” things we started back in August before podcasting even had a name…

Ok, so that’s the lowdown on the planet. It’s seems to have been released under the same license as Python, and a quick check with the Open-Source Initiative’s Licenses says it’s open-source. (I think.)

Any problems? Well, it doesn’t quite validate. I mean, all the feeds I have control over seem to validate fine, but the Planet page itself doesn’t, partly due to the foreign content from the PubSub feed, and maybe because of Planet doing something silly as well.

So that’s my combination of Perl, Python, HTML-Template, Atom, RSS, del.icio.us, Flickr, PubSub, and other things I won’t mention again. Enjoy!

|


buy the button:

Buy The Button