My Head Asplode

For some reason I decided to count the programming projects I’m more or less working on in my spare time and counted more than I thought.

Some Eclipse related stuff:

  • Bulletin Board API for the Eclipse Communication Framework. Recently did a major refactoring, needs some more updating to get all the features working again. (Java)
  • Padclipse, a “lite” packaging of Eclipse which includes only the Text Editor and a bit more, plus some custom additions. I haven’t really worked on it for a year and a half, but I want to update it when 3.5 comes out. (Java)
  • Eclipse plug-in to make 2D game development with Slick a bit easier. I was working on this for the past two weeks, just finishing up now and will release in a few days. (Java)
  • A secret Eclipse plug-in. Just started, will see if something good comes of it. (Java, likely some Scala too)

Server and game related stuff:

  • Ziggy, the forum bot that runs interactive fiction games, uses BB API. (Scala / Java)
  • Web interface for managing Ziggy, barely started. (Scala, PHP)
  • Scaler, a web framework, too little done to talk about. (Scala)
  • STON, a strongly typed and extensible JSON-like data format. Not sure of the usefulness. (Scala)

2D Game related stuff:

  • Scala port of the JBox2D physics engine. Almost done, but needs polishing. (Scala)
  • Gamp, a game entity system based on Slick and my Box2D port. (Scala)
  • Orbitum, a game making use of Gamp. (Scala)
  • A secret 2D platformer game, but I have barely started with this so perhaps it doesn’t count. (Scala)
  • Another game project, also secret. (Scala)

And this is not all. I occasionally work on quite a number of smaller things, some are just little experiments, others just for excercise. Some may become “projects”, some may not.

Looking at the list almost makes it seem unmanageable to me, but actually I don’t think I’m doing that bad, although there certainly have been release dates promised that haven’t been met. Now I know I should always multiply my time estimates by the number of projects I’m working on :) Only two of the projects are actually released/in production, and beta at that: Ziggy and Padclipse. At least two should have a release rather shortly: the Slick Eclipse plug-in and Scala port of Box2D. But even as I can move them out of the “yet unreleased projects” list, they are still going to need maintenance and updates.

Anyway, please comment, if you are also a programmer, or a geek with a different specialization, who has a lot of hobby projects, how do you manage not to get swamped with them or get the feeling that you are always working on cool stuff but never releasing? I was actually stressed by this a year or more ago, when I had somewhat less projects, but had not released any of them yet.

There are certainly good things about having so many projects: I don’t think I’m ever going to get bored. I have many ideas and wish there was enough time in the world to work on 30 more projects. And even if I wouldn’t think of any more new ideas, whenever I get bored with one of my current projects, I can switch to another one and so on.

Python is great, but __

I haven’t used Python a lot, but from what I know about it, I consider it one of the good languages. A bonus is that most Python programmers seem pragmatic and humble, which is nice compared to the impression of Ruby community left by some of the more arrogant Ruby folks. But there’s one thing that really irks me about the language, more than the somewhat significant whitespace or some of the syntax quirks:

__init__

What the fuck is up with that? I have seen very few pieces of Python code which didn’t contain those double underscores. How was it decided that commonly used names will contain four underscore characters? I doubt that names such as init, main, iter, etc. were considered so precious that the language must not treat them specially. Perhaps in the early days it wasn’t apparent that the magic methods would be used as often as they are? Or maybe it was but the __ didn’t bother enough people? I would find that strange, but then again people get used to everything. Scala makes magic use of the underscore as well, but I’ve gotten used to the few cases where it’s part of names. Most of the time it’s used as a wildcard, and that doesn’t bother me at all.

Do you program in Python regularly? What do you think about the underscores?

Right Tool for the Job? Yeah, Right

Frankly, I’m a bit tired of hearing the hammer and nails metaphor and “right tool for the job” from developers when they talk about programming languages. While there’s nothing wrong with selecting the right tool when there clearly is one, I think the phrase is often misused and seems to be a cheap explanation to justify personal preferences and subjective decisions seemingly objectively. I think when that phrase is uttered, it mostly means something like: the right tool for me (or my company) at that particular time, considering my (our) experience, knowledge, skills and preferences at that time.

Most of the times there are always several “right tools” that are probably equally good “for the job” and the reasons for choosing one over another are usually not merely technical in nature but depend on many other variables from the larger context in which the choice is made. Actually, I don’t even think there’s ever a completely right choice. The complexity of the real world makes it impossible to know for sure, but nevertheless, choices must be made and we approximate. If someone else made a different choice in a similar situation that doesn’t mean it was the wrong tool for the job.

A programming language is not really just a tool anyway. In some ways it is, but the hammer analogy sucks. For building a house you might need hundreds of different tools, tens at the least. For building a large application you could get away with just one language without ending up with bad abstractions. If you count HTML, JavaScript, SQL in typical web apps for example, then maybe you need five or so, but if these are cases of selecting the right tool then they have long become common sense and are not interesting to discuss.

But usually you only need one general purpose language. There are of course some differences between them and some languages have grown into certain roles (forgive me some sweeping generalizations): C++ is for performance and hardware access; Java is for applications and information systems; PHP, Python, Ruby for web apps and scripting etc. (as a side note, I think Scala can play both of the latter roles) In some cases you might perhaps want two of them — programs in higher level languages sometimes “drop down” to C++ for performance, Grails mixes Groovy and Java — or maybe even three, but much more than that would be overkill. Note that I am not at all against the polyglot programming meme, but I do think the choice languages for any given project or organization should be limited to a few.

So programming languages are like tools in the sense that choosing a language somewhat limits what you can do with it. But actually, I would say that a general purpose programming language together with it’s libraries is more like a complete tool set than a single tool. You can choose any tool set you like, each will get the job done. One set might be missing a hammer, another might be missing a saw — if that turns out to be a problem for a few situations then you compensate. Perhaps by renting a specific tool for just the time when you need it, deciding on using two tool sets from the start, dropping a requirement, or finding a workaround that is doable with your current tools. Even if you have to do the latter, it still doesn’t mean you are looking for nails where there aren’t any — it might be a valid choice considering your constraints. However, if this keeps happening then you probably have chosen the wrong tool (or someone chose it before you).

But besides being a tool set, a programming language also forms an important base for communication between developers, just like natural language does. With this comes a whole new set of considerations for choosing a language that have nothing to do with how exactly it fits to solving a problem technically. It also determines what kind of community you have access to, what kind of cultural values you may be indirectly associated with, how many “compatible” developers there are in your area etc. And I think sometimes, but not always, these questions may be more important than the technical ones.