Archive for the ‘Tips’ Category

Working from home: Month 1

Wednesday, August 31st, 2011

I have just completed my first full calendar month of the new teleworking arrangement I have with my current employer, so feel it is a good time to write down some of my feelings and detail my experience thus far.  My arrangement is to work remotely for 3 days of my 5 day week, travelling in to the office on two consecutive days, typically Wednesday and Thursday.  This tends to break up my week very nicely in to easy chunks: Monday-Tuesday at home, Wednesday-Thursday in office, Friday at home, and then the weekend.  This in itself is one of the biggest advantages in my view; I get 3 ‘fresh starts’ per week where I can be ultra-productive.  Rarely do I now get ‘that Friday Afternoon feeling!   Following are some tips I have if you are about to start working remotely (and a lot of these points apply to freelance workers too)

(more…)

Distractions – a useful Firefox plugin to stop them in their tracks

Thursday, March 31st, 2011

At work, I occasionally found that if faced with a particularly mundane piece of work, or something that dragged out for a long period of time, it would be quite easy to get distracted by popular sites such as twitter, BBC news, engadget and various other tech-related but not entirely productive sites.

I thought “someone else must have had this problem”, and if they hadn’t, I was going to write a Firefox Add On to help maintain productivity by blocking distraction web sites. But, alas, someone has beaten me to it! I have found and installed the LeechBlock Firefox add on and it is fantastic. I’ve added my favourite sites to a list of sites to block at any time that isn’t a break time (so here, 9-11, 11.15-1, 1.30-3, 3.15-5) and it’s proven very effective.

Linux: How to recursively download contents of an FTP directory

Tuesday, March 8th, 2011

I was looking for a quick way to recursively download the entire FTP directory for a site that we are transferring. This was, I found, the easiest and most straightforward way:

On the command line interface, assuming you have wget installed, type:

wget -r ftp://USERNAME:PASSWORD@mysite.com/

Hit enter and wait while it retrieves everything for you.

I did it this way because I didn’t want to download 4gb of data to upload again, so ran this command direct from the ‘production’ server with its stupidly fast internet connection. Hours and hours saved!

Commenting code – a minor but invaluable investment of time

Wednesday, November 3rd, 2010

I’m a strong believer in code being written in such a way that it is self documenting, but would not use this as an excuse for not adding in English language comments to go alongside the code. After all, comments add a tiny amount to the size of a PHP file and don’t slow down the application at all. Also, the English language comments alongside the code can be used to justify decisions or assumptions you have made, which might make the next programmer’s visit to the file a lot quicker and more productive.

(more…)

Coding things the quick way – often a false economy

Wednesday, August 4th, 2010

I have recently been tasked with making some changes to the central ‘library’ of code that an E-Commerce platform is based on.  Essentially, the ‘models’ for this application are all in a central, shared location, and all of the ‘installations’ of the e-commerce platform have their own set of controllers and views that interact with these models.  The changes I am making involve making the deletion of products reversible; so instead of actually deleting products and associated assets, a flag is merely set in the database; is_deleted = 1.  This, at first glance, seems to be quite a simple task; alter the database tables to add the extra column in, and make a change to the central models in Model_Product::deleteProduct and any product ‘getter’ functions, eg Model_Product::getProductsByCategoryId.  However, due to the way that the platform has been developed and individual customisations to the installations of that platform have been made, things aren’t quite so simple.

(more…)

Some simple steps on the “front end” to reduce web page download time

Wednesday, July 14th, 2010

A few years ago, page download time was a big focus for most web developers, as the majority of people connected to the internet were accessing through “dial up” connections, which we all remember for their awful connection noises and the horrific download speeds.  But with the development of faster internet connections in the developed world, the focus on page load times has been sacrificed for nice looking graphics, chunky javascript libraries and massive CSS files.  But there are some quick, simple steps that can be taken to keep all of the improved functionality and look of a web site but reduce the page load time a little.
(more…)

Simple steps towards accurate project estimates

Wednesday, May 5th, 2010

A mistake that many developers (including myself) have made in the past is to over-promise and under-deliver in terms of the absolute deadline or the number of hours taken on a project.  Getting to the “missing the deadline” or “being over budget” stage can be especially demotivating – you’re costing yourself (or your company) time, which is valuable, and also the client is likely to be getting slightly irritated (if you are late).  The steps or methods to reduce the chances of this happening in the first place are simple, and easy to use.
(more…)

Should you sanitise your HTML before or after you save to your database?

Monday, April 19th, 2010

In starting a new project completely from scratch we need to decide whether to sanitise html (that is, convert & to &amp;, < to &lt;, and strip out blacklisted html) before or after we saved to database.  In projects I’d worked on in the past this had been done inconsistently in different areas of the application – ie, pre save in some areas and on select in others.  After having thought through the problem I think I’ve decided on which option I prefer: Sanitise after selecting from the database, rather than before saving to the database.

(more…)

How I organise my project information to save time.

Monday, April 12th, 2010

It shouldn’t be news to anyone, but organising your projects (and assets within those projects) in an efficient manner will save you a load of time.   Perhaps not immediately, but at some point in the future you’ll be thanking yourself hundreds of times over that you took the time to organise things in the first place.

(more…)

PHP Developers (and Web Design companies): Consider using someone else to check your work!

Monday, March 22nd, 2010

We’ve all been there.  Working flat out on a project for day after day, to finally see the light at the end of the tunnel and start to consider launching.  But wait!  This is a dangerous situation to be in.  Having looked at the same site for so long, you’re not going to be able to spot the mistakes that you’ve made.  It’s worth spending an extra couple of hours to double-check your work – rather than have the embarassing situation of launching a site with mistakes present.

(more…)