php|tek 2008: day -1
May 20th, 2008 by Ivo
About 24 hours ago I woke up to drive to Brussels for a long flight to Chicago. The fact that this was 24 hours ago is beginning to show: I'm randomly falling asleep even in noisy underground trains.
But it's been a fun day. The flight was ok (watched national treasure 2 and ocean's eleven, both of which I've already seen but it kills time; and in between I read a book I'm reviewing). Getting from the airport to the php|tek hotel was only a short ride, and my room is huge: Separate living room and bedroom, 2 tv's even. (And perhaps a US thing: an empty fridge instead of a minibar).
Since I won't have much time to see downtown Chicago later this week, I went there this afternoon. Saw some nice things, had a nice diner, and went back to the hotel.
Right now I'm sitting in the lobby with a bunch of the people that are also hanging around in the #phptek IRC channel. With everybody having different IRC nicks and different twitter usernames, it's a bit difficult to know who's who though. Some people can easily be recognized from their avatar, but others look completely different.
There isn't much PHP news worth mentioning yet, but it's still only day -1. (Except maybe for the Zend news from today; I think Andi can expect some questions about that during his opening keynote on wednesday.)
In any case, I'm looking forward to the actual conference. Tomorrow is tutorial day. Still haven't decided if I'm going to sit in on the ajax, web services, social networks or phpunit sessions, or maybe just hang out.
Book Review: php|a’s Guide to Programming with Zend Framework
April 18th, 2008 by Ivo
I've recently read Cal Evans's Zend Framework book.
Before I voice my opinion, a disclaimer: I have met Cal personally; in fact I'm having diner with him next Monday, I'm writing a book for php|architect, and my company is a Zend partner. I could not be any more biased.
If you still trust my judgement (and I will try to remain objective), read on.
First of all, the book is fun to read. I like Cal's writing style. He's able to teach stuff while keeping it light and funny. And that works; the book is never dull so it's easy to read in a short time frame. (I never read things in a short time frame though, still took me a month to read it, but that's me; not the book.)
The book first covers the important bits of ZF, such as setting up a ZF application, and working with views and the controller.
What I really liked was that Cal covers the Model properly. Recently there was some fuzz: the now infamous 'heckler at the phplondon conference' called framework authors 'criminals' because they called their frameworks MVC while they only provided Views and Controllers. Cal discusses how to use both a thin model (just a wrapper for the database) and a thick model (business logic) in a Zend Framework application. The book demonstrates, with example code, that you don't need a 'Model' class in the framework itself to work with a Model. A Model is application specific anyway, it contains the business logic of the application. This was refreshing. It was almost as if it was written because of the phplondon incident but the book was written well before that.
After covering all the important bits, some less important but nevertheless useful topics are covered: caching, web services and two-step views (layouts).
The book is full of code samples, and from the book's website you can download the sample code so you don't have to copy the code from the book manually.
Of course, I also have a little criticism. In some parts of the book, things are explained rather quickly. In particular in the web services part, I had to reread some parts a few times before I grasped them. I had the feeling that the rest of the book had a calmer pace, which made it easier to understand what was explained.
Also, there were a few bugs in the book, in particular spelling. However I must be careful to say that, my book might have the same issue.
Regarding bugs in the example code; Cal keeps track of them at the book's companion site, so if you run into an issue when running the sample code, first check the site to get the latest code.
All things considered, it is a useful, well-written introduction to the Zend Framework. I can recommend anyone who just started working with the framework, and anyone considering to use it, to read the book. It will not only show you how to get things done, it will also give some insight into how the framework works and why things are the way they are, and this greatly helps to understand the framework.
My first 48 hours with Twitter
January 7th, 2008 by Ivo
On friday night I created a twitter account. I didn't 'get' twitter, and I've read that it's 'hard to explain' and people 'only get it once they've used it'. So when I saw that even Cal Evans is using it, I had to finally try.
At first I thought it was a form of instant messaging. And while it has some of its characteristics, it's different. I think it can best be described as 'broadcasting your current status'. To people who want to see it. Like the status field you have in applications like MSN and Skype. Elizabeth described it to me as 'more like IRC', and she has a point. It's like IRC, without channels. The '/me' command on IRC is very twitterish even.
Messages are never more than 140 characters, which helps keeping them to the point.
People don't just post their status: it's used a lot for 'look at this' type messages, usually some url that someone has just read and wants to share.
What I like about twitter so far:
- It's simple; it broadcasts a message to people who want to receive it, and that's about it.
- It's open; it has API's which have led to a lot of tools and devices supporting twitter. I have Twitterrific to read messages, and can easily send them through Quicksilver. My tweets are displayed on the right of my blog using a simple wordpress plugin.
- It's addicitive. It gives you a feeling of connectedness, more even than instant messengers.
What I don't like about twitter so far:
- Twittering via SMS is too intrusive; twitter with my mobile phone's browser is decent, but requires me to login each time (but maybe that's a problem with my phone, not twitter).
- There's the danger of information overload. Some people twitter so much that they easily dominate the twitter screen (example: going to the zoo, coming back from the zoo, looking at the pictures from the zoo, discovering there are a lot of pictures from the zoo, filtering the pictures from the zoo, uploading the pictures from the zoo, announcing the pictures of the zoo on flickr and all the tea-drinking that happened in between; hi Skoop!
). I can see this becoming overwhelming as I follow more people.
- Direct messages are inconvenient, I can't see my outgoing stuff; but then again, that's not what it's for.
- I miss a way to channel messages; some things are only relevant to my friends from the PHP community, some only for my coworkers, etc. But with twitter you only have individual messages and messages to all.
In any case, it's interesting so far. Let's see how I feel about it in a week or two.
Finally, a smartphone
December 12th, 2007 by Ivo
Since my phone broke down a few months ago, I've been temporarily using a Nokia 6021. This is about the most basic phone you can get: you can make phonecalls and send sms messages, and that's about it. But at least I had something, while I was selecting a new phone.
I had a few requirements:
- I want to use the phone as a modem for my Macbook Pro, via Bluetooth
- I want to read my email on it, preferably using UMTS or HSDPA
- It should have a decent size (fit in the pockets of my jeans)
- It should be reliable
- It should have a decent camera (my experience with cellphone cams is that they usually suck)
- I want to check my Google Calendar on the road
I could wait for the iPhone to become available in the Netherlands. Most important drawback however is that it features only Wifi and Edge to go online. I don't know about the US, but over here Edge is like going back in time. Also, they support only one operator, and it looks like it's not going to be the operator my company uses.
I also had a look at several HTC models. Their Smartphone range looks really nice and I have about 3 colleagues using HTC phones. I didn't buy an HTC in the end because I read many reviews reporting crashes, freezes and other instabilities. Not all users are affected by this, but since I will be using it a lot, chances are that I would be encountering issues.
I finally ended up with a Nokia N95. 3 of my colleagues recommended it, and it satisfies all of the above requirements. On top of that, it's just a pretty damn cool phone.
After having played with it a few hours, I have a few preliminary remarks.
Plus
- The interface is pretty smooth, and even though menu options aren't always intuitive, it's fairly easy to use without consulting the manual. (but then again, I'm a geek)
- It does everything I expect it to.
- It has a great camera (5 megapixels!)
- The coolest thing I did sofar is installing Google Mobile Maps with the built in GPS. It doesn't just look nice, it works great too.
Minus
- Connectivity is a bit confusing. It supports so many protocols that it's not always clear to me what it's using, if it's connected or not etc. (But maybe this is something I still have to get used to, I'm not very familiar yet with phones that go online.)
- The email client is very limited, I can't use IMAP folders, and my inbox is fairly unusable without filtering, given the amount of spam and automated emails I get. (Suggestions anyone?)
- The main screen isn't as customizable as I'd like (or I haven't found the proper settings yet).
- It's pretty expensive.
It's too early to say anything about battery life etc. yet, but with my iPod and Tom Tom I'm already used to docking stuff at night. If it lasts throughout the day, I will be satisfied.
So far, I'm pretty happy with it. Now that I think about it though, I haven't made a single phone call yet
. So should you call this a phone? You can apparently play for hours without using the primary feature it was made for in the first place.
Oh, one last thing, or actually 2.
One: it's strange that a phone that runs Symbian OS instead of Windows Mobile, supports only Windows for their firmware update tool. Had to use VMWare under OSX to get my firmware updated.
Two: why do phones still not properly deal with moving contacts from one phone to the other? Sure, it supports bluetooth, wifi, infrared etc. to sync contacts. However, to sync them, you need to have your SIM card in both phones (even though the contacts are on the phone itself), but I only have a single card. (Luckily, a bit of SIM card juggling and Apple's iSync on the Macbook did the trick).
Quick Zend Framework review
March 5th, 2006 by Ivo
This weekend I've taken a look at the initial release of the Zend Framework.
The first thing I've noticed is that authors of frameworks can sleep soundly again
, as the zend framework is not yet a framework (in the wikipedia sense of the word).
Currently, it's more a component library containing all kinds of useful components. This does not have to be a disadvantage though, because this makes it very easy to integrate with other applications and existing frameworks. In fact, there are some components such as the pdf and mail classes that are very useful for certain types of web applications, and it is fairly easy to use them in an application that was built using an existing framework.
People expecting a kind of 'ruby on rails' for php have to wait a little longer though, as the Zend Framework is not there yet.
When diving into some of the classes, there are some decisions that I don't quite understand. For example, have a look at Zend's implementation of isReadable. It is a wrapper for PHP's is_readable, with the addition of also taking the include path into account. Since this is a very useful feature in many occasions, why not enhance PHP's is_readable function with this functionality? Especially since it's just a small enhancement, so in my opinion, it would be better to put this directly in PHP, instead of in wrappers. (the same goes for some of the other framework methods that are wrappers for some existing functionality.) Putting stuff in wrappers is, in my opinion, a bad way of enhancing functionality. Suppose wrapper 1 adds functionality A, and wrapper 2 adds functionality B. If I'm in a situation where I need both A and B, I have to take one of the wrappers and implement the other feature myself. So in the case of 'low level' methods such as this, I'd rather have the functionality in the base function instead of in a thin wrapper.
Another functionality I have some doubts about is the registry. It is advertised as a method to handle singletons. In my opinion, the fact whether a class is a singleton should be handled by the class itself. The application author should normally not need to make the decision whether some class he is using should be a singleton or not. Also, the concept of a singleton's getInstance() method ('give me an instance or create one of there isn't an instance yet') seems to be lost in the zend framework registry, as there is no such method and the application author needs to define his own 'if it's not in the registry yet, add it' logic.
The RSS feed functionality is nice, and would be even nicer if it had methods for creating feeds instead of consuming them. This type of functionality however is typically something that would be useful to have available as a separately downloadable, dedicated library instead of as a standard part of the framework.
The other components all seem useful and nice too. There are definitely components that I'm going to use in applications I'm working on.
Overall, the Zend Framework looks promising. I think that at the current state, the zend framework falls in the category of libraries such as PEAR and ezComponents. All of them provide a wide choice of generic components. I think the stuff that would make it an actual framework are still missing, (but the model/view/controller classes are a step in that direction), but this has the major advantage that frameworks such as Blueshoes and ATK are not actually competition, but potential users of the zend components.