Skip Navigation
+44 1273 906 908   hi@addedbytes.com @AddedBytes
Added Bytes

Blog

Paypal payments are available in Magento for all shops, but there is an issue with Paypal handling rounding of pennies when adding tax to orders. Here's how you fix the problem.

Read the rest of this post »

Going Freelance - First Impressions


9 October 2012   |   Comments   |   freelance

On September 10th, I started a new chapter of work as a full time freelance web developer. I'm a month in, and I've already learned some valuable lessons.

Read the rest of this post »

Just a few short years ago, options for Open Source PHP ecommerce platforms were extremely limited, and often the only way to put together an ecommerce store online was to have a bespoke system built. Not any more, though - now there are plenty of options. We take a look at the top five contenders to see what each has to offer.

Read the rest of this post »

Going Freelance


23 August 2012   |   Comments   |   freelance

From early September, I'm going to be leaving my former employment, where I've spent the last four years wrangling code deep in the bowels of the likes of Magento, MODX, Drupal and OpenCart. I want to build something for myself - and that means leaving the stability of full-time employment and venturing into the lesser-known realms of entrepreneurship and self-employment.

This will give me a great chance to spend more time with new technologies. Agency life often doesn't provide much time to get properly to grips with new languages or skills, unless they are already in use within the agency. I'm looking forward to spending more time with Python, node.js, SQLite and other technologies that, so far, I've really just dipped a toe into.

Even more exciting, this move offers the potential for me to spend more time working on my own projects. Cheatography and Envoy have been running for a while but lacking the attention they deserve. Newer projects, on which I'll write more shortly, have also suffered from a lack of available time. This decision should allow me to turn more of the ideas floating around my head into actual working websites, with a view to then becoming profitable ventures.

If you're reading this on the site, you might have spotted a few changes here as well - a new logo, new homepage and new portfolio being the most significant changes, all geared towards making a more prominent feature of my services and previous work.

To begin with, though, my focus is on making sure I have an income that can comfortably provide for myself and my growing family. So I'll be taking on freelance projects and focussing on the things I know best and that I've spent the last few years with - PHP development (especially Magento, MODX and Drupal).

I'm enthusiastic, capable and, in a few short weeks, available for your project!

Four Weeks of Cheatography


11 November 2011   |   Comments

Four weeks after launch, how is Cheatography doing?

Read the rest of this post »

Introducing Cheatography!


14 October 2011   |   Comments   |   cheat sheets, cheatography

After several years and plenty of different versions, my new cheat sheet project has open doors. Come check out Cheatography! (There are three new cheat sheets too!)

Cheat-what?

Cheatography was born a long time ago, the spawn of the Added Bytes cheat sheets and the short-lived cheat sheet request system. It was obvious from the requested cheat sheets and number of votes for each that there was no way I could produce as many cheat sheets as were wanted and that I did not know enough about many of the topics to provide a decent reference for them.

The solution seemed obvious - build a site that allowed people to make their own cheat sheets. And so, Cheatography was born.

Building begins ... and stalls

The first few incarnations of Cheatography were an attempt to build a system that would allow anyone to create a PDF cheat sheet in the style of the others on Added Bytes. This, it turns out, is harder than you'd think. Despite the proliferation of PHP-based HTML to PDF converters, issues like line wrapping, nested tables, font kerning and distribution, page headers and file sizes stopped me from finding a way to produce PDFs that were of a high enough standard to produce and print.

Bit of a shame, that. I'm still working on it though, and hope to add high quality printable versions of cheat sheets to Cheatography in the near future (and things have been looking up recently thanks to TCPDF).

Better than PDF

But as one door closed, another opened. While I couldn't do PDFs the way I wanted to, I could now use HTML, and that meant I could include all sorts of new goodies - comments, videos, images and links just to start. It also meant cheat sheets could be properly bookmarked, were quick to download, and best of all quick to update and add to.

The down side, unfortunately, is that they don't print nicely at the moment.

And that is where Cheatography is up to now. It's a resource for cheat sheets and a platform to help you build your own.

What to look at?

There's plenty to see already on Cheatography. I'd suggest starting with the newest content though - while building the site, I had the opportunity to put a few new cheat sheets together:

Most of the cheat sheets from here have also been transferred over into HTML format, and several have been improved and had some long standing bugs fixed. You can see them on my Cheatography profile. I've also linked to them from the cheat sheet pages on this site.

What if I find a mistake or bug?

The site is in beta at the moment, which means it's a bit new and there are still bits that aren't quite perfect. If you find a problem with anything relate to the site, please email support@cheatography.com (or leave a comment here if you prefer). I'd also love to hear your thoughts, feedback and suggestions for how I can improve the site!

What was that site called again, Dave?

I'm glad you asked that, anthropomorphically personified website. Come check it out at Cheatography.

If PHP Were British


20 August 2011   |   Comments   |   php, development, humour, empire

When Rasmus Lerdorf first put PHP together, he - quite sensibly, despite his heritage - chose not to write it in Greenlandic or Danish. Good job too - that would have been rather unpleasant to work with. He opted instead, being in Canada, for a more local tongue. No, not French. Not Canadian English either. No, he went for that bastard dialect of the Queen's English commonly referred to as "US English".

PHP developers in Britain have been grumpy about this ever since. What was he thinking? And more importantly, how do we undo this travesty? How do we developers ensure the traditions of the British Empire continue to be upheld, even in the digital age?

A Slap in the Face

$variable_name

The first, but maybe the most important, of many changes that will allow PHP to achieve a more elegant feel is to remove that symbol so beloved by the US and replace it with something altogether more refined. More solid. More ... sterling.

£variable_name

Getting Started

<?php
    echo 'Hello World!';
?>

How many of today's British programmers have been put off at the outset by the brazen informality of this simple yet obscenely Americanised program, colloquially referred to as "Hello World"? A more Imperial, formal introduction might encourage a greater proportion of young British talent to remain with the language and thus give the broader community a more urbane air.

<?php
    announce 'Good morrow, fellow subjects of the Crown.';
?>

Abbreviations

Few things are more abhorrent to the British than unnecessary abbreviations. "Text speak" is unheard of on the streets of London, as the natural ingrained British grammarian simply refuses to stoop to sending messages of the "c u soon traffic kthxbye" variety, instead proferring something altogether more elegant: "Dear Sir/Madam. I will arrive as soon as time allows, which I expect to be within the hour. I assure you the horses shall not be spared. Yours respectfully." (slower to type, yes, but we do not like to be rushed).

PHP, on the other hand, is full to bursting with abbreviations and acronyms which are entirely unnecessary:

str_replace()
is_int()
var_dump()
preg_match()
json_encode()
mysql_connect()

The following changes should improve things:

string_replace()
is_integer()
variable_dump()
perl_regular_expression_match()
javascript_object_notation_encode()
my_structured_query_language_connect()

Edit: I have corrected the expansion of "preg_match" - thanks to those who pointed it out.

Eloquence

if ($condition) {
    // Code here
} else {
    // Code here
}

Shakespeare would be ashamed to see his native tongue twisted into this monstrosity. Brevity is to be applauded in the right context - in some dark corner, where it shall be seldom seen - but not here. The if ... else block is the most used conditional code in all of PHP, so it must be made as inoffensive as possible. There are many options for its replacement, but this may be the strongest:

perchance (£condition) {
    // Code here
} otherwise {
    // Code here
}

The same naturally applies to the Americanised switch ... case construct, which one can only describe as clunky and unpleasant:

switch ($variable) {
    case $option1:
        //Code here
        break;
    case $option2:
        //Code here
        break;
    default:
        //Code here
        break;
}

Words such as "switch", "break" and "default" are hard on the reader and lack context. The Right Honourable biggerthancheeses was kind enough to contribute a more gentrified suggestion (and has some interesting ideas, particularly around replacement of "include()" with something like "i_might_be_partial_to()", demonstrating a natural talent for the Imperialisation of programming languages):

what_about (£variable) {
    perhaps £possibility:
        //Code here
        splendid;
    perhaps £other_possibility:
        //Code here
        splendid;
    on_the_off_chance:
        //Code here
        splendid;
}

Spelling

imagecolorallocate()
serialize()
newt_centered_window()
connection_status()

Words fail me at this point. How is any self-respecting gentleman expected to make head or tail of these "words". It beggars belief that anyone could allow such distortions of words to be entered into a programming language. They, along with the cornucopia of similar errors, should be reverted to their proper forms immediately:

imagecolourallocate()
serialise()
newt_centred_window()
connexion_status()1

Manners

try {
    // Code here
} catch (Exception $e) {
    // Handle exception
    die('Message');
}

The try ... catch block is an excellent example of PHP's lack of manners. Far too direct to be allowed in the new PHP. Additionally, the word "die" is so very depressing. This new block, although more verbose, is vastly more polite and upbeat:

would_you_mind {
    // Code here
} actually_i_do_mind (Exception £e) {
    // Politely move on
    cheerio('Message');
}

Class

Perhaps nothing is as important and ingrained in the British psyche as the notion of class and, while there are few opportunities for change within this part of PHP, the changes that there are to be made here are important.

class Republic {
    public $a;
    private $b;
    protected $c;
}
$example = new Republic();

To begin with, the current system has no place for class hierarchy and this is unacceptable. So we shall begin by giving classes specific levels - upper, middle, working - and no class can access the methods of one of a higher level without the explicit permission of the higher order class (of course, though it might then have access, it would not be a true member of the higher order and could not itself grant higher order access to other lower order classes). "Public" and "Private", in the British class system, are often synonymous (see, for example, school system nomenclature), so these must be adjusted, as should the "Protected" property visibility. The word "new", while passable, has a much more appropriate replacement in matters of class.

upper_class Empire {
    state £a;
    private £b;
    hereditary £c;
}
£example = nouveau Empire();

The Sun Never Sets ...

It is hoped that these few simple changes will improve the reputation and status of PHP among other languages. No longer will it be the poor American cousin - instead it can take its rightful place as the - British - King of the scripting languages.

Thanks

Many thanks to Mark and Pat, former colleagues, who helped start this resurrection of the British Empire in the pub on Friday.

1. Yes, connexion.

Basic Linux Command Line Tips


18 March 2011   |   Comments   |   linux, tips

Learning your way around the command line is essential if you are developing with PHP (or Python, or a myriad of other languages most at home on Linux) and interacting with your server(s) with anything other than FTP and basic control panels. Here are some tips and tricks I've found useful.

Read the rest of this post »

Importance and Priorities


6 October 2010   |   Comments

We've been arguing at work lately about important and priority levels. Our bug tracking system allows for virtually limitless options as far as categorisation goes, yet we're having trouble coming up with a system that works.

Read the rest of this post »

Page Load Metrics


23 July 2010   |   Comments   |   ecommerce, performance

A recent client wanted some specific information about performance and load times for an ecommerce store. There are best practices, of course, and lots of factors that can affect load time, and most ecommerce shop managers also want lots of imagery, so a more detailed breakdown of load times and items was required.

Read the rest of this post »

Hi! We are Added Bytes, a creative team of e-commerce experts from Brighton, UK specialising in Magento websites.
We are available for projects starting in September.
Check out our Services and Portfolio or Get in Touch!