Archive for the 'Programming Tools' Category

Chrome, Gears & XUL

Tuesday, September 2nd, 2008

I’m writing this post in Google Chrome. Google’s beta release of the Google Web Browser. It took me some time to download and install Chrome because the download site is obviously swamped mere hours/minutes past it’s “exciting” launch.

First impressions? Very clean and simple. The Chrome is almost not there.
And it’s fast. It renders pages very fast. Very fast. Faster than anything I’ve used before. Wordpress is running nicely, the embedded Gears and the Javascript optimisations probably have a huge benefit for Wordpress sites due to the heavy use of Javascript techniques used in it. And Gmail? Scorching performance.

So far, the performance is the killer USP.

No rendering issues on any sites I’ve tried so far.

The big drawback? Lack of features. I guess it took Firefox quite some time to get to the point that I have my perfect profile, with use of firebug, HTML validator etc. But it is so simple and clean. To quote page 24 of the comic (which I can’t find a good way to deeplink, so won’t):

 

We don’t want to interrupt anything the user is trying to do. If you can just ignore the browser we’ve done a good job. 

 
They have done a good job. The browser is not there, in a way that Firefox and IE7 sadly are.

The question for me earlier today was Why? Dare says it’s because they want to drive the web forward, which is backed up by their comic and what they say on their blogs and posts and brochure pages. They live and die by the web. They are producing some of the best, or most influential at least, web based applications. And their ability to develop these and move them forward is stifled by the pace of browser development in IE, Firefox and other products.

The pages in the comic complaining about “Speed Limits” on the web etc seem to back this up. For them, the claimed point of Chrome is to show people what a fresh look at the web could be. Faster. More powerful. Safer. Better. More driven by the Google Ethos and approach to building great, inovative products that push the industry forward in big jumps.

Of course, not everyone buys into this. Microsoft Watch see it as a cynical thing. Killing their partners.  Some kind of anti-trust, Google doing evil, making the wrong move for a fair market etc.

I don’t think I buy into that.

Earlier today, my thoughts ran on the lines of, this is a bad idea and it won’t work. According to Google’s figures, 40% of their users are on IE6, 40% on IE7 and 16% on firefox. Talking to colleagues at work, who are all internet developers. Geeks. The people who live on the web as much as Google, a lot of them use IE because it’s on their PC and it works. They don’t want or need anything more. That 16% Firefox figure comes from Firefox being the best thing on Linux. From Firefox being the best non-Microsoft solution (for the religious out there). And being pretty damn good for customisation. But, I would hazard the opinion that the market is not 100%. There is a significant portion of that market that is not, and never will be, up for grabs.

It’s my family, they’ll only use what’s on their desktop. They don’t know or care why firefox might be better for me to use. It’s not going to change them using IE because it’s there. Microsoft’s bundling of IE was clearly anit-competitive black had because of this. And the number of corporate environments with lock downs that allow the net, or their intranet, but only via IE as it’s part of their OS and can be locked down as such.

So, that makes Firefoxes market share bigger. So Chrome is competing with maybe the 16% Firefox marketshare, and 10% of the IE share that hasn’t moved but could. And the niche things.

So, is Chrome really about forcing inovation? It’ll force it in that niche away from IE, and Microsoft might pull along. But only if it’s really good. I didn’t beleive I’d use it for more than 10 minutes. Now, having used it for a little while, I plan to install it at work too. And live with it for a while. It’s that good. In beta 1. With very few features.

And it’s so fast. Firefox 3 was a lot faster than Firefox 2. If Chrome had come out before FF3, I may never have installed FF3. Because it’s so fast. CLEARLY faster than FF3. Which when I first switched to from FF2 felt so much faster. And when I went back to FF2 on an older machine I hadn’t upgraded it was painful. Will I hurt in Firefox3 at work in the morning?

So Firefox needs to start worying. It needs to look at V8. It needs to pull some of this stuff in and catch up.

Chrome could get a good fast uptake and make a very significant dint into that 16%.

And it doesn’t have adBlock.

Ah, now I’m suspicious. Of that 16% marketshare that firefox has, how many users do you think have adBlock or GreaseMonkey or another script that takes that crap off the web? That removes Googles Ad revenue stream? I’ve not seen an advert on the internet since I switched to Firefox with early versions of adBlock. And I use the web a lot. And I know that most Firefox users have something like adBlock running.

So is it about revenue? Chrome is Open. I assume it will have/does have plugin support. Will adBlock for Chrome come? Or will Google keep that out of it’s ecosystem? Is Chrome about revenue? Switch people to Chrome, remove adblock, get the chance to show people more ads. In return for faster, safer browsing with richer applications.

(I’ve just noticed my CPU pegged at about 30% on task manager. I’ve checked the task manager in Chrome. Shockwave was eating CPU. I’ve killed the tabs with Shockwave in, and now the browser is a ghost in my system eating no resources at all. Neat.)

But, Chrome is about inovation we’re told. Yet doesn’t support XUL, Mozilla’s XHTML + Rich GUI markup language. That is something I thought would be a great thing to see grow. That could give the real edge to these rich applications that Google want Chrome to enable. I assume it’s lacking due to the use of webkit. But, with v8 powered XUL, the things you could build would be awesome.

It’s going to be a case of time will tell I assume. I think it looks positive. This morning when I heard the news, I couldn’t see the point. The competition (Firefox, Safari and Opera) are too far ahead. Google too far behind. Now I’ve used the “vision”, the speed, cleanliness and disruptive new thinking are converting me.

Chrome + Gears + Google’s web applications could be a massive boost in creativity, development and forward motion that the web as an operating system/platform for the future of computing really needs.

Popularity: 53% [?]

Evaluating Platform Choices

Saturday, June 16th, 2007

So I’ve reached a point where I know what the application I will write needs to do. The next logical step is to design that application. However, before I do a design, I need to have a “big picture” idea of the software architecture and I need to know what third party code libraries I can use.

As I noted, choosing a language is choosing a platform:

This was something I was planning to move on to talk about in more detail later. When you pick a language, you do need to look around at the choices of libraries available to you. PHP is lucky. It’s mature. There are a lot of libraries out there.

But, you must be very careful when confronted by such choice. Take a look at the options available for templating. Pear (a major source of libraries) have several implementations. There’s Smarty, and numerous other “just templating” libraries. The new Zend Framework also has a templating implementation.

I need to make a very careful set of choices when choosing what libraries to build on, if you choose the wrong items, and get them fundamentally embedded into your application, at a later date you have a much bigger job to replace them. Possibly a fundamental re-write.

Now, I’m wanting to make use of standard design patterns to make sure my application architecture is maintainable, controllable, extendible and scalable. So I’m going to be following standard Object Oriented software design using standard design patterns. I’m going to utilise Model View Controller (MVC, or in Microsoft Land Model View Presenter), Database Abstraction Layers, Singleton Patterns and other things.

AS noted, PHP is very mature, there are a lot of choices. Some of those choices are more mature than others. Some are big and bloated, some a trim and limited. It’s essential I make the right choices.

I’m going to spend the next few articles examining database abstraction libraries and templating engines. Then move on to look at design pattern libraries to support an MVC implementation. But, first I need a good set of criteria to compare them on. I need to look at the following:

  • Performance
  • API details (will it do what I want flexibly enough, will it lend itself to integrating with other libraries and my own code?)
  • Documentation (will I be able to figure out how to use it?)
  • Is the project alive and moving or is it dead?

Critical to me most of all is performance, I don’t want the PHP engine to have to process thousands of kb of useless code that will never be called by my code, just to get some trivial feature. So I need to find a way to asses this. The first stop on this route is to get some profiling tools installed into my development environment, so that’s what I’ll do next.

Popularity: 24% [?]

It’s All About Having the Right Tools

Sunday, April 29th, 2007

I’ve been doing a lot of DIY lately, after we had some building work done. Painting walls, laying new flooring, putting on new skirting boards, putting up new blinds and curtain rails. I’m not very practical, so my Father-in-Law is usually drafted in to help. One thing has become abundantly clear.

It’s all about having the right tools.

About 6 years ago when we moved into this house we turned the old owner’s kids bedroom into a grown up guest room. In the process we put coving up. This involves cutting stuff at 45 degree angles to make corners. When we did the coving, we used a Coving Mitre:

Coving Mitre

This is an odd shaped bit of plastic which can be layed at various positions on the coving to guide a hand-saw into cutting the right angle. It’s fiddly, and a pain in the ass to be honest. And because you are hand-sawing it’s hard work, and you can’t just nibble a couple of millimetres off. It was a long hard job.

A year or so later, when we put up some Dado Rail in another room my Father-in-Law had bought a Mitre Saw:

Mitre Saw

This makes it a lot easier to keep the saw in the right position and cut the angles. It clamps the wood in place. It made the job much faster. But it’s still impossible to cut a couple of Millimetres off a slightly too long piece of dado.

Last week, we put up skirting boards. Now my Father-in-Law has bought a Power Mitre Saw:

Power Mitre Saw

With this bitch you can do anything. It’s trivial to cut any angle in anything. You can trim a millimetre off the end of a bit of skirting in a second. It makes the job faster and easier.

When we were laying the flooring. My Father-in-Law cracked out his jigsaw and a Square (thing for getting right angles dead straight). Tools I don’t have, I’d have struggled with a big handsaw, a hacksaw and a steel ruler. And it would have taken ages and been crap.

It’s all about having the right tools.

Since this experience, I’ve decided. There is no point in doing a DIY chore without the right tools. And it’s no use going for the cheap-o option (the Coving Mitre) I need to get something decent. The Manual Mitre Saw would have been the best option, balance of cost and utility.

I’ve bought a cordless drill with a set of drill bits and screwdriver bits. I’ve bought a spirit level. I’ve bought a hacksaw and numerous other tools I’ve been doing without. The DIY I’ve been doing since has been much much more productive. I had to assemble some flatpack furniture yesterday. Normally a chore that takes hours and leaves me with hands sore from the screwing in of a million screws.

Yesterday, I used my cordless power drill and a couple of screw driver packs and had everything together in no time at all. Today, I put the curtains and blinds back up. Screwing them in took seconds, and I used the big spirit level with the built in ruler to make sure they’re level and centred on the window. And it took much less time than the blind I put up in our bedroom a couple of years ago, which wasn’t straight.

I still have to get my Father-in-Law round to do something if I’ve not done it before, and to show me what the right tools for the job are. But, my DIY is light years ahead of where it was 6 years ago.

It’s all about the having the right tools and knowing when to use which tool.

This isn’t just true of DIY. Take photography. When it comes to taking pictures of small children, you need the right camera. I’ve got an old 4 megapixel Nikon Coolpix 4300 at the moment. I bought it before my kids were born, and used to take pictures of landscapes on holiday, or us by the pool on holiday. Great camera, lots of control over what it does.

But it’s useless for taking pictures of kids. They don’t stay still looking cute for more than 2 seconds at a time, and the shutterlag on the Coolpix is about 3-4 seconds with a 10 second minimum delay between taking shots. It’s a useless tool for taking pictures of little kids.

It’s not just true of photography and DIY, it’s true of software engineering. Sure, you could write a full blown replacement for Microsoft Office using a command line compiler and notepad. But it would take orders of magnitude more effort than doing so using a rich IDE, powerful debugging tools and suites of standard components.

I know that I’ve said that coding is not like building a house. But, there are things they do share in common, such as the impact of trying to do a quality job in a decent time with the wrong tools.

It’s important that as a programmer, you have the right tools and you use them for the right job. Make sure that you are using the best programming editor for your language, if you aren’t, get the best or as near it as your budget will go. Make sure you have a debugger, profiler, lint tool, test tool. Make sure you have all the tools, and make sure you know how to use them. If you do, you’ll soon be producing better software faster.

If you aren’t, it’s not the right tool, or you’re not using it at the right stage.

Popularity: 16% [?]

Choosing a Language is Choosing a Platform

Tuesday, April 17th, 2007

I’ve already posted an article about choosing a platform for your development. I missed a very important point, when choosing a language to develop in you also buy into the platform available to you, in this context, this means the third party libraries and supporting frameworks available to you. And as Jeff Atwood points out:

When you choose a language, like it or not, you’ve chosen a platform. And as Steve so patiently and calmly explained to all the Lisp enthusiasts, the platform around the language, more than the language itself, sets the tone for your development experience. The availability of common, popular libraries and the maturity of the development environment end up trumping any particular significance the language holds.

This was something I was planning to move on to talk about in more detail later. When you pick a language, you do need to look around at the choices of libraries available to you. PHP is lucky. It’s mature. There are a lot of libraries out there.

But, you must be very careful when confronted by such choice. Take a look at the options available for templating. Pear (a major source of libraries) have several implementations. There’s Smarty, and numerous other “just templating” libraries. The new Zend Framework also has a templating implementation.

There is a lot to choose from. Making the choice to go Pear::Flexy because that fits in with your use of Pear::DB, or to make use of the entire Zend Framework might be completely the wrong thing to do. You might want to create your own lightweight abstraction. Or go for something like SimpleT.

Picking a language with a small platform footprint can actually be better than picking a language with a large platform footprint.

But I’ll be talking about the costs associated with blindly using a library from the “PHP platform” for every project. When all you have is a hammer, everything looks like a nail. If you only have one type of hammer, that’s not worse than having a whole basket of different hammers.

Popularity: 28% [?]