Zend Framework in Hardy

Posted on February 29, 2008
Filed Under PHP, Tech, Web development | 1 Comment

Hmm, nice step: the Zend Framework will be included in the repositories for Ubuntu Hardy Heron, scheduled for release in April. Not that the average developer wouldn’t be able to obtain a copy of ZF otherwise, but it’s nice that it will be included.

Let’s hope updates to the Zend Framework will be ported rapidly into Ubuntu, so Ubuntu/ZF users wille be able to truly depend on the packaging system.

__DIR__

Posted on February 23, 2008
Filed Under PHP, Tech, Web development | Leave a Comment

It’s those little things: in PHP 5.3, the constant __DIR__ will be available. Of course, this is the same as the output from dirname(__FILE__), but it makes life just that little bit easier.

Conference!

Posted on February 21, 2008
Filed Under PHP, Tech, Web development | Leave a Comment

The Dutch PHP Conference, which I went to last year, is getting its second edition. It’s a bit more expensive than last year, but I’m certainly going to consider attending.

I’m a snob

Posted on February 17, 2008
Filed Under Mac, Non-tech | Leave a Comment

Well, no, I’m not a snob, but I’m getting close, according to this list:

Mac owners are more likely:
1. to be perfectionists
2. to use notebooks
3. to use teeth whitening products
4. to drive station wagons
5. to pay for downloaded music
6. to go to Starbucks
7. care about “green” products and the environment
8. to own a hybrid car
9. and last but not least … to buy 5 pairs of sneakers in a year

I’m a Mac owner. In fact, I recently replaced my MacBook Pro with.. well, a MacBook Pro. You know, “it was time” for a new one. So I should have a look at the list:

1. Perfectionist: a bit. Sometimes. When time allows, I want what I do to be done well. And that borders on perfect. So yeah, check this box.
2. Duh.
3. Apart from tooth paste: no.
4. I don’t have a car. Hell, I don’t even have a driver’s license.
5. Yup. Sometimes I grab an album from Usenet, but most of the time I get my music through iTunes.
6. Whenever I’m near a Starbucks, which is at least a few days a year (there’s no Starbucks in my city), I’ll get me a Caramel Macchiato. Yummie!
7. Green-ish. Maybe a bit. I have some CFL bulbs in my lamps, and I turn down the heating when I open the window, and I separate used paper from the regular waste, but apart from that.. nah, not more than others.
8. I don’t have a car, so no.
9. I don’t own five pairs of sneakers, but I do wear Converse Chuck Taylor All-Stars. Exclusively. And in the last year I bought three pairs. And yeah, within a few months I will probably have bought another pair. So let’s check this box.

So, that’s about five out of nine. Does that make me a snob? I’ll leave others to be the judge of that.

Five things I like about Zend Studio Neon

Posted on October 13, 2007
Filed Under PHP, Tech, Web development | Leave a Comment

For the last two months, I have been using a new Zend product as my default PHP editor. I haven’t blogged anything about it, because until last week, it was a closed beta.

At ZendCon ’07, however, the beta of Zend Studio Neon (with Neon being the beta-name) was released to the public, inviting everyone who’s interested to the party. So now it’s okay to blog about it, and I would like to take this opportunity to name a few things that might cause Neon to become my default editor, permanently.

1. Custom formatting
In the classic Zend Studio, you can select a piece of code and have Studio re-do the indenting of that section for you. Very handy when you’ve messed up your code in some way, or several CVS commits from different people have thrown the structure out of whack. In Neon, this feature works even better:

I can configure exactly how I want my code to look: where I want my spaces, where the braces should be placed, how the code needs to be indented and lots more. I can configure the formatter to follow my personal coding standards, select a piece of code and have Neon apply my standards to the selection. Brilliant!

However, Neon doesn’t remember my preferences, so I have to export them whenever I make a change and import them every time I start Neon. Also, a few bits of my prefs cannot be configured, such as the way arrays should look when you divide the declaration over multiple lines. But I expect Zend to be looking into that, as several of the closed-beta testers have already mentioned it in the testers group.

2. Easy compare and CVS-integration
When Neon recognises a project to be a checkout of a CVS-module, several options are added to the navigator (the outline of files and folders on the left side of the screen). To name a few:
- Every file that has been changed is visually marked as being different from CVS. This makes it easy to find what you have changed and might be ready to be commited into CVS.
- I can update and commit from the navigator. The classic Studio had this as well, but it was useless because the following feature was missing:
- Compare! I can right-click a file and compare it to the latest version from CVS, or a specific revision, or just compare it to another file I also selected. The ability to compare makes it possible to check if the file I want to commit is ready to be commited: I can see all the changes and if I left in some junk (an echo, some commented-out code, you name it), it shows up as a difference and I can edit it while still in the compare screen. Brilliant! I’m used to the way Kompare works, and frankly that one has a better overview of the changes, but Neon makes a good second best, especially when combined with the CVS options.
- Neon acts as a complete CVS client. I can change the revision of a file, create branches, browse the history of a file, commit several files at once and more.

3. It’s more than a PHP editor
Apart from writing PHP code, I do a lot of work with Javascript, XML, Webservices and such. I can open a Javascript file and it opens in a specific JS editor, complete with a preview screen which exectutes the file as if it were loaded in a browser. Or I can open a .xsd file and the XML Schema in it is shown in graphical form, complete with all kinds of functionality for altering the schema. It even shows errors I made in either type of file. Very, very nice.

4. Choose the PHP version per project
In the classic Zend Studio, I have to change the PHP version from 4 to 5 and back when working with different projects. In Neon, I can configure this in the project-specific settings, instead of editor-wide. Quite a time-saver, as it prevents me from looking surprised at my editor, wondering why it thinks a bit of code has an error when it clearly doesn’t.

5. Project-wide error checking
When I open a project, Neon checks all the files, both PHP and other types, for errors. When it finds them, the erroneous file is marked as such in the navigator, and so are all the folders above it. I can easily follow the path in the navigator to find the file with the error, fix it and when saved, the mark disappears. And of course I can commit it immediately.

The downside to this is a heavier editor, though. When a project resides on a remote server, and Neon startes opening and parsing them all, my computer gets very, very slow due to the heavy traffic. In fact, Neon already is very memory-consuming and needs to be shut down if I want to open something else that’s big in memory (a video player, for instance). I really hope Zend is able to do something about that.

There you have it, five things I like. There are also things I don’t like: the memory Neon consumes, the multitude of ‘perspectives’, editors, outlines and other screens I don’t really ‘get’ yet, the fact that even a closed project shows up in the navigator and some other minor things. But those are all little bumps in the road, and as Neon is still in beta, I’m not really worrying about it.

Developers always want to re-write

Posted on September 23, 2007
Filed Under PHP, Tech, Web development | Leave a Comment

Whenever I need to make large (laaaarge) changes in code that has been sitting in its place for a while, an exciting and a bit frightening thought enters my mind: “throw it all out and start from scratch”. Exciting, because starting to build something that you know is gonna be great simply rocks. Fresh, clean code without months or years of editing history is just lovely to work with. Frightening, because you know how long it took to create the existing code, you know how long other rewrites took to do and you know that this is no exception. Also, you know you are gonna have to address all the problems you had in the first run.

But the feeling that you should start from scratch is always there. In my own forum software, Replique, I already did this twice (although the second was a partial rewrite). With reasons and, fortunately, the desired result: a better application. In a CMS that runs at a website I work for, we also did it twice. And it will probably happen again in a few years.

And this is why. Just this afternoon, I stumbled upon Derek Sivers‘s weblog, who tried to rewrite a website in Ruby but failed miserably. Rafe Colburn replied to his and linked to a piece by Joel Spolsky, from which I quote:

There’s a subtle reason that programmers always want to throw away the code and start over. The reason is that they think the old code is a mess. And here is the interesting observation: they are probably wrong. The reason that they think the old code is a mess is because of a cardinal, fundamental law of programming:

It’s harder to read code than to write it.

And that is so true. As is probably true for most developers, my coding style has evolved over the years. Indentation, the placing of braces, the naming of variables and so on, when I look at how I did in a few years ago I scare myself. Did I really write this? Yes I did.

And it’s not just the style. Over the years, if you’re (aiming to be) a professional developer, you learn more and more new stuff. And every now and then there’s the urge to try out those new things. And every now and then one of those urges makes it into your code and stays there for years. When you look at it, years later, you know that you should have resisted the urge. Not that it’s bad code, of course not, you’re a pro. No, it’s just.. silly. The old method of doing whatever it was that that code did was just as good. You didn’t keep it simple, stupid. ;)

The Big Question you should ask yourself before starting a rewrite is: am I doing this because I want to, or because the changes I want to make need me to? Is it so damn hard to make the changes in the existing code? Does it hurt to just refactor the bits and pieces you are going to use? Will it hurt the performance when you don’t do the rewrite? Okay then, do it. If not: just make the changes and be happy about it not costing you time you could use for really new, fresh projects.

Zend Debugger documentation?

Posted on September 22, 2007
Filed Under Tech, Web development | 1 Comment

I’m working on a piece of PHP-code, and I need to examine if there are any bottlenecks in it. It’s not much code, about 170 lines, but there are quite some includes, object instantations, conditions, etcetera, and I can’t easily oversee if there’s anything that might cause a web server’s load to rise too much if this particular piece of code gets executed hundreds of times a second (I know that that is certainly going to happen).

So, what do I do? I do a quick check: do I have any debuggers or profilers running in the background which I can use to learn about this code? And I find there’s a Zend Debugger present, because I run a development version of Zend Platform.

Using get_extension_funcs() I know that the debugger has six functions I maybe could use, but I don’t know what they do. Can they give me some useful information? I don’t know. So I just call the functions to try them out. Nothing of use comes of it. So I decide to look up some documentation on these six functions.

Nothing on PHP.net. Nothing on Zend.com. Nothing on weblogs where Zend Debugger is mentioned. Nothing on forums. Nowhere can I find documentation on how to use Zend Debugger from my code. Doesn’t anyone use the debugger? Is it only meant for use in Zend Platform and IDE’s like the Eclipse PDT thing?

Does anyone know?

Software developers: please log everything

Posted on March 8, 2007
Filed Under Linux, Mac, Tech | Leave a Comment

Okay, this annoys me. Since a few hours, the wireless connection on my MacBook Pro is gone. No reason given. Of course I’m trying to connect back, while I’m using Google to find solutions when it seems I can’t solve this on my own.

MacBook ProThe problem is, my Mac recognises my wireless network. It can see my accesspoint, read its name and it asks me kindly if I would like to connect to it. Sure I would, so I press Yes. It then tries a couple things and comes up with the message that tells me connecting failed. No reason given.

Being both a Linux desktop user and Linux server admin, I have seen my share of failing pieces of software or equipment, and one of the reasons I like Unices to much is that there’s a whole bunch of logiles being kept in the /var/log folder, providing me with the how and why of these errors. Mac runs on a Unix-type OS, so during my wireless-problem I’m listing the files in that folder, sorted by date and time, and I’m using tail to view the latest entries in what seems to be the only active log file: system.log. Indeed it shows me some errors, but there’s nothing corresponding to the pop-up message that told me the connection to my accesspoint failed. Nothing! Not a single logfile seems to have updated with information I can use to solve this problem.

And I’ve seen that before: software that’s dealing with its problems all on its own, without asking for help or enabling the user, me, to find out more using Google or my own knowlegde. That is a mistake. If you create software, make sure you have nice friendly error messages for the average user. That’s important. But the “extra mile” in this is just as important: make sure you write every error into a log file and point me to it in case it’s not system.log (or syslog or messages or anything that can be considered a default). Make sure enough information is in there to enable me to exactly understand what’s going on. I am a technical user. I understand technical information if it’s described in a human-readable way. I can think for myself and come up with solutions, or spend time pasting the log entry in search boxes to I can find other people’s solutions.

To me, having enough information is very important. So, software developers, please log all those information somewhere.

Don’t do flash intros!

Posted on February 22, 2007
Filed Under Internet, Tech, Web development | 2 Comments

Paolo asks whether it’s a good choice to start a promotial site for Italy with some flash intros. I think it’s not. This is what I posted as a comment:

I don’t like the flash intro. It has no use whatsoever and it makes me wait. So if they could drop that one, it would be great.

Second, I get the intro with the language choice. Now, that one does have a function, but I would guess that the majority of visitors speak English, so it’s probably better to open with the English site and make it clear that an alternative language can be chosen.

I don’t really mind the third flash thingy on the site itself. After all, it’s a tourism site, so some sights of the country are okay, as long as all the information can still be easily found.

Flash intros really are something from the past. Or at least, that’s what I thought. When people started discovering this ‘new easy way of creating animations on the web’, people built entire sites in them. That was okay, back then. As were the intros. But please, it’s 2007. We know that flash intros have no additional value, what-so-ever, to a site that centers around giving information.

So to all you webdevelopers out there, pondering on the possibility of a flash intro: don’t. Please don’t.

Read my CD’s, please!

Posted on November 2, 2006
Filed Under Mac, Tech | 5 Comments

I’m having serious trouble with my Mac. It won’t read some of my CD’s, which severely limits the possibilities of iTunes shuffling through my entire music collection. Or my iPod, for that matter.

It’s really strange, too. When I insert a CD into the drive, it makes some noise, which indicates that the CD is being read. After about 20 seconds, the CD ejects. Just like that. No reason given. I have tried to look up any form of logged error, but the usual place where errors are supposed to be written down, the /var/log folder, doesn’t mention any problem at all. Just accept the CD being inserted, make noise, eject CD and don’t tell the user.

Why is that? Why does it eject the CD’s at all? When it has a problem reading them, pop up some message explaining it, or put an entry in the system.log. Don’t just go ignoring the fact that I want to read that CD!

Anyway, half of my CD collection is useless this way, because I never play CD’s on a regular CD player. I hate that. I love my Mac, but this is really annoying.

MySQL Administrator is weird

Posted on June 30, 2006
Filed Under MySQL, Tech | 1 Comment

I’m an admin for a MySQL database server, and today I needed to add a user account. I’m used to doing this using the commandline program or phpMyAdmin, but today I thought “let’s use the nifty MySQL Administrator for Mac,” a GUI tool, very much point-and-click and supposedly easy to use.

Or so I thought. For creating a user, you need to fill in, of course, username and password. When you want to save that, you get notified that you need to add a hostname for the user, first. That makes sense, because in MySQL, a user consists of a username and a hostname. So I press the tiny icon that seems to mean “add host”. Wrong, MySQL admin tells me. I need to save the properties of this user before I can add a host. Allright, but I just tried that.. but whatever. Pressing Save again.. wrong again! Need to add a host first.

As you can see, I can fill my day with this. The MySQL Administrator is no good. Back to the drawing boa.. eh, the commandline tool. At least those things always work.

Ubuntu is here

Posted on June 1, 2006
Filed Under Linux, Tech | Leave a Comment

The new Ubuntu is out. It’s version 6.06 LTS, in which LTS stands for Long Term Support. For desktops, this means that for 3 years, packages wil be kept up-to-date with security patches. For server users this is 5 years.

Ubuntu logo

I run a few Ubuntu machines myself. Some desktops, some servers. My desktop PC at home was the first one. It started with Ubuntu Hoary, now runs Breezy and in a few days or weeks, when I have time, it will be upgraded to Dapper, which is the code name for 6.06.

Ubuntu is easy to use, based upon Debian, which rocks, and alltogether a great platform for any desktop or server. Really. You should try it!

MacBook heating

Posted on May 19, 2006
Filed Under Mac | 1 Comment

I’ve seen some posts, on some blogs, about the SMC firmware upgrade that Apple released this week. I installed it, so whatever has been written about it, I should be able to check. TUAW and others write that the upgrade causes the MacBook Pro to run cooler.

Well, I still think it’s a bit hot at times, but yes, it is cooler. Not very much, but I think it’s just enough to make it slightly more comfortable. So thanks, Apple, for the upgrade.

Auto-ping SYO

Posted on May 14, 2006
Filed Under Blogging, OPML, Tech | Leave a Comment

Dave Winer: “I’ve written code that allows you to set up NewsRiver to automatically ping SYO when your subscriptions change.”

That’s great. I’m developing an aggregator myself, and I was thinking about auto-exporting the subscription list to SYO in some way. I hope Dave’s feature will have an API, so aggregators can all connect and contribute.

Share Your OPML

Posted on May 8, 2006
Filed Under OPML, Tech | Leave a Comment

Dave Winer has released a reincarnation of the Share Your OPML site. You can, well, share your OPML there, and the site will build all kinds of statistics for you. I have some notes here.

TechCrunch has a review.

Guess what? No whine!

Posted on May 3, 2006
Filed Under Mac | Leave a Comment

Allright, the MacBook Pro arrived yesterday, and like a kid at Christmas, I was very happy to be able to start using it. What a great machine. It’s thin, light-weight, looks great and is really fast. Also, Mac OSX is quite nice to work with, although I still need some getting used to.

The problems I was afraid of? Almost none. Really! There’s no noise. Not from the screen, not from the CPU, fans, harddrive, etcetera. It’s silent, and I like it. There’s only one thing: it’s hot. The left-hand side of the body gets considerably hotter than the right hand side, and when resting my hand on it for a while, it gets irritated a bit. I don’t know if that’s just getting used to, or really a manufacturing mistake. I’ll see how it works out for me the next couple of days.

All in all: I’m very happy. It’s a cool machine, nice to work with, fast, easy… I love it!

Links for tuesday the 2nd

Posted on May 2, 2006
Filed Under Mac, Tech, Web development | Leave a Comment

Metadata as a ‘filing system’ – about using Spotlight and tags on your Mac.

Fixing AJAX: XMLHttpRequest Considered Harmful

Yahoo! Tech – Nerdy, gadgets, stuff, cool! (but damn, the site is slow)

Apparently, the MacBook Pro is too hot.

Keep your Mac(Book) safe

Google Importer – search Google with Spotlight

Linux for human beings – Yet Another Ubuntu Blog?

MacBook in transit

Posted on May 1, 2006
Filed Under Mac | 1 Comment

I’ve been looking at a TNT tracking page for the past few days. My MacBook is paid for, assembled and on its way to me. Today it arrived in Amsterdam:

02 May  13:18  Rotterdam   Delivered
02 May  09:57  Rotterdam   Out For Delivery
02 May  05:52  Rotterdam   Import Received
01 May  19:38  Arnhem Hub  Consignment Received At Transit Point
01 May  19:35  Arnhem Hub  Consignment Passed Through Transit Point
01 May  14:21  Amsterdam   Consignment Received At Transit Point
30 Apr  14:32  Shanghai    Shipped From Originating Depot
29 Apr  10:06  Shanghai    Consignment Received At Transit Point

Now, I live in Rotterdam, and I assume that all TNT has to do is bring the thing to me. So I might have it tomorrow, unless for some reason it doesn’t get picked up from Amsterdam. To save myself from dissappointment, I won’t get my hopes up too high, but I’m getting really excited now…

Update: okay, it’s in Arnhem now. That’s not closer to where I live, but hey, if that’s the way it works, fine. Google searches on the phrases in the tracking table make me believe I’ll receive it tomorrow. Will I?

Update 2: and now it’s in Rotterdam. Unless something weird happens, it will be delivered today.

Update 3: out for delivery. That’s right. Give it to me baby. ;)

Update 4: it’s here. Time to have some fun.

The Mac story begins

Posted on April 26, 2006
Filed Under Mac, Tech | Leave a Comment

It’s kind of official now: My MacBook Pro is on its way. I’ve ordered it, paid for it, so all I have to do now is wait for it to arrive.

Update on saturday the 29th: it’s being sent out. Expected arrival: this week.

Links for monday the 24th

Posted on April 24, 2006
Filed Under Tech | Leave a Comment

Outliners and blogs

Portable OpenOffice.org – too bad it’s Windows-only.

My Journey to Macintosh – A Mac Newbie Blog, just what I need! – subscribed

« go backkeep looking »