Get Adobe Flash playerPlugin by wpburn.com wordpress themes

Archive for the “Software Development” Category

Well, it’s a while since I wrote a blog post so why not kick off with a slight bit of professional heresy.  I write software for a living; have done for over 30 years, starting with SCMP microprocessors in my teens (yes, I was THAT sort of teenager…) and working through everything in between until now when I spend my time split between .NET, JavaScript and PHP.

Now, why do I write code?  Well, occasionally I do it for fun, but mostly I do it for profit – my clients pay me to do it.  Actually, that’s not right.  My clients pay me to solve their problems for them using software. 

I’ve never been one of the great ‘geeks / hackers’ in life; I’m a radio amateur and electronics whizz, and the closest I ever came was in my teens and early twenties when I was fiddling with low level stuff like analogue to digital converters and the like; but pure software geekery has never been me.  I used to say to people that I was a reasonable programmer but an excellent developer; now I’m more likely to say I’m an excellent problem solver.

Don’t get me wrong; I have an active interest in my profession, from the perspective of how I can deliver better service to my clients in delivering what they want from me.  And I like to think that I write sound, efficient and effective code.  I create data structures, create objects to model those structures and business processes, create code to implement these abstracts and put something on my client’s desktop or web server that allows them, bottom line, to make more money or save more money.  I also write code that is easy to follow and maintain, that has sensible variable names, that I document and leave a pile of useful information with my client.  And I’m there for them when needed.  I love it when I get a call from a client who tells me ‘We needed to add a new feature, so we took a look at the code and documentation and we think we’ve done it right, but next time you’re in, could you give it a quick look?’ – the ultimate accolade for me – I’ve delivered code that others can pick up and run with.

I’m methodical, but don’t have what you could call a methodology; I was recently asked whether I was agile; I almost replied that I used to be but since I tore my knee cartilage a few years back I’m not as nimble as I once was.  Do I practice Extreme programming; not really, I’m more Church of England, middle of the road, myself….

I’ve started to notice that there are two broad categories of software developers; those who work for software houses or in large development teams where words like Agile, Extreme, kanzen, dojos, user stories, sensei are the common parlance, and those who work very close with business and organisational problems, where the usual words that define a day at the coalface are fix, solution, feature, document, debug, budget, timescale.

I like to talk to my clients in their language; I’m afraid I still work in a world where businesses have processes, not user stories; where they don’t particularly care what technique I use behind the scenes as long as I deliver working, maintainable and efficient code, to budget and on time.  I’m sure that the software house methodologies work effectively but do they provide yet another layer of obfuscation, bureaucracy and abstraction between what we do and what our clients and customers want us to do – solve their problems?

No matter how much we dress things up with Japanese words (and I speak with some knowledge and experience of Japanese culture and management) we must not lose track of what we do and why we do it; we solve problems by developing effective software systems delivered on time and to budget.  That is all our clients care about; we’re not ninjas or ronin; we’re professional programmers and problem solvers.

I guess what I’m saying to developers is don’t fetishise what you do to the point where the process becomes more important than the product.  It’s rare I have much good to say about Steve Jobs and the slavering behemnoth that is Apple, but he did once say ‘Great artists deliver’.  And that’s what it’s all about.

Comments 1 Comment »

Early on in my consulting career – late 1980s, early 1990s – I did a lot of work for a public sector organisation.  I worked on a number of projects – this was in the days when IT consultants could still be generalists, applying their skills to whatever was needed – and tended to specialise on development of a few database applications that were centrally based and accessed over a (pre-Internet) wide area network, held together by leased lines, private cabling, etc.

All in all, a fantastic environment in which to hone your skills.  Actually, in many respects I was rather spoilt by this client – and by my first job out of university – they both gave me a rather distorted view of working life!  For a while we experienced some rather ‘odd’ problems on some of the applications running over the wide area network.  Despite our best efforts, we couldn’t actually ground the problems – we checked software, hardware, cabling, the works.  Eventually, and half jokingly, a colleague and I (both of us radio amateurs) decided that the problems were being some how caused by sun spots….

Unsurprisingly, this caused gales of laughter in the office, but as far as we were concerned there was an element of logic in our proposal.  We knew that sun spots and solar activity in general had an effect on the earth’s ionosphere, and that in the past bad solar storms had knocked out telephone and communication systems.  Indeed, in the pre-Internet, pre-computer days of 1859 a major solar storm had caused incredible effects, even causing telegraph wires to carry electrical currents when all the batteries were disconnected!

This information did little to convince people around the office, so we simply did what any other self respecting techie would do; turn things off and on, replace a few network cards and bridges, tighten connections and tweak software.  And the odd errors stopped, and we stopped worrying about it.

But over teh years I’ve thought about those gremlins on numerous occasions, and it now appears that we may have been right after all.  According to this article, solar storms can cause mystery glitches in communication and computer systems. 

It may be that the next time we get a big solar storm or Coronal Mass Ejection – when a massive plume of plasma and charged particles is thrown from teh sun out in to space – the impact will be much more than a few gremlins in the works.  Some have suggested that a storm similar to that of 1859 might cause massive damage to the electrical and communications systems of the world; indeed, some real pessimists have suggested that a BIG solar event might put us back in to the pre-electronics age for decades.

Let’s hope we don’t get it…

Comments No Comments »

There’s an old saying that you can neither be too thin  or have too much money.  I’d like to add to that list – you can’t have too many web servers available on your PC.   For the non-geeks amongst you, a web server is a program that runs on a computer to ‘serve up’ web pages.  because I write web software for part of my living, I run my own web server on my PC.  Actually, that’s not quite true…because there are two main web servers used today – Microsoft’s IIS and Apache – I have two.  And today I decided that it would be really useful to have a web server and associated software on a USB stick that I could plug in to computers to demonstrate my web applications out on client sites.

I decided to use the MOWES installation – after all, it’s designed to run on USB sticks – and as well as the standard Apache, PHP and mySQL I decided to also install Mediawiki and WordPress.  As well as being used for demonstrations, I decided that I’d also like to have a portable Wiki to use for note taking / book research when I’m on my travels, and run a demonstration instance of WordPress.

Installation

The simplest installation involves putting a package together on the MOWES website, downloading it to your PC and installing it.  To get started with this, go to the MOWES Mixer page, click the ‘New Package’ radio button and select what you want to install.  For my purposes I chose the full versions of Apache, mySQL 5 , PHP5,  ImageMagick, Mediawiki, WordPress, and phpMyAdmin.  This selection process is done by ticking the displayed checkboxes – if you DON’T get a list of checkboxes for the ‘New Package’ option, try the site again later – I have had this occasionally and it will eventually give you the ‘ticklist’ screen.

Tick the desired components and download the generated package.

Plug in your USB stick, and unzip and install the MOWES package as per their instructions.  First thing to note here is that you may need to keep an eye on any requests from the computer for allowing components access to the firewall.  The default settings will be Port 80 for the Apache web server and 3306 for mySQL.  If these aren’t open / available – especially the mySQL one – then the automatic install of the packages by the MOWES program will fail miserably.

Once you have the files installed on your memory stick, then you can configure them.

Configuration

If you never intend to run the installation on any PC that has a local Web Server or instance of mySQL, then you don’t need to do anything else in terms of configuration.  You might like to take a look at ‘Tidying Up’ section below.

If you ARE going to use the USB Stick on PCs that may have other web servers or mySQL instances running, then it’s time to come up with a couple of ports to use for your USB stick that other folks won’t normally use on their machines.  The precise values don’t matter too much – after all, the rest of the world won’t be trying to connect to your memory stick – but be sensible, and avoid ports used by other applications.

I eventually chose 87 for the Apache Web Server, and 4407 for mySQL – 87 fitted with my own laptop where I already have a web server at Port 80 and another one at Port 85, and I run mySQL at the standard port of 3306.  NOTE that if you run the installation using an account with restricted privileges, you may not be able to open the new ports you use.

In order to configure the MOWES installation you’ll need a text editor of some sort – Windows Notepad will do at a push.  You’ll be editing a couple of files on the USB stick, as follows:

apache2\conf\httpd.conf

Open this file up and look for a line starting with Listen.  Change the number following it to the number you’ve chosen for your Apache Port – e.g. 87.

Now look for ‘ServerName’ – change the line to include the Port number – e.g. localhost:87

php5\php.ini

Open this file and find the line starting mysql.default_port.  Change the port referenced in this to the Port you have chosen for your mySQL installation.  E.g. mysql.default_port=4407

mysql\my.ini

Open the file and look for two lines like port=3306.  Change the port number to the one you have chosen – e.g. 4407 – port=4407.  There will be two lines like this in the file, one in the [client] section and one in the [server] section.

www\phpmyadmin\config.inc

This is the configuration file for the phpMyAdmin program that provides a graphical user interface on to the mySQL database.  Look for a line that starts with : $cfg['Servers'][$i]['port'] and replace the port number in the line with (in this example) 4407.

And that, as they say, is that for the configuration files.  You can now start up the MOWES server system by running the mowes.exe program.  If all is working, after a few seconds your web browser will be started and will load the ‘home page’ of the MOWES installation.  With the configuration carried out in this article, the browser will show the url http://localhost:87/start/ and the page displayed will show links to WordPress, Mediawiki and phpmyadmin.

WordPress Configuration

The final stage of configuration is to make a change to WordPress that allows WordPress to run on a non-standard Apache port.  This needs to be done via phpmyadmin, as it involves directly changing database entries.  Open phpmyadmin, and then open the wordpress database from the left hand menu.

Now browse the wp_options table.  Find the record where option_name is ‘siteurl’ and change the option_value field to (for using a port number of 86) http://localhost:86/wordpress.  Now find teh record with option_name of ‘home’ and again change the option_value to http://localhost:86/wordpress.

Tidying Up

You may like to put an autorun.inf file on the root of your memory stick, so that when it is plugged in to a machine it will automatically start the MOWES system (if the machine is so configured).  The file can be created with a text editor and should contain the following:

[autorun]
open=mowes_portable\mowes.exe
label=Your Name for the Installation

And that’s that!

Enjoy!

Comments 2 Comments »

There’s a scene in Monty Python’s ‘The Life of Brian’ in which a character asks ‘What have the Romans ever done for us?’  This is then followed by a host of other characters giving many useful things that the Romans HAVE provided for the people of Palestine.

I was reminded of this sketch when I encountered this article about Apple’s Chief Operating Officer Tim Cook in which he comments that there isn’t a single thing that a Netbook does well.  Time, I have some bad news for you, sunshine; there are lots of things that Netbooks do well – however, they’re probably things that Tim Cook doesn’t do.  In the last week or so:

  • I used the Netbook to test an ADSL connection at the point of entry of the phone-line to the house.
  • When out and about I used it to write a blog article whilst waiting for an appointment.
  • Hooked it up to my amateur radio gear to decode some weather fax images.
  • Downloaded some code from an SVN repository, made a quick fix and uploaded it again.

In other words, stuff I couldn’t use my Blackberry for, and stuff that I needed a real keyboard for – whilst the Crackberry is great, I don’t fancy writing 500 words of blog post or trying to debug code on it.

But it’s real, genuine work being done, and not stuff I could do on a keyboard-less, USBless iPad.  Sorry Tim – here on Planet reality we’re not all managers and critics and reviewers and surfers.  Some of us actually do real work on the move, which at the moment (and probably will do for some time to come) requires a real keyboard and a piece of kit that I can actually install software on – not a closed garden that looks good but is at the same time too big to put in my pocket and too small to act as a sensible paperweight.

I love teh concept of the Pad – but this sort of arrogance from Apple – following on from their recent attacks on development toolkits and the serious limitations in connectivity of the iPad – really makes me wonder whether the bods at Cupertino ever spend time in the real world watching how people use technology.

Comments No Comments »

Many moons ago, when you could write useful software on a computer with less processing power than my last cellphone, there was a reporting tool called Crystal Reports that was incredibly useful for those of us who spent our working lives using tools such as Visual BASIC 3 to write windows applications.  It had a few gremlins, but they tended to be the sort of thing that you wrote in your notebook and turned to when you deployed an application that used CR…sort of:

“All report files verified against database…check.  All report files in distribtion package….check.  All CR runtimes in distribution package….check. ”

And that was it – the whole thing fitted on a couple of floppy discs (remember those?  If not, the contents of 400 of them will fit on a CDROM) and after I got my checklist sorted I was good to go and was happy to use Crystal Reports whenever I needed a quick and straightforward reporting solution.

The years passed and I found myself working on various projects which either used different reporting technologies or that didn’t involve me with reporting systems, and I gradually lost track of Crystal Reports until a couple of years ago when I found myself having to use the package again.  And most of the time it’s fine – but when used with Visual Studio to develop and deploy Internet Web sites and applications….oh dear.

As always you tend to blame yourself for being stupid with these sorts of things.  You are, after all, dealing with a couple of packages that could easily have knocked you back over £600 if you buy the full packages.  So, you kind of think that by following the instructions, you’ll get a working system without any real problems.  And, if it all goes pear-shaped, you assume that somewhere along the way you’ve dropped a clanger, so you repeat stuff, reinstall stuff, restart machines, uninstall stuff, sacrifice chickens…the usual persistent efforts to solve problems adopted by software developers.

Of course, we’re now aided by Google (how did we manage to resolve these issues before the Web?  I really can’t remember, but software seemed to go wrong less frequently back in the early 1990s) and so I did a quick Google of:

  1. Why Crystal Reports viewers failed to run properly when added to a web page, even if you used the exact code on Microsoft’s and Business Objects’s web sites?  Which led to….
  2. Why a particular folder called aspnet_client wasn’t being created when I created a new website.  Which led to….
  3. Why, when I manually added the folder (again, as per the instructions) , things still failed. 

6 hours of my life disappeared down the maw of this problem – 6 hours that I could happily have spent doing other things.  Eventually, rather than spend my life going round and round in ever decreasing circles (or re-installing EVERYTHING – not something I wanted to do on someone else’s server) I came up with what I ended up describing on Twitter as a ‘wanky bodge’ to work around the problem. 

What was incredibly scary was the number of times the issue turned up on Google with the comments ‘Don’t know how to fix, it sorted itself out after re-installing, Couldn’t fix it and so didn’t use Crystal Reports’.  It’s not just me – looks like the combination of Crystal Reports XI and some instances of Visual Studio (but not all) and some Web sites on the same server (but not all) can give rise to the situation where it’s impossible to view a report without bodging things. 

Guys…it shouldn’t be  like this.  There’s an old joke that says that if we built bridges the way we built  software we’d never dare to drive across them.  I think that there’s a little too much truth in that joke.

Comments 2 Comments »

Back in 1984, Apple had Ridley Scott direct a very imaginative advert to launch the Macintosh computer.  It ran twice – once on a small TV station late at night to get it in the running for some awards, and the second time at half time in the Superbowl American Football game on 22nd January 1984.  And it never ran again.  The message from Apple was that their new machine would shatter the conformity that people like IBM (and by extension Microosft) were putting on the computer market, by making computing available to the masses.

The advertisement ends with the line:

 ”On January 24th, Apple Computer will introduce Macintosh. And you’ll see why 1984 won’t be like “1984″. ”

The problem was that the Macintosh was so expensive that few people could afford it.  It was a pain in the rear to write software for – so relatively few folks wrote software for it, especially as the market was small compared to that offered by the PC.  As it turned out, 1984 wasn’t at all like 1984, but no thanks to the Macintosh which even today, in all it’s forms, occupies only 10% of the computer operating system market space, even if you include iPhones.

From day one, there was always something ‘control freak’ about Macintosh, all of it’s successors, the iPhone and now the iPad.  As I mentioned above, the original Macintoshes were not easy to write software for, and Apple didn’t make life easy for developers.  the situation persists today; to write software for an iPhone, iPod or iPad, you have to run the emulator kit on a Macintosh of some sort.  Let’s do a quick comparison – if I want to develop an application for my Blackberry, I download teh tools from the Blackberry website and get it running on my PC running Windows.  For free.  If I want to write an application for an iPod or iPhone….I first of all have to join the Developer Program at $100 a year.   Then I can download the SDK.  To run the SDK I need a machine running Mac OSX.  Oh look…only Mac’s can legally run Mac OSX…very much a closed garden.

Early Macintoshes came with no network connection; obviously this is no longer the case but it should have given us the hint that Macs were not really designed to talk with the rest of the world.  Fortunately for Apple, some of the people involved saw sense and gradually the more open Macintosh that people use today in it’s numerous forms came in to being.  And gadgets like iPhone, iPod and iPad emerged in to the market, able to interact with the Internet and other media.

But let’s look at what this actually means.  First of all, aaccess to applications and media for these latter machines is very much controlled by Apple in terms of:

  • Control of the means of production – make sure non-Macintosh / Apple users cannot easily develop applications.
  • Control of the means of distribution – iTunes store, various recent high profile cases of applications being banned from the iTunes store makes it difficult to get applications in to the world.
  • Control of the means of communication – these devices lack the ability to easily handle ‘standard’ add ons such as USB or cheap memory cards, like SD.  iPhones have also frequently been tethered to particular telephone companies. 
  • The fact that  iPad comes without Flash, for example, suggests that Apple are adopting a policy of attempting to control content that is usable on their kit.

Let’s ignore the stupidities around making devices reliant on rechargeable batteries in which the battery can only be changed by returning it to the manufacturer. 

The natural progression for Apple would be to continue growing as a media and services company, rather than as a hardware house.  By an iPad, and rely on Apple for much of your available content and software.  And Apple can also ensure that you don’t leave the ‘walled garden’ of Apple acceptable content by making sure that the inbuilt iPad browser doesn’t handle some common media formats like Flash.  How will they fund all this?  Easy – you’ll pay.  Apple have already stated that they are rolling out an advertising model for iPad / iPod / iPhone applications in which the application provider would be able to get 60% of advertisng revenue generated via their application – the other 40% going…well….you know where.

Control of content, hardware and communication.  2014 could very much be like 1984 if Apple gets it’s way.

Comments No Comments »

A few days ago one of the pioneers of the home computer revolution of the 1970s died.  Ed Roberts, an MD in Georgia, died after a long battle with Pneumonia.  Back in the 1970s his company, MITS, moved from model rocket telemetry, to calculators, then to building the first ‘computer kit’ – the Altair 8800 – for which Bill Gates and Paul Allen provided a BASIC interpreter.  The Linux and Apple Fanbois amongst you may now know who to blame for Microsoft… :-)

It’s debatable that without the Altair 8800 another home computer – in kit or ready built form – would have come along.  The Apple 2 followed behind theAltair, as did many other similar machines, but the Altair was first.

The Altair 8800 was basically a microprocessor chip with enough associated ‘gubbins’ to make it work – it could be chipped up to have 8k of memory – my laptop here has 4,000,000 k of memory – and could even handle a keyboard and eventually a video display – although when you got it out of the box (and after you’d soldered the thing together) it’[s user interface was a bank of toggle switches and some LEDs.

Yup – you programmed it, entered data and read the output in binary.  It was safe to say that in the mid 1970s, as far as computers were concerned, men were real men, women were real women, and real programmers did it in binary with a soldering iron tucked behind their ear. The fact that within 10 years of the Altair being launched teenagers were typing their own programs in to Spectrums, ZX-81s, BBC Micros, Apples and the rest is a monument to the excitement and speed of those early days of computing.

And, by golly, it was FUN! Even the act of getting your computer working in the first place was part of the game – you learnt to code in machine code from day one because either nothing else was available or you realised that in order to make anything useful happen with only a few HUNDRED bytes of memory you needed to right VERY ‘tight’ code.

I built my first computer in the mid-1970s – well, not so much a computer as a programmable calculator.  I took an electronic calcul;ator and wired up the keyboard to some circuitry of my own invention that mimicked keypresses.  Programming this beast involved changing the wiring in my circuit – running teh program involved pressing a button and after a few seconds the answer would appear.  I then got even smarter, and managed to work out how to introduce some decision making in to my gadget.  Fortunately, I blew the output of the calculator up soon afterwards – I say fortunately because I then found out about microprocessors and ended up building some simple computer circuits around 6800 and Z80 microprocessors, rather than carrying on with my rather ‘steampunk’ programmable calculator!

Ed Roberts’s machine wasn’t an option for me; my pocket money wouldn’t cover the postage from the US.  But the fact that people were doing this sort of thing was very exciting, and by the time I left university in 1982 I’d already spent time with ZX81s and Apple 2s, and had written my first article for the home computer press – a machine code monitor and loader program for the ZX81 in ‘Electronics and Computing Monthly’.  I was reading in the magazines about the developments of software from up and coming companies like Microsoft – even in those pre-PC days – and for a few years in the early 1980s the computing field in the UK was a mish-mash of different machines, kits, ready made stuff – and most people buying these machines bought them to program them.  How different to today.

I have to say that I’ve always thought that the fun went out of home computing when the PC came along, and when Microsoft and Apple stopped being ‘blokes in garages’ and started being real companies.

Ed Roberts – thank you for those fun packed years!

Comments No Comments »

Don’t get me wrong – I love Open Source software and have used some of it fairly widely in various development projects that I’ve done.   I’m also aware of the fact that people involved in the development and support of such software are typically volunteers, and on the odd occasion I have called upon people for support, I’ve always had good experiences.

I’ve also seen some absolute stinkers of ‘support’ given to other developers, in which the people who’re associated quite strongly with the softwrae have treated people in a rude, patronising and often offensive and abusive manner.  Now, in 20+ years of dealing with IT support people – including folks like Oracle, Microsoft. Borland (showing my age) and even Zortech and Nantucket (back in the deep past!!) I can count on the fingers of one hand the number of times I’ve had this sort of treatment from big bad commercial software houses.  It’s unfortunate that I’ve seen dozens of examples of this poor customer service from Open Source suppliers in the last couple of years.

Because even if we don’t pay, we are customers – and some of the worst behaviour I’ve seen from companies where users are required to pay for a license when the software is sued in commercial situations.  It’s hardly encouraging, is it?  I know it can be frustrating to answer the same question several times a day, especially when the solution is well documented, but rudeness isn’t the way forward.  After all – it doesn’t exactly encourage people to use the product, or pay for a licence – rather than persevere or even volunteer a fix, folks are more likely to just go to the next similar product on the list.

Ultimately, it boils down to this; piss off enough potential customers and people like me will write articles like this but will name names and products.

So, here are a few hopefully helpful hints to people involved in regularly supporting products and libraries.

  1. If it’s your job, you’re getting paid to do it.  If you’re a volunteer, you’ve chosen to do it.  In either case, if you don’t feel trained up enough in the interpersonal skill side of things, just be nice, and read around material on customer support.  If you don’t like it support, then rather than taking it out on customers, quit.  Because you’re unhappy is no reason to take it out on other people.
  2. Remember that the person asking the daft question may hold your job (or the future of your product) in their hands.  You have no idea whether they’re working on a project for a small company or a large blue chip / Government department.  Your goal is surely to get widespread adoption – the best way to do this is to make folks happy.
  3. Even if the fix IS documented in any number of places, be polite about it.  If it’s that common, then have it in your FAQs or as a ‘stock answer’.  The worst sort of response is ‘It should be obvious’.  Of course it’s obvious to you – you wrote it.  It isn’t obvious to other people.  This seems to be a particular problem with ‘bleeding edge’ developers who swallow the line that ‘the source code is the documentation’ – it may well be, but if you want your product or service to be adopted you need to get as many people as possible using it.
  4. Don’t forget that if someone perseveres with your software, through buggy bits, they may be willing to help you fix it.  The chances of you getting a helper if you are rude to them is minimal.
  5. If you get a lot of questions or confusion about the same issue, perhaps it’s time to update the FAQs or Wiki?  And don’t forget sample code – if you’re generating code libraries PLEASE provide lots of real-world examples.

And to all the nice support folks – thanks for all the help – it is appreciated!

Comments No Comments »

I’m currently involved in developing a web application of moderate complexity using Ext to provide a ‘Web 2.0′ front end on a PHP/mySQL application.  We’ve endeavoured to make it work across a range of browsers – Firefox, IE, opera and Chrome.  And this is the blog article in which I vent my spleen about Chrome.

Because, you see, there are some occasions when Chrome is an absolute bag of spanners that behaves in a manner that just beggars belief, and it worries me immensely.  If IE behaved in the same way that Chrome does under certain conditions then the Chrome / Google Fanbois would be lighting their torches and waving their pitchforks as they headed out towards Castle Microsoft.

Giving Chrome it’s due, Chrome renders CSS well against standards, and is frequently faster than Firefox and IE in terms of delivering pages; where it does seem to be lacking is in it’s sensible handling of JavaScript. The general impression I’ve had over recent days with Chrome and JavaScript is that it’s incredibly picky about how it handles JavaScript that is less than perfectly formed – hence the ‘Maiden Aunt’ jibe.  It requires everything to be very right and proper.  I understand that any browser should be expected to deal with properly structured script, but in recent years I’ve found that the major browsers tend to behave in a pretty similar manner when processing JavaScript and tend to vary in behaviour when rendering CSS – hence the fact the some sites look different in IE than they do in Firefox or Chrome.

But I’ve encountered some horrendous differences in the way in which Chrome on one side and Firefox/IE on the other handle JavaScript.  Chrome seems to be very ‘tight’ in it’s handling of two aspects in particular; white space and commented out code.  I hope that following comments might prove useful to anyone doing JavaScript development – particularly with libraries such as Ext.  Note that these issues don’t occur all teh time with Chrome, but have occurred often enough to give me problems.

Watch the White Space

Chrome seems particularly sensitive to white space in places where you wouldn’t expect it to be.  For example:

  • Avoid spaces following closing braces ( } )at the end of a js source file.
  • Avoid spaces around ‘=’ signs in assignments. 
  • Avoid blank lines within array definitions – don’t put any blank lines after an opening ‘[‘ before data.

Watch the comment lines

The // construct used to make a line in to a comment line needs to be handled with care with Chrome.  Don’t include it in any object or array definitions – whilst it works OK in IE, it can cause major problems in Chrome.

Indications of problems

If you’re lucky you may get a straight forward JavaScript error – in this case you will at least have an idea of what’s what.  If you’re unlucky you may end up with either an apparent ‘locking up’ of Chrome or a 500 Internal Error message from your Web server.  The ‘lock up’ will frequently clear after a few minutes – the browser seems to be waiting for a timeout to take place.  When the errors do take place, I’ve found that the loading of pages featuring JavaScript errors is terminated – it can give the impression that a back end PHP or ASP.NET script has failed rather than client side script.

In summary, just be aware that Chrome may not be as well behaved as one would expect.

And that’s my whine for the day over!

Comments No Comments »

Many, many moons ago, and I mean in the last century, I had a version of Linux running on one of my PCs, and lo, it was good.  If you liked command lines and stuff like that, as the PC concerned wasn’t really up to running X-Windows and such.  But hey, not a problem; I was only wanting to run it as a development web server and after a little faffing around I had it neatly wired to my router and that was that.

Somewhere in the early 21st Century – OK, 2004 - we bit the bullet and went Wifi here at The Towers.  Once we had the Windows machines running on that network, I started toying with WiFi for the Linux boxes but couldn’t find a distro that did it ‘out of the box’.  As an experiment I did try and get whatever version of Ubuntu was kicking around in about 2006 working with a USB WiFi Dongle, but once I got on to the part of the instructions that involved downloading all sorts of arcane bits of software from around the Internet, then compiling wrappers, installing Windows drivers on Linux machines and all sorts of other tomfoolery I decided to quit.  Oh, and after I’d spent a couple of evenings at it with no results.  

The general impression I got from people ‘in the know’ was that:

  1. It is easy if you follow the instructions.
  2. Linux is OK – it’s my WiFi dongle that was wrong.
  3. Future versions of Ubuntu will deal with these dongles.

Well, so be it.  But at the time I didn’t find (1) easy, (2) seemed a bit dumb when the dongle worked happily on 3 versions of Windows and (3) – well, I can be patient.

In 2008 my then laptop had a couple of accidents involving a cup of tea and a crashed hard disc, and it was replaced with a nice new machine, and today I decided that the old laptop should be dug out and Linuxed – and because I’ve had previous experience with Ubuntu, I decided to grab a CD Image of Ubuntu and re-partition and re-format the hard disc of the laptop with Ubuntu 9.10.  The installation went fine – I soon had a laptop running Ubuntu, and was pleased to see that it automatically detected my USB WiFi dongle AND also spotted a couple of local WiFi networks….shame neither of them were mine.

I attempted to attach to my home network directly by specifying the name; I selected the correct security protocol and entered the key; nothing.  Nada.  Not a peep.  Just kept asking me for my security key settings again.  In other words, it wasn’t connecting to my home network.  Which is a shame, because we have XP machines, Vista machines, Windows NT, Windows ME, a Blackberry and a Wii that all happily connect to the WiFi network at Pritchard Towers. 

I guess I’ll take another look at it soon; using a wired connection isn’t really on due to where the router is in the house, so WiFi is necessary.  Fortunately I’m not reliant on this machine as my main PC around the house, but it’s a sad repetition of the last time I decided to install a Linux on one of my machines to use as a ‘Client’ Operating System rather than as a server.  It doesn’t bloody work!  I appreciate that the Linux Fanbois will tell me all sorts of things I can do to make it work, but to be honest that misses the point.  Take a look at teh graph below (from Wikipedia)

Linux provides a little over 1% of the total number of Client Web Browsers detected by web sites.  The fun and games I’m having probably explains why.  For all the hype and fuss about Linux finally coming of age as a desktop replacement for Windows, it is just not going to happen as long as you can’t get the damn thing to connect to a bog standard WiFi network out of the box.

Come on fellows, I want to play; meet me half way.

Comments No Comments »