News for December 2009

Happy New Year!

Hmm, there is a running theme with my most recent posts… but never mind!

A new year is a-comin (unless you adhere to a non-Gregorian calendar) and with it comes a load of new goals. Maybe to increase your average work rate (we all have those slow days) or to learn something new. However, without determination and grit, you won’t get anywhere that quickly.

I’ve made myself a promise to finally get to grips with Python on a commercial level for next year, along with expanding my knowledge of working (not just playing) inside a Unix-like system (read: Linux :P ).

Anyway – enjoy your new year and make sure you don’t slip and fall on your arse on the way home from the pub on Jan 1st. I’ve done it, and it isn’t the best way to begin a new decade!

Posted: December 31st, 2009
Categories: General
Comments: No Comments.

Merry Christmas!

I know you’re all probably knee-deep in festive munchies by now, but I thought I’d drop a little Christmas cheer on this here blog.

Usually Christmas is one of the few times in a year when a developer can really forget about work. Sure, you don’t work weekends and have time off, but I bet that most of you have found yourself solving problems outside of work time – I know I have!

So, savour the time off, enjoy the copious amounts of food and booze hanging around. Because you just know that when you come back after the holidays, work will begin again!

Posted: December 25th, 2009
Categories: General
Comments: No Comments.

jQuery – why it will save your sanity

Sanity. Its an important thing. It stops you shouting at passing cars in the street or smothering yourself in ice cream before hurling yourself down a supermarket aisle. That is why jQuery is so important to me – I value my sanity. Also, Tesco value their stock of Ben & Jerry’s.

  1. Cross-browser differences with JavaScript can be largely eliminated. No need to re-code that bit of animation so it works in IE 6 as well as Firefox 3.5, jQuery will handle it all for you. Don’t get me started on the ‘for…in’ construct and how ‘.each()’ saves the day every time.
  2. Everything you want to do is even more simple than you can believe. What used to take over a dozen lines of code can usually be expressed in one line.
  3. Chaining. It may rile some programmers up, but when you can chain function calls together on a single object, you end up with cleaner, more readable and more semantic code.
  4. Plug-ins. There are so many of them around now that just about anything you want to do has already been done at least once. Sure, the jQuery site could use some improvements when it comes to searching the docs or plugin database, but it is all there for you.
  5. Light weight. In comparison to MooTools, jQuery is quite hefty. But when you compare it to nearly every other JavaScript framework out there, you will see that when minified, the library is small enough to justify its addition to your code base. Every byte transmitted and processed delays the user seeing your website, so you have to balance the good against the bad!

These are my reasons, what are yours?

Posted: December 24th, 2009
Categories: General
Tags: , , ,
Comments: No Comments.

Chrome gets extensions (late, I know)

If you’re a follower of the antics of “The Big G”, then you will be all over their Chrome browser. Having used it for quite a while now, I can say that it sure is a neat piece of software. Well, it just got neater with the addition of extension support and the opening of the extension library. Hold your horses though – it is only in the “Developer Channel” version (v4 series).

Apart from the odd concern about privacy regarding what you type into the address bar (since Google use it to generate suggestions and therefore can track your browsing habits if they wish), what Google have done is shake up the browser market yet again. Like Firefox did to Internet Explorer, promoting standards-compliance, extensibility and customisation, Chrome is now doing to all the other browsers. It is the fastest one out there by quite some margin, and is more stable too. Security is supposedly beefed up too, and the combination of all these features have spurred Mozilla on to improve their own browser, and quickly.

With Firefox 3.6 boasting even faster JavaScript performance, a new look planned for 3.7 (which seems to closely mirror the stripped-down look of Chrome) and new improvements regarding extension stability, security and performance, the Battle of the Browsers looks to be far from over.

Posted: December 22nd, 2009
Categories: General
Tags: , , , ,
Comments: No Comments.

Wordpress 2.9 – a sneak peek

Wordpress is pretty much the de facto blogging platform on the web today. So when a new major release is on the cards, you should sit up and take notice – especially when it has a bunch of tasty new features.

  • Trash – you can now move posts and comments to the trash instead of deleting them outright. This may help those of you who have a habit of dealing with comment management en-masse, and when you accidentally delete that comment you wanted to keep!
  • Post thumbnails – adding an image for posts is now a lot easier for you designers, with the long-awaited feature finally making its appearance.
  • Enhancements to templating – you can now set category-specific, page-specific and tag-specific templates using either the slug or ID of the item you want to template. A thousand template designers just jumped for joy!
  • MySQL requirement has gone from v4.0 to v4.1.2 to generally improve performance and reliability.
  • A new image editor means you can crop images you upload in the back end of Wordpress – a boon for those on the move.
  • Embedding content will be made easier through the use of oEmbed.
  • All this, along with the whole raft of performance improvements and bug fixes, along with new functionality!

You can get Wordpress 2.9 RC1 from today, so give it a whirl!

Posted: December 20th, 2009
Categories: General
Tags: ,
Comments: No Comments.

What do you hack your code with?

I was thinking about how each and every programmer likes to play around with things for no real reason other than for the fun of it. Little scripts which help you do a job maybe, or just something to pass the time (like playing with a new web API). Some people do it more than others – after all, if you code all day then maybe you wont feel like doing it all night too!

The question is, though, what do you hack with? Which languages do you like to use, which tools and so on. I was thinking about this since by day I’m usually a web programmer, dealing with stuff like PHP, Perl and even VB or C# on occasion. However, when I’m working on stuff for myself, I tend to use Python. If I’m feeling adventurous I may dabble in a bit of C or C++!

Tools are a different matter, though. Usually a text editor is enough when you’re quickly hacking together some code – the extra weight of a fully-fledged IDE can get in the way and make things a bit harder. How about you?

Lastly, which systems do you use? I have a pretty powerful desktop PC at home, but I also have a netbook. Usually it is the netbook which I will do my hacking on, while watching a DVD or listening to some music. I don’t know about you, but after sitting in an big office chair all day in front of monitors and a desktop whirring away beneath my desk, I kind of appreciate the freedom and ease of use of a small laptop!

Now I’ll throw the question out to all of you – what do you use?

Posted: December 18th, 2009
Categories: General
Tags: ,
Comments: No Comments.

NetBeans 6.8 is out

NetBeans 6.8 is finally out everyone! Yes, the IDE I use both at home and at work has reached another milestone in its quest to be one of the best IDEs around, but you would be mistaken for missing it entirely.

This version hasn’t had much fanfare and there are no amazingly awe-inspiring new features in there. Sure, if you are in the Java world there are probably some new exciting things relating to more recent Java technologies (I really don’t know much about their ecosystem) but my focus is on all the other languages, frameworks and tools they began to support in the last few years.

As most of my work is web-related, some of the new PHP stuff got me interested. Full PHP 5.3 support is the big one, but Symfony support has also snuck into this version. However, it turned out to be a let down. Apart from these features, there is very little else on offer.

I use a variety of frameworks, and while Symfony has (apparently) great support in 6.8, Zend Framework, Kohana, CodeIgniter and every other framework you could care to mention has been ignored. They do have some plans to try to create a wider, more extensible base for framework support to be ‘bolted on’ but don’t hold your breath. I do believe unit testing support has been improved, but I tend to operate that side of my process from the good old command line.

JavaScript support has improved noticeably in recent versions, along with remote deployment and database support, but some elemental things are still missing. Git source control support STILL has to be added as a 3rd party module (come on guys, it isn’t some weird tech – Linux is hosting in a Git repo), project source browsing leaves a bit to be desired and PHP still feels like a second-class citizen in the NetBeans world.

Still, lets hope 6.9 is a bit better!

Posted: December 14th, 2009
Categories: General
Tags: ,
Comments: No Comments.

Code tests: good or bad?

We’ve all been there. You turn up to an interview for a job, where most of your work will be in [insert programming language here]. There is a code test. You think to yourself, “I damn well hope I remember enough!”. Then it either turns in to either a cakewalk or something approximating Dante’s Inferno.

Are code tests actually worth it? In my eyes, all they do is separate those who have got through to the interview by blagging and/or winging it from those who genuinely know the language. They don’t really test a candidate’s coding ability, all it shows is how fast they can write a solution to a problem, however simple or complex it is.

You can see I think ‘no’ is the right answer here. Well, you’d be kind of right. I have seen so many code tests which would make even the most experienced developer cringe at first glance which are really quite simple, and others which appear to be easy but will get you escorted off the premises quicker than you can say “exponential time algorithm”.

The real question is what do you value from your development team. Do you value a quick solution to a problem you already know the answer to? Or do you value someone who can look at a problem, decompose it into its component chunks and attack it in a methodical way, whilst maybe knowing nothing about the libraries they may need to use or the techniques which are common for such a problem? I would take the second any day – development is rarely a one-size-fits-all business. Sure, you may have done task X for many clients, but I bet their infrastructure, systems and background varied enough to make the code look (and act) completely different from case to case.

Maybe I’m barking up the wrong tree here, but when you’re asking a prospective employee if they can write a quicksort algorithm in Java within 30 minutes all you are doing is replicating their university days. Quicksort implementations are ten-a-penny, and matter not in the real world (since you’d use a tried-and-tested library function anyway). In this business, it is the unknown which causes the problems, not the things which have been done by every programmer at least once in their life.

In short, code tests are a double edged sword. You’re ensuring that your interviewee actually knows what they claim to know, and that they can work under a certain amount of pressure. However, you could write off that new university graduate who lives for development just because they couldn’t implement an arbitrary algorithm within a time frame. In real life, you would give that person access to all the source material they could ever need and they would get the job done, improving their abilities. All you’re doing in the interview is testing if they remember that 9am Data Structures and Algorithms class they took in their first year at university.

After all, isn’t it all about improvement on the job?

Posted: December 6th, 2009
Categories: General
Tags: , , ,
Comments: No Comments.

Google makes the web faster

The web is becoming a bigger and bigger element of ordinary people’s lives. Things they would have done in a program like Microsoft Office are now being done in web apps. Shopping is done online. Surely you will have noticed in your professional careers that more and more work is being done with a web twist. This is why the infrastructure of the web is so important for all developers, not just ‘web developers’.

So, what is this all about? Well, Google have recently begun a big campaign to ‘make the web faster’. They’ve been providing new tools to measure website speed, tips on how to improve it and now, new infrastructure to support it. Welcome to Google DNS, folks!

Yes, Google have launched their own public DNS servers. While OpenDNS has been going for a while, it never really had the backing of a giant like Google. Maybe they should have offered this backing, who knows what went on behind the scenes. All we do know is that Google plans to operate public DNS servers with no censorship, enhanced security and above all, blistering speed.

If this does work out and Google end up making the web faster, what do you think will turn up in the future? Productivity apps are already popping up everywhere, but what is the next step? Distributed and/or remote OSes? Give us your thoughts!

Posted: December 4th, 2009
Categories: General
Tags: , ,
Comments: No Comments.

Welcome to Red Library!

Welcome to Red Library, a new blog devoted to the topic of programming. Since programming is such a wide and varied topic, I hope to include an eclectic mix of news, tips and full-on programming guides and help. Generally anything which takes my fancy will appear here, so watch this space!

If you have anything you want to be covered by this site then just drop me a line! Anything is fair game – maybe it is the newest tool, or maybe it is a new library which has popped up on the horizon and is causing some buzz in the community. Whatever it is, it is worth covering.

Posted: December 2nd, 2009
Categories: General
Comments: No Comments.