Friday, May 29, 2009

I don't like Integrated Development Environments

I really don't like Integrated Development Environments (IDEs). I don't like code completion, class browsers, object inspectors, class heirarchy diagrams, source control management in whatever I am editing coding with. I find such tools arcane and frustrating.


Its because I want to be able to feel the design of a module. When I manually introspect things I feel like I am sifting through the sand of the module to see what it gives me. I feel it in my gut that this is how I learn a language and use it best of all. Python makes that very easy for you with its powerful introspection capabilities which you use on the shell. I find switching to the shell lets me separate the capabilities of the module from the code I are working on. Which for some reason I find a lot more comfortable and intuitive. Your own mileage may vary.

If I do need a class hierarchy diagram, I just write a fun little python script which generates some dot notation and run graphviz's dot or neato utility.

If I do need source control management, thats what the command line is for!

Also, there are times I have to go and do things on systems besides my own. I can't expect to have Eclipse or NetBeans there. Or if they are there by some weird chance, they won't be configured the way I want.

Keep in mind I do like code highlighting. So I guess that makes me a text editor fan. And now on to my favorites:

Textmates (Mac only)
Kendall Clark introduced me to this tool back in April/May of 2006. I was very quickly hooked. It was much better than the TextWrangler that was giving me grief. And also much less arcane than Emacs. It is the one piece of software I'll actually pay to buy to use on the Mac!

Back in the 1990s I did Perl for a short time and was introduced to Emacs and Vi. Emacs clicked for me, because even its arcane commands worked better for me than Vi. These days my Emacs skills are not superb, but I can get by on any machine that has it installed. So that means any Mac or Linux machine I stumble across.

So my dark secret is that until December 2006 I did much of my work in Windows. Yes, my first python work was all developed on Windows! Anyway, I had stumbled across Textpad during a Java job and kept using it across other languages and efforts. It was light, did code highlighting, and kept out of the way. Perfect! Well, maybe not since it crashed about once a day. Still, it was better for me than more sophisticated alternatives.

Monday, May 25, 2009

ColdFusion and deprecated code

Lets take a step back in time to 1999. At that point I had been doing a mix of Foxpro for DOS, Perl, and an obscure language called WebML (don't bother looking it up, it doesn't seem to exist anymore). I admit I liked Foxpro but recognized it was a coder's dead end. Perl gave me regular expressions which I liked but I was uncomfortable with everything else. WebML was okay but it was clear that it was too obscure. Around that time I even talked to some people doing something weird with Python and Zope in Fredericksburg, but that sounded even more obscure.

At my job we had someone throw together a ColdFusion 4.51 application. They needed some help. I took a look and quickly figured out the issues, made corrections, and realized this language was really simple. One thing I noticed while pouring over the built-in documentation of the CF IDE (this was back when I used IDEs) was that there was a list of deprecated functions. You were supposed to stop using parameterExists and use isDefined instead. I shrugged, followed the specification, and moved on.

Years went by. I did Java and ColdFusion. Both were annoying because of spaghetti code. Java was also annoying because of boilerplate and the static typing, ColdFusion was annoying because of the tags, the weird ecmascript implementation, and the insistence of developers on using the deprecated functions.

The most obvious example was the parameterExists vs isDefined issue. The former, paramExists accepts a variable, so you couldn't build dynamic code. Specifically you did something like parameterExists(my_variable) instead of like isDefined("my_variable"). This meant more cut-and-paste coding. Also, because it was a deprecated function, the owners of ColdFusion didn't care about the performance of the code. So instead of looping through an array of a hundred or so variables who existence you wanted to check using isDefined, people would still @#$%ing type out parameterExists a hundred times. Or more commonly, cut-and-paste from one code template to another, across applications. A good number of the parameterExists at the top of a CF page often have nothing to do with the purpose of the page and people would wonder why things ran so slow.

Sadly, this sort of behavior still happens today in the CF community. Worse yet, because in my experience the CF community tenure is more important than anything else, the worst offenders are often the people who have been using the tool the longest.

So lets go through a quick summary of my issues with ColdFusion and deprecation:
  1. Deprecated language elements, even if deprecated over 5 releases, are... well... deprecated.
  2. Deprecated language elements are likely the last to be examined in a release for performance or security reasons.
  3. Deprecated language elements can go away.
  4. The worst offenders of using deprecated language elements tends to be those who have used the language the longest.

Wednesday, May 20, 2009

Eight things I don't like about python

Jesse Noller threw down a challenge on twitter. Or rather he said something and I've purposefully taken it out of context and am considering it a challenge. His statement was that you should be able to to find at least five things you don't like about your language or tool of choice.

So why should you read what I have to say on the subject?

This one is easy. I'm not a luminary in the field of python. I'm just Joe Developer. I am the user base. If something annoys me then it could annoy others.

1. Division sucks in Python

This is fixed in Python 3 and right now in the python version I am using I can do from __future__ import division. Nevertheless this should have been fixed ages ago with the release of python 2.4.3 or earlier. Why python 2.4.3? Because it was on that release that I started doing professional python coding.

2. TKinter blows

I've done a tiny bit of TKinter coding. I stopped because it was too ugly. Python needs either an updated, prettier version of TKinter or it needs something in its place as part of core python.

3. Lambdas make it easy to obfuscate code

I remember when I thought Lambdas was overheated excrement. I changed my mind. I found myself obfuscating my code, or trying to stumble through someone else's code that was ridden with lambdas. I suppose they have their place, but it seems like 90% of the time they don't add anything besides reducing your line count by a small amount.

4. Sorting objects by attributes is annoying

Yes, the snippet of code is trivial. Still, couldn't sorting objects by attributes or dictionaries by elements be made a bit easier? sort and sorted should have this built right in. I still have to look this up each and every time.

5. Regex should be a built-in function

Actually I sit on the fence on this one. Sometimes I wish python was like Perl and Ruby in that you didn't need to call in a new module when you needed a regular expression. Other times I am grateful I don't have to wade through the inevitable obfuscated crap we coders all too easily generate with regular expressions.

6. Reload could be less annoying

I am a python coder. I love the shell. Except reload only works on modules. Bah! I want it to work on every object in the stack.

7. Help doesn't let me skip over the '__' methods

Python's introspection and documentation features makes me happy. And yet when I have to scroll past __and__, __or__, and __barf__ each time I type help(myobject), I get just a tiny bit cranky. I want help to accept an optional boolean that defaults to True. If you set it to False you skip anything with double underscores.

8. Not enough female Pythonistas

I'm lucky that I work with a lady pythonista. And I've got an internet friend who is also a lady pythonista.

And that is it.

What a damned shame.


I've just handed you eight things to think about. It was hard coming up with actual meaningful things, which proves that at heart I'm just a gushing Guido Van Rossum fan boy.

Update 2011/11/04

New commentary on this post is at Redux: Python Things I dont like

Monday, May 11, 2009

Help me make a new Avatar!

A couple years back I went to Naples, Italy for the 2007 Plone Conference. It was my first trip across an Ocean. My first trip to Europe. In Heathrow airport I met Rocky Burt and he took the picture that became my avatar.

Well, I want a new avatar. That means I have to do another cartwheel some place I've never been. Some place exciting. And that is where you come in.

Basically, I'm looking for suggestions of places to go or invitations to go visit you wherever you might be. My budget isn't large, but my enthusiasm is without bounds. I love the heat so if your idea or invite is cheaper in summer time that is even better. The costs involved determine the duration of the event. Off the top of my head I'm thinking of places like:

  • Africa
  • Asia
  • Brazil
  • England
  • France
  • Germany
  • India
  • Italy (even Naples again!)
  • San Francisco
Screw it. Lets go the whole way:
  • Anywhere a thousand miles away from Washington, DC.
This becomes feasible for me after May 22.

Quitting Caffeine

I don't remember my first experience consuming caffeine. My parents let us kids drink soda of all types, and that included colas. They also smoked around us and covered our house in artificial wood paneling. Ah yes, the lovely 70s.

As a teenager I drank lots of coca-cola with my buddies. I remember putting away 2-liter bottles. Was it then the energy of youth, the caffeine, or the sugar that made us jumpy afterwards?

During my early teen years I also started to work in restaurants. At my second job one summer I came in once after a 17 hour day and just felt dead. The Sou-Chef felt sorry for me and poured me a big coffee, dropped in an ice cube, and covered the result with fresh cream. I woke up after that and in the process, got hooked on coffee.

So it was back in my heady Java days of 2002 that I decided to quit caffeine. I had already kicked sugar for health reasons. Alcohol was something I only drank on special occasions. I decided I could be totally vice free. I don't remember my process, but I do remember being rather proud of myself. Then I got really sick. I drank lots of tea, forgetting somehow that the tea I was drinking was caffeinated. And I was hooked again.

As the years went by I would time when I would drink caffeine. I knew I had to drink it every 12 hours to avoid withdrawal. Coffee in the morning, soda at night. I had an addiction. I periodically gave thought to quitting, but the habit didn't seem so bad.

For the past six months, I've actually reduced my caffeine intake. Between smaller portions and longer intervals, I felt like it didn't rule my life anymore. For the past two months I've gotten it down to coffee in the morning and diet coke when I eat away from my desk.

Then, for health reasons, several months back my co-worker Katie Cunningham had to quit caffeine. Suddenly I felt awkward every time I drank coffee or soda around here. The same way I feel when eating meat around a vegetarian Hindi or pork around a Jew or Muslim. I'm not sure why I feel awkward that way, but I do.

Recently I've been making a lot of changes in my life. I've stopped watching television entirely, become a neat nick (I'm not that messy to begin with), and quit caffeine.

Considering how infrequently I drink caffeine quitting it wasn't that hard. I had my last bit of soda on Saturday morning. The only symptom I suffered was last night I went to bed with a headache; a headache that might be allergy (high pollen count here in Virginia, US) related.

I think I'm vice free now. Well, almost. I do drink alcohol socially. And if I run into insomnia I will have either red wine or a beer if I can't find any wine.

Thursday, May 7, 2009

DC Sprints location is changed!

Cosi seemed great. Decent food, internet, pleasant seating.

Except they blocked the really useful ports. SSH, Git, you name it.

So we have switched to the Arlington Central Library, just two blocks away.

Wednesday, May 6, 2009

DC sprints location is official!

All the details can be had by following this link:

I'm rather excited by this event. It is the first in what I hope becomes a DC tradition of doing 'local mirrors' of python conference sprints with involvement from all the area python groups. This way, more people get to contribute, our community works better together, and the networking opportunities can abound.

On the other hand, I wish I had found more time to organize this event. And that I had found a good location inside of Washington, DC. I suspect this first effort will have a low turnout, but I won't mind being pleasantly surprised. ;)

My hope is that this year alone we might be able to exploit similar efforts in 2009 for the Euro Pycon, DjangoCon, and Plone Conferences.

With that in mind, I'm going to insist that these local mirror sprints be completely framework and tool neutral. For starters, under the hood, aren't we all just doing python? Plus, I'm of the very firm belief that any major system with initiative has things to teach, be it lessons learned or neat ideas. For example, Jacob Kaplan-Moss uses zc.buildout, which grew out of the Zope community. And while we might not have the ability to listen in on actual conference sessions, think about the chances we'll get to look at each other's tools and methods.