tips for life

23/09/2009

On the 21st November 2009, my son, George, will be 1 year old. Just before he was born I had an urge to write down all the things in life I wish I had been told before I embarked on this mad little journey. However, because I’m a lazy arse, I never got round to it.

So now that his first birthday is fast approaching, I’m about to get all philisophical and share my tips for life. In this first post I will list all of my tips, I will then elaborate on each one in subsequent posts.

It is also worth noting that I left out some obvious points such as ‘Live every day as if its your last’ and ‘Life’s too short’, these I consider to be pre-requisites!

I want to give a bit of recognition to an excellent post which inspired this one a little bit. So make sure you check out 100 ways to live a better life.

And finally, here are my tips for life:

  1. Silence often says more than any words.
  2. Learn something from every single person you meet.
  3. Be kind and sharing but ultimately be selfish.
  4. Support Liverpool F.C.
  5. Don’t take yourself (or anything for that matter) too seriously.
  6. If you’re happy, carry on what you’re doing, if you’re unhappy, change whatever it is you’re doing.
  7. Be humble.
  8. Appreciate how lucky you are.
  9. Be confident.
  10. Ask questions.
  11. Be reflective.
  12. See the good in everyone.
  13. Rise above adversity.
  14. Support Liverpool F.C.
  15. Don’t take things personally or get defensive.
  16. School will be the best years of your life despite how you feel at the time, but remember school is only a small part of your life.
  17. Enjoy being a child/don’t grow up too quickly.
  18. Observe.
  19. Do things for you.
  20. Support Liverpool F.C.
  21. If you cant say anything nice dont say anything at all.

Now listen to this classic (lyrics).

No Comments

do the simple things well

17/04/2009

If any young web developer (of which I am one myself) should be stupid enough to ask me for advice, it would be to do the simple things well.

When I was an up and coming footballer (soccer-er), many a coach told me to ‘do the simple things well’. A player who can control the ball well, pass the ball simply and do all the basics well will get a lot further than the player who tries to do too much, tries to take on too many players and tries to score the perfect goal.

Of course there are the odd exception to the rule, but then even players who are known for their skills such as Ronaldo have benefited from being reigned in a bit. Alex Ferguson is often credited with turning Ronaldo from a spectacular player with no end product to an all round superstar (for the record I hate Ronaldo, Fergusan and all thgins Manchester United).

Going back to my original point, if you can do the simple things well then you can go places. This is not only true for football of course, but is also true with web development and indeed most things in life.

Here come the acronyms

Unless you have been living under a web development rock for the last decade you will be familiar with the term KISS. Just to remind us this stands for Keep It Simple Stupid. As much as it is now a bit of a cliche (and I hate Cliche’s) never has an acronym rung so true.

I would take a web developer who comments their code well, organises things well with sensible directory structure and naming schemes over some web developer ‘guru’ who ignores these assets any day.

It all boils down to what makes a good web developer. Where some people may argue that experience and a good understanding of advanced methodologies make a good web developer, I think all of this is in vain if they cannot do the simple things well.

It is true and some what essential that you are constantly learning new things and expanding your knowledge on a daily basis, but this will all be built on a better grounding if you can do the basics and indeed the simple things well. In effect you don’t want to leave any demons behind when you move on to the next stage of your development as they may come back and bite you in the ass.

2 Comments

spotify = music heaven

19/01/2009

I recently started using spotify after I saw someone I was following on twitter rave about it, and all I can say is…awesome.

logo

Spotify is basically a music player, much like itunes, where you can search tracks and listen to music. The greatest thing about spotify is that you can listen to (almost) any track in the world! It is just like having your own personal radio. You even get the annoying adverts, which in actual fact, aren’t nearly as annoying as you might think. You hardly notice a short audio advert, and I much prefer it to having a great big flashing banner hit me in the face whilst searching for tracks.

It’s catalogue of tunes is seriously huge, imagine having an ipod with every song in the world (almost) on it and that’s what spotify is. What makes it even more great, is a sweet ass interface and search.

it even scrobbles!

Yep, after numerous requests and attempted plugins, spotify finally added last.fm scrobbling support. This is a killer feature for me as I am a keen user of last.fm. Would love to see more last.fm integration, such as being able to ‘love’ a track directly form spotify, but then we get in to the realms of just recreating last.fm, which is not what it’s trying to do.

If you haven’t checked out spotify then I urge you to, invite only at the moment for the free version (I got 4 invites left, drop me a comment if you want 1). If, like me, you spend all day at a desk, listening to tunes whilst you tap away at a keyboard, then this is perfect for you.

No Comments

the metro, best paper in the world?

12/01/2009

If you want in depth analysis of the news and current affair, then go for The Times or The Telegraph. If you want some tits and an irreverent look at the latest gossip then go for The Sun or The Star. If however, you want a mixture of the both and in an easy to read bit size format, then the metro is what you are looking for.

its like newsround in it

I was always a fan of Newsround when I was younger, it gave the kids the latest news in a simple yet informative matter, and was a nice 5 minute overview of the headlines affecting the world. The Metro is Newsround in paper format. Ok not so dumbed down and the local ads for casual sex would certainly not be found on Newsround, but the way in which it breaks down the news is brilliant.

its branched to your locality

Despite focusing on the national headlines and gossip it also dedicates a section to local events, reviews and jobs. Thus combining a local paper to the Times/Sun combo mentioned earlier. It is really quite brilliant to read a major news headline and then see that the restaurant 5 minutes down the road does an awesome sirloin steak!

it has a fascination with science

I love the little microcosm snippets and the friday metrocosm section. It is really intriguing to read up on this science and I find it quite fascinating. This is partly to the way they do it, again breaking it down in to bite size chunks, with neat diagrams and graphics.

it loves the web

They have a new section which basically rounds up all the things that are viral on the web for you to muse at. It also regularly features news on things like twitter (can you imagine the Daily Mail doing that?).

its ermm FREE!

Thats right its absolutely free, my favourite price. Its a commuter paper, and as I’m a commuter I think its bloody great. For those of you who don’t work in a city, or don’t commute you may not have come across the metro, and if that’s the case then you are missing out. It’s an awesome paper and definately makes my commute that little bit faster!

No Comments

new years resolutions

7/01/2009

Firstly, Happy New Year!

In 2006 I graduated, 2007 I got married, 2008 I had my first child….2009 has a lot to live up to!

To make sure it doesn’t go down the pan I thought I’d better make some resolutions, so here they are in all their glory…

exercise more

Ok lets get the obligitories out of the way

eat less

See above

blog more

Having just become a Dad, I’m finding any spare time to be a rarity. However, I need to pull my finger out and blog more often, starting with this one (if this is the latest entry in a months time, then you have my permission to punch me in the stomach)

get more involved

Even simple things like commenting on blog posts and twitter updates. I read so many of the things, but can never normally be bothered to put my 2 cents across, this needs to change, because my opinion is quite frankly, awesome :P

get motivated

With the run up to Chrimbo, I seemed to lose all motivation for work and the web, I’m sure having a baby had something to do with this as well, but I definately want to get this back in 09 and I will damnit.

frameworkerisation

Want to start developing with a framework, with Zend being preferred choice for PHP and am still musing over a javascript framework to go with, jQuery and MooTools are in pole position at the mo.

get back into css

I use very little html/css these days, with the bulk of what I do being purely php, which is how I prefer it. However, I would like to get back into css and having read Transcending CSS: The Finid Art of Web Design I think I need to get back into it before it all goes completely over my head.

become zend certified

This is like 3rd year on the trot this has been a resolution, but who knows, maybe this year will be the year. Just need to find someone who wants to pay for me to take the exam…

attend a conference

Again this one hinges on someone paying for me, because I’m a tight git. Would love to go to FOWA, PHP conference, PHPNW etc. and hope I get the chance in 09.

1 Comment

follow me

7/01/2009

As Craig David once sang, follow me…

http://twitter.com/jenqo

No Comments

php namespace seperator

28/10/2008

For those of you who are keeping up with the latest developments of the PHP language, you will know tha they finally decided on the serperator used to seperate namespaces, and to almost everyone’s horror they went with…

\

…that’s right, a bloody backslash. I think Paul Jones summed up what we are all thinking in his i.m. transcript.

Ok, so pretty much everyone agrees, that a backslash, blows…but what could be used as an alternative, I know a few people have suggested a single dot (foo.bar()) but this will make it ambiguous withs string concatenation. The original contenders were as follow (assuming the namespace foo):

  • foo\bar()
  • foo**bar()
  • foo^^bar()
  • foo%%bar()
  • foo:>bar()
  • foo:)bar()
  • foo:::bar()

I think the triple colon would have been my shout, sure it’s an extra character, but it fits in well with what we know so far. Would love to hear other people’s opinion on what they would prefer, if their not happy with the backslash.

2 Comments

mysql order by numeric difference

1/10/2008

Whilst recently implementing a discount system for an e-commerce site I needed to apply the biggest discount should there be a product which was eligible for more than one discount. As the system allowd x for y type discounts I needed to order my results with x-y so I could find out which of the x for y discounts was the best value for money.

In order to do this I used something like the following SQL:

SELECT discount FROM discounts WHERE ABS(x_value - y_value) DESC

With thanks to:
http://www.bradino.com/mysql/order-by-numeric-difference/

No Comments

first 5 steps to maintainable code

10/09/2008

Bad, untidy, ugly, messy code is one of my pet hates. This is by no means a definitive post, but a few guidelines on how to instantly make code less ugly and more maintainable. Please don’t think that by applying these 5 steps that your code will instantly be maintainable, however it would be a good place to start!

1. indent your code

If I open up some code and its not properly indented, I have to wade through the code and indent it correctly. It honestly makes it soo much easier to read and make changes to, if everything is indented properly. Sometimes I wish PHP was like Python and absolutely required code to be indented properly.

I cannot stress this enough, indent your code!

2. name variables meaningfully (but sensibly)

Another one of my pet hates. Variable names like the following…

$mv = 'blah';

I would much rather have to spend an extra few seconds writing a longer variable name which makes sense, so in our example above, something like…

$my_variable = 'blah';

Now, this also requires some common sense. Yes longer variable names are good if it makes them more meaningful, but that doesn’t mean you should go overboard, for example…

$this_is_my_variable_name_right_here_long_and_meaningful = 'blah';

…is just taking it a bit too far.

Meaningful variable names should also be used in the database. For example TABLENAME_id is far better than simply id.

3. comment your code

There is no such thing as ’self documenting’ code. Sure you can write some code which is really obvious what it does, but if there’s any doubt what so ever, even a smidgin…write a frickin comment.

It will take only a few seconds extra and could save the next developer hours.

There is also no such thing as over-commenting, although quality should always trump quantity.

Also worth mentioning is docblocks, these are excellent and means you can use a documentation tool such as phpDocumentor to create documentation for your code.

4. use a coding standard

Coding standards make life so much easier, especially when developing in a team. They set the development rules. Without rules, anarchy ensues, and the same goes for code. I hate to have to open some code and see something like the following where different developers have added or edited the code…

require_once 'blah.php';
include("foobar.php");

if ($foo == $bar) {
    $random_array[] = 'hello';
}

foreach ($random_array as $word)
{
    echo "hello";
}

Using a coding standard you would not get the mixture of bracket placement, the single and double quotation mash-up and you wouldn’t get the combo of require_once and include().

There are a few coding standards out there, but the one I would go for is the PEAR standard.

5. separate code and html

I’m not going to get into a spiel about MVC (I’ll save that for another post) but what you should definately have is a clear separation between your code and your html. Even if this means just having your code at the top of the page and the html at the bottom, it’s a start. However, ideally you should be putting your html is a separate file, bonus marks for using a templating engine.

1 Comment

obligatory dev tools post

9/09/2008

I’ve been blogging now for a few months (albeit quite sparsely!) and I think it’s about time I write the obligatory dev tools post. These are tools that I use day in, day out and couldn’t imagine developing without. If you have any which you would like to add, please do so in the comments below…

editor/ide

Texpad – love its flexibility and simplicity. Does everything I need, never crashes and has loads of settings.

ftp

Smart FTP – ok, so you have to pay for it, but it really is the best ftp client out there.

honourable mention

FileZilla – a nice, simple, free solution. Seems to update all the time, which is a bit annoying, but other than that a very nice alternative to smart FTP.

database management

PHPMyAdmin – Was torn between this and Navicat for the main spot, but went for this because it’s free.

honourable mention

Navicat – This has some really nice features and is a lot more enterprisey than PHPMyAdmin, but then you have to pay for it :(

browser

Firefox – at the time of writing Google Chrome has just been released and so far it looks good, however firefox is still number 1. Everything about it just feels right, and the add ons take it to a different level.

honourable mention

Google Chrome – just released, but looks by far the next best thing after firefox, and who knows, could even surpass firefox one day (Tangent: isn’t google developing a browser a bit of a conflict of interests, considering the money they plough into firefox?!)

firefox extensions

Web Developer – the mother of all firefox webdev extensions. If you’re a web developer and you don’t have this plugin, you may as well go home.

Firebug – Another plugin I couldn’t live without. The inspect function is awesome, the javascript console and debugging is incredible, again this is a must have.

HTML Validator – Validates pages as they load and has some nice features like tidying up the html.

Color Zilla – Lets you instantly get any colour from any web page with the handy colour picker.

Screengrab – Allows you to easily take a screengrab of the page, visible portion or just a selection.

YSlow – A plugin for firebug this allows you to see how fast your page is and where you could improve.

Delicious Bookmarks – Allows me to easily bookmark pages and also gives me access to my bookmarks at the click of a mouse.

Bloglines Notifier – A bit naughty this one, but when you love bloglines as much as me it makes sense.

version control

Tortoise SVN – If you’re using subversion then you need to have this gui tool (if working in windows).

regex

Regex Builder – There are loads of online ones, but I like this one for its simplicity and quickness. Shame it requires the .net framework though.

misc

Stickies – Very useful when having to log time. These handy sticky notes sit on your desktop so you can easily record what your working on and between what hours.

Ok, so that’s my list. If you would like to add to it, or feel there’s a tool out there which you can’t believe I don’t use then please point me toward it.

2 Comments