The writings of Peter Stuifzand

Archive for December 2009

When you read about people wanting to switch to an Android phone, they will say that the iPhone has the most applications. Last thing I heard about this was that the iPhone has about 100.000 applications and Android about 16.000 to 20.000. This is only a factor five. That one number is bigger than the other is obvious. But is that the best way to compare these two app stores?

I think it's better to compare the app stores, or the applications, by comparing the different applications. If the iPhone App Store has five times as many applications, because many applications have copies that do almost the same thing, can you then talk about having more applications? I don't think so. It's true that there are more actual applications, but that doesn't make the iPhone itself more useful.

You could also think of it this way: if you can have every applications that you want on the Android phones, then it doesn't matter how many applications its App Store has.

osfameron asked:

I've been prototyping ways for customers to import data into our system. [...] How would you tackle this task? Is there even an elegant way to do it imperatively?

He is trying to import data into his system, but his information is not all in a flat structure. It looks like this:

Name        Price   Tag
Brie        2.00    Dairy
                    Cheese
                    Food
Chablis     5.00    Wine
                    Alcohol
                    Drink

As you can see the there is a start row and a few extra data rows after that.

The program that I would write to import this data looks like this:

use strict;
use warnings;
use Product;
use Data::Dumper;

my @products;

while (<>) {
    if (my ($name, $price, $tag) = m/^(\w+)\s+(\d\.\d{2})\s+(\w+)$/) {
        my $product = Product->new(product => $name, price => $price);
        $product->add_tag($tag);
        push @products, $product;
    }
    elsif (($tag) = m/^\s+(\w+)$/) {
        my $product = $products[$#products];
        $product->add_tag($tag);
    }
}

print Dumper(\@products);

In the way that I have written this code it doesn't need two pushes. Pushing it on the array is the first thing that I do after creating the product. The other parts of the code that need to refer to the product that was added last use the last product in the array.

My program is different to osfamerons code by using regexes, but this allowed my to actually test my code.

Ted Dziuba wrote:

People think I hate programming. Nope. What I hate is fording endless rivers of horseshit that are in the way of seemingly simple tasks. And I hate it even more when I have to explain to a non-programmer what I am doing, "building LXML against a different version of libiconv because I think it might be the source of a crash".

Yes. The thing that I would say is this:

People think I love computers. Nope. What I love is that I can write software that is useful and helps people do their thing. But I hate it that I need to do upgrades, backups, hardware things. Computers break, I just fucking hate that.

As a programmer I would like a perfect programming environment, without hardware failures, the need to backup and upgrade, and fucking spammers, but I don't think that I will see that in my time on this planet.

Steve Rubel wrote:

The decade is coming to an end. And with it, so has the era of feeds too faded - though you can argue it never got off the ground. Even with real-time technologies like pubsubhubbub, RSS today feels slow and it's clear its best days are behind it. Feed reading, like blogging, feels "very 2005." I wasn't convinced until recently, however.

You could say that I'm not convinced yet, either. Still I wouldn't know what I would do without RSS.

It seems a lot of out technologies are only useful for people who use a computer all the time. A person who isn't sitting behind his computer will have hard time writing tweets. Yes, you can use a fancy phone, that lets you write a tweet. But not everyone has that kind of phone.

The same problem happens with feeds. I read a lot of blogs, but most people I know will just go the website to read the stuff they care about. In that same place they can also interact with the community, by adding comments or liking and sharing posts. This is harder (or impossible) with RSS.

About a month ago people were talking about "pushing RSS down the stack". I would say that there is more of an opportunity in building applications and services on top of RSS. And again on top of those applications and services. RSS is and always was a protocol on top of HTTP.

There is room for creating applications that will help and you read your feeds. We need a better way of creating conversations outside of it. We need a protocol for writing and reading comments, liking and sharing posts inside RSS, that is about as simple as RSS itself is. Link to the comment form of the article and let applications post comments in a programmatic way using REST. The same could be done with liking.

Advertisement: Stuifzand Webwinkels - Begin je eigen webwinkel.

I have had an account with Twitter now, for almost three years. According to When did you join twitter?, I joined twitter over two years and nine months ago. Lately I'm wondering if it's useful for anything. It's a lousy news reader, it's a terrible communication medium and the mechanics are all in one company.

There is no way for me to send messages to the people I would like to send messages. Let's say this is the same group of people that I would send SMS messages to. These aren't on Twitter and probably never will be. They tried it and left it, never to return. These are the kind of people that don't have fancy phones, with fancy apps, that allow them to use Twitter in a useful way.

Another thing is that Twitter is not private enough for these people. They don't care about sharing there personal life on a website, that can be read by anybody.

For many messages (or conversations) 140 characters is just not enough. I don't want to edit my messages until it fits, or split it over multiple messages. I want to write what I need and send it. I should be able to make the message as long as it needs to be.

It feels like such a waste to write posts like this, but it's how I feel about Twitter at the moment. I just don't care about it.

UPDATE: And as you can read, I also don't care about writing a good post.

If I read the title of this diagram correctly, it seems to imply that the skeptics aren't scientists.

The Global Warming Sceptics vs. The Scientific Consensus

I don't think this is that case.

In Why the HTML5 'Video' Element Is Effectively Unusable, Even in Browsers Which Support It John Gruber says:

I truly hope to see Flash fade as the de facto standard for embedded web video, and I’m willing to put my markup where my mouth is.

Me too, and also for everything else.

We should build towers of software instead of just replacing the platform every few years. Many client software programs are the end of the line. It's not easy to build new software on top of those programs.

The problem with this is that this way client programs will become better, but it's not possible to build on top of them.

Each program should have an API that allows other programs to build on top of them. There is a lot of functionality that is build in to programs, that could just as easy useful to other programs.

For example, a download program could be called by your web browser. Downloading files is a low-level functionality. An external program could show a list of downloaded files. Also if you listen to podcasts you could have your RSS reader send the url of the podcasts to you download program. When your files are downloaded they could be synced to your music listener or just shown as list of new files. By using an external download program it can be the greatest download program and it doesn't have to care about complicating other programs.

The API for such a program should at least have two pluggable points. The first allows to send the url of the file you want to download. The second will be called when the program is done downloading (or has failed).

I shouldn't be talking about this example too much, because that is not the point.

View archived entries