pythonaro.com

Pythonaro blog

29 November 2007

On pykeylicious, Python vs Perl, and the state of Konqueror

If you use KDE, as I do, you should check out KDE-apps; it's a nice site full of all sorts of programs and add-ons for the desktop environment, from full-featured applications like K3B and Amarok to simple enhancement to the UI, kicker replacements, etc etc.

On this site, there is a fantastic little feature that allows you to "subscribe" to an application; when the application is changed/updated, you get a reminder via email. I personally subscribed to a few little apps (KShutdown, QtEmu, kio-locate...) that are not included in the standard KDE and are often off-the-radar for mainstream distribution packagers, so they are a bit difficult to track in the regular ways.

One of these apps was konqil.icio.us, an addition to the Konqueror right-click menu to do a few things with del.icio.us. Last night I found the email saying that a new version was out, so I went there and downloaded it; while reading the description, I immediately thought "why do I need to do all this messing with folders and permissions, a little installer could do it for me!". Then I checked the dependencies, and found that the script was in Perl... there was no chance I'd write an installer in Perl (I hate it) and send it to the original developer; also, adding a dependency on python for the installer looked a bit silly. So I decided to rewrite the script in python, add the installer, and upload it, and pykeylicious was born.

All this reminded me of how easily "tweakable" Konqueror (and KDE in general) is. You add a file in the right place under $HOME/.kde/, and you have just hooked the interface to your programs and scripts. The problem is often finding the right place; documentation exists in non-obvious places, as KDE developers tend to talk more about the C++ infrastructure.

I personally think this is one of the factors that stopped people from moving to Konqueror from Mozilla/Firefox: developing third-party extensions seems hard in comparison. This might or might not be the case; as konqil.icio.us demonstrated, it is fairly trivial to build a simple extension... however, if you want to manipulate webpages and the internal DOM, you have to write a C++ plugin, which might be easy for C++ coders, which net-people usually are not. Net-people like "easy" languages like java, javascript, python or ruby.

Last time I brought this up (yes, it's one of my pet-subjects) on the pykde list, I found out that yes, you can probably build plugins in python, but you have to jump through several hoops and basically try to fake that you are a C++ program. Not good enough. The day this sort of things becomes easy is the day that Konqueror goes back to be a serious alternative to FF in the Linux world.

Labels: , , ,

posted by GiacomoL @ 5:19 PM   2 comments links to this post

21 November 2007

On the Samurai Principle

Some blogs recently pondered on the Samurai Principle. It made me think, because I'm one of the many "guilty" of returning None/null rather than raising an exception. To me, it happens more often when working with Python rather than Java, because it's very natural to write "if something_not_found: return None". Also, abusing exceptions can end up polluting your code with dozens of nested try-catch/except, which kill readability and tend to be much worse than a simple "if (obj is None):".

This said, I agree that NullPointerExceptions are a royal pain, and "AttributeError: 'NoneType' object has no attribute 'something' " is equally bad to deal with. API programmers in particular should try hard to return this sort of stuff as little as possible.

I guess the bottom line is that in medium stat virtus, as it's often the case with these "absolute principles of programming"; at the end of the day, when we program we are applying science, not demonstrating it. And as much as we love them, samurai lost all their wars ;)

Labels: , ,

posted by GiacomoL @ 1:40 PM   3 comments links to this post

17 November 2007

Google spamming LinkedIn profiles?

I just got a message from somebody on LinkedIn who (apparently) works for Google, saying they have an "engineering opportunity" and to reply with my word or pdf CV. While I'm flattered, I'm not sure I should reply to the message. Call me paranoid, but I don't see how I'd ever be Google-material (no strong academical background, no open-source fame...); maybe I ended up in some strange list (maybe matching LinkedIn profiles with emails on Monster?), maybe something worse.

Labels: , ,

posted by GiacomoL @ 10:23 PM   0 comments links to this post

14 November 2007

Hey Seagate, here's a business idea for you

The paper mountains will stay with us until such time as write-only media become as common as today's hard disks. We need storage sub-systems that never, ever delete anything. Storage systems that automatically - at hardware level - ensure that updates are stored as new versions and that delete operations are really archive operations. To be widely adopted, we need the confidence that only legal standing can bring to the evidential reliability of such devices.

Sean McGrath - Paper doesn't dance

Labels: ,

posted by GiacomoL @ 12:20 PM   0 comments links to this post

10 November 2007

fixing a toilet flush is not rocket science

if I can do it, everyone can.

Labels:

posted by GiacomoL @ 7:12 PM   0 comments links to this post

Notes on Python-North-West 2nd meeting

I just posted some notes on the second Python North_West meeting in "Happenings in Python User Groups". And also some notes on the new IRC channel vs the Facebook group.

Labels: , , , , ,

posted by GiacomoL @ 7:07 PM   2 comments links to this post

introducing #python-north-west and #pythonaro

Was feeling tired but slightly "hyper" last night, so I set up an IRC bot and registered two channels on irc.freenode.net. One is #python-north-west, for the group, and the other is #pythonaro, for me & friends. Come and say hello :)

Labels: , ,

posted by GiacomoL @ 12:45 PM   0 comments links to this post