@madpilot makes

Why do open source web apps suck?

I’m a professional web developer, so it goes without saying that I’ve seen my fair share of off-the-shelf open source web applications. I’ve also seen my fair share of web design companies take these applications and modify them up the wazoo to fit with clients requirements… Well, sort of. It is probably more likely that the sales staff have managed to convince the client that their requirements should fit in with what the open source project does. On behalf of all the web application developers out there who get lumped cleaning up the mess: STOP IT.

Modifying open source software seems like a perfect solution to managers – the solution is almost done, so surely it is just a matter of a few tweaks here and there, a splash of paint and Bob’s you uncle. Yeah – nah.

Here is somethings to think about before modifying an off-the-shelf to your next client.

  1. You can’t guarantee the code. Unless your developers has spent A LOT of time working with the application, they aren’t going to know the code. For them to become familiar, they are going to have to spend a lot of time getting to know it. This doesn’t save time, it wastes it. “But they will know it for the next client!” I hear you cry. Don’t bet on it. Unless you are doing the same mods for another client, they are going to have to spend the same amount of time investigating it next time.

    • Making core changes to a system is just asking for trouble – I hope the time you saved by using the system is re-allocated to testing the FULL application – you have no idea what you will break.

    • Skinning pre-built applications sucks. Trying to modify some else’s CSS is worse than someone else PHP. Just like modifying core code libraries and hoping for the best, it is really hard to know what you will break. That is of course assuming the application isn’t a spaghetti of tables, and includes that have little structure (Xoops, osCommerce, Joomla – I’m looking at you).

    • Open source developers are very narrow minded – their contributions are to suit their specific need, which means every developer will try to include their feature, and unless the leads are ruthless, you end up with a application that has everything that opens and shuts, but that doesn’t really open or shut very well. Not only that, you end up with a situation where there are thousands of different modifications that do the same thing. osCommerce is the perfect example of the mess this creates – I had to find a gift voucher module – and found at least 12 different variations of the same plugin, none of which worked. If I see YMMV on the end of one of these modifications I’m going to hit someone.

      • As soon as you modify software, forget about updating it. If there is a security fix, or a new feature, you will basically have to spend a similar amount of time re-patching the new version with your changes. If you wrote your own application, you can add a feature much more easily.
      • “Modules” are a misnomer, I am yet to see a decent module system for anything but the most basic feature – they all involving modifying code to work, which is you ask me, isn’t a module.
      • The documentation will never be up to date. On of the selling points of open source software is that you have thousands of developers at your disposal to fix and add features quickly – unfortunately, the documentation never keeps up. You better get used to reading source code.
      • Open source apps are hacked not engineered. Design by committee never works, design by ad-hoc anarchy REALLY never works – if the project doesn’t have a clear leader who has a vision and is ruthless in implementing it, you are going to end up with a mess.
      • Support. You don’t get any. Budget time for your developer to scour the ‘net for an obsure german forum where someone has found a solution to the similar problem you have had that may or may-not actually work.

      So when is open source the right thing to use? If the system does exactly what you want, then go for it. Want a blog? WordPress is an excellent blogging system, but it isn’t a content management system, so don’t expect it to work like one.

      Let me state that I’m making a big differentiation between applications and frameworks or libraries. I encourage the use of frameworks and libraries, because you can still control your code. You are leveraging low-level code, which is the boring stuff (for some) and you are left with building a system that your client actually wants.

      So please, continue using Rails or PHP or Apache or MySQL, but leave osCommerce and Xoops at the door. If you still want to use the latter, make sure you give your developers enough time to work through the issues you will have – about the same amount of time that you would have quoted on a custom solution in the first place should suffice.

And the results are in…

On Saturday I posted that 88 Miles was profiled on the Startups Carnival run by VS Consulting. Well, the results are out now, and 88 Miles came a extremely respectable 4th from 28 entries!

A big congratulations to Richard at Scouta for taking out the first prize and to GoodBarry and Suburb View for rounding out the top three.

Also hats off to OurWishingWell, who shared fourth place with 88 Miles.

88 Miles in the startup carnival

VS Consulting Group has been running an online startups carnival over the past two-weeks, profiling 28 up and coming Australian startups.

Today, 88 Miles is profiled.

It is well worth checking out some of the other entrants, including fellow West Australian Scouta.

A big thanks to Vishal for putting on such an “event” — it really goes to show that the SaaS-o-sphere is alive and well over here in Australia!

Spidermonkey and Ruby on Gentoo

Have you ever had had an inkling to interpret JavaScript with in your Ruby code? Well, I have, so I did some investigating and found Spidermonkey – the API that drives Firefox and Thunderbird’s JavaScript Engine. Being a C-library, it would be (relatively) trivial to write a Ruby interface – and thanks to the wonderful wold of the internets, someone has done just that. Unfortunately, the author is Japanese, and the documentation is sparse. Also, the code hasn’t really been updated since 2006 – but it still works, and thankfully someone else has decided to do a little work on it.

Anyway, here my instructions to install spidermonkey and the ruby library on Gentoo. These instructions may or may not work on other Linux distros or OSX (besides the obvious Gentoo specific emerge function).

Install Spidermonkey

Although the libraries links against Spidermonkey 1.7, running the tests ends in a segfault, so 1.6 is the way to go. If you have updated your portage tree, you will need to lock to the specific version:

emerge =spidermonkey-1.6

Install the library

I installed the updated version from matthewd’s git repository, although the extconf.rb file still needs a little tweaking. Also there are a few tests that will still fail – probably nothing that a little C-hacking can’t fix.

Anyway, open extconf.rb and make it look like this:

require 'mkmf'
require 'pkg-config'

def find_smjs(mozjs)
  dir_config(mozjs)
  #$CFLAGS += " -gdbg"
  case CONFIG['target_os']
  when /mswin32|mingw|bccwin32/
    $defs << " -DXP_WIN"
    lib = "js32"
  else
    $defs << " -DXP_UNIX"
    lib = mozjs
  end

  $defs << " -DNEED_#{mozjs.upcase}_PREFIX"
  have_library(lib)
end

if find_smjs('js') or find_smjs('mozjs') or (CONFIG['target_os'] =~ /mswin32|mingw|bccwin32/ and (find_smjs('mozjs') or find_smjs('smjs') or find_smjs('js'))) or
  %w(xulrunner-js thunderbird-js mozilla-js).any? do |package|
    PKGConfig.have_package(package)
  end

  create_makefile("spidermonkey")
else
  exit 1
end

Finally open spidermonkey.c and find the header include files. Change add these lines before the #else directive

#elif defined NEED_JS_PREFIX
#  include <js/jsapi.h>;
#  include <js/jshash.h>;
#  include <js/jsobj.h>;

Now run the following to build:

ruby extconf.rb
make
sudo make install

If you didn’t have any errors, you should sweet.

Using the library

Now, to parse, compile and execute some javascript code, you need to create a Context, then evaluate the code. So drop this into irb:

require 'spidermonkey'
js = << -JS
function test() {
  return 1 + 2;
}
JS

context = SpiderMonkey::Context.new
context.evaluate(js);
context.evaluate('test();')

Irb should output 3, which, last time I checked is still equal to 1+2!

As you can see, you can make multiple calls within the given context, and all of the functions and variables are persistent. I’ll post more notes as I find them.

RESTful Rails. Part II. Now with more Sitepoint article goodness

My follow up RESTful Rails blog post-cum-article has been released into the wild. If you have been looking at RESTful Rails, and wondering what the hell is going on, go and have a read. If you don’t know what REST is, go and check out the earlier blog post to get up to speed.

Personal promotion over.

Freelancer Friday February

Oh how I love alliteration. Especially on a leap year. This Friday, the 29th is the next installment of everyone’s favourite open house co-working day, Freelancer Friday. At this point I would make some smart-alec remark about how Freelance Fridays would only fall on a leap every x-number of years, however, I can’t be bothered working it out (I’m sure someone out there who will) so instead I’ll point you at the wiki, where you can put your name down. Hurry, time is limited.

88 Miles now supports OAuth

Now that the OAuth standard has been finalised and the Rails plugin (as well as libraries for a number of other languages) has stablised, I thought it time to become an early adopter and add it to 88 Miles.

OAuth works like this:

  1. A developer create a third-party application (a consumer). They login to the the provider website and add their application. The website will then given them a secret key and three URLs: one to get a request token, one to get an access token and one that users can use to authorize an application.
  2. When another user decides to use the third-party application, they first need to authorize it’s use. So the application will request a Request Token by posting some data to the request token URL.
  3. Once this returns, the application should redirect, or at least point to the authorization URL. On this page, the user is asked whether they really want to give access to the third party application.
  4. If the user says yes, the provider will redirect the user back to the consumer website, or at least notify the user that the consumer has authorization (It’s a bit hard to redirect to a desktop application for example).
  5. Once the consumer is notified that it has been given access, it will then swap it’s Request Token for an Access Token.
  6. Now the consumer can freely access resources from the provider by using this Access Token.

Obviously, if a given instance of an application has a valid Access Token, it can skip steps 1-5, and just continue using the Access Token.

Although the Rails plugin is aimed at people using acts_as_authenticated, a little bit of hacking and code diving meant it was relatively easy to shoe-horn it into my custom login system. Because I wanted 88 Miles to drop-back to basic authentication if OAuth wasn’t available, I needed to work out what authentication system each request required. This can be done by:

request_proxy = OAuth::RequestProxy.proxy(request)

if(request_proxy.signature_method != nil)

  # It's an OAuth request

  if oauthenticate

    # They get access

  else

    # Denied!

  end

end

Nice and easy. I did go through and spruce up some of the authentications screens, but if you aren’t that anal, the boilerplate code from the plugin would suffice.

EEE-PC. So cool!

I’m writing this blog post using my brand-spanking Eee PC – the 7″ mini-laptop brought out by Asus. This thing is small, I’ve taken a picture of it sitting on my regular 15″ widescreen laptop, and you can see the difference:

Asus Eee Pc compared to a Toshiba M30

They have managed to squeeze a pretty decent machine in there – it is a 900Mhz Celeron (under clocked to 630Mhz) with 512Mb of RAM and 4Gb of SDD drive space, not bad considering the size and the fact it weighs less than a kilo! Even with the specs, it is suprisingly zippy – I suppose because there isn’t really anything running on it. Boot up time is less than a minute, and shutdown is even quicker.

There is an 8Gb one as well (exactly the same, just with a bigger drive), but I threw in a $25 2GB SD card and that suits me plenty.

It comes loaded with Xandros Linux, a Debian derivative, and with a little hacking, you can unlock the less than useful “simple” mode to reveal KDE. So me further hacking still, and you can pretty much load up any software that will run on Linux. I have a LAMP stack, and I nearly have Rails working (getting Rails to work on Debian is a pain at the best of times).

One of the other great things about this machine is the hackability – many people have managed to install internal USB hubs and bluetooth adapters, touch screens and even digital tv tuners behind the screen (I’m very tempted by this…).

Alas, there are a few downsides. The battery life is pretty average (mind you I’ve been spoilt by my extended 5 hour battery on my main laptop) and hibernation takes longer than shutting down, so the default action when shutting the lid is sleep, which surprisingly chews through the battery. I had it fully charged the night I got it, closed the lid and it was almost dead by morning.

The keyboard takes a little getting used to (but what do you expect). For example, I keep hitting PgUp instead of shift.

The only other annoyance (and this is probably a Linux thing more than anything else) is the WiFi doesn’t auto-connect and it doesn’t seem to like JoikuSpot, so I’m still stuck with my iPod Touch on the train.

All in all though, for a $AU500 miniature laptop, it is freaking awesome!

Perth Ruby on Rails user group. Edition 1

Matt Didcoe has finally gotten the ball rolling on a Perth Ruby on Rails user group with the inaugural meetup happening at the Silicon Beach House on Wednesday 20 February 2008 from 5:30pm. The first one will be pretty informal – no talks (although, I’m sure there will be plenty of taking).

So if you you use Rails, have tried Rails, are thinking about learning Rails or have only just heard of Rails, come along and watch me and Matt try to out geek each other :P

Details in a nutshell:

Wanted: Dead or Alive. Some PHP developers

I’m in a bit of a predicament at the moment. As many of you know, I’m back doing the web consultancy thing full time again after a 18 month hiatus. I made a couple of rules that I’m trying hard not to break:

  1. I’m not supporting PHP4
  2. I’m not supporting or modifying badly written OpenSource projects  (basically crossing out WordPress, osCommerce or phpBB jobs)

Which (maybe un-)suprisingly I get asked for a lot. As a result, I’m looking for some PHP developers that haven’t become totally jaded by years of PHP4 abuse that I can sub-contract out to. I’d say I’m looking for mid-level developers, I’ll be there to help out find out WHAT needs to be done, and HOW it should be done – I just need someone to actually do the work.

I’m pretty anal about coding standards and software practice, so things like SVN are a must. I have a development server if you need an environment to work in.

If you think you might fit the bill, and want to work with someone who’s been around the development block a few times, email me on myles@madpilot.com.au with a short CV and your rates.

Previous Next