Learning something new. Adventures in Web Development

Currently I’m on a bit of a mission to overhaul how I develop my web apps in order to try and update my skills, do things better in a shorter space of time and reduce errors whilst creating more reusable tools for myself. Sure it sounds like a lot but there aren’t many things to it really.

So far my list includes,

Chrome instead of Firefox

Using Chrome instead of Firefox as my primary development browser has made quite a difference to getting stuff done. The Chrome development tools are all there right in the browser so there’s no faffing about installing Firebug. You can still  get quite a few of my favourite extensions for Firefox right in Chrome, such as Webdeveloper Tools, AdBlock and MeasureIt! You can find more development tools in the Google Chrome Store Developer Tools category.

Memory. One of Firefoxes biggest enemies is its self and how it manages memory. Like me I’m sure you like to leave lots of tabs open all day whilst you read blogs, tutorials and develop a few apps with multiple pages open at a time. After a day or two of this Firefoxes memory used to jump for me under Windows 7 to around 1gb, which is huge. Now I’m not saying that Chrome doesn’t use lots of memory, but I do think that because all the tabs are seperate threads the memory management is better. At least my experience of the browser and its speed makes me think it must be, as it rarely slows down. It also looks like I’m not alone with Chrome now accounting for the largest share of the (single version) browser market. (W3c 37%, StatCounter 31%, W3Counter 25.9%)


A gravel pathway in a sunlit forest
Learning a new Framework

I’ve started a project using Lithium to learn how it works, and what the ‘new version’ of PHP is like. As the framework is a spin-off from CakePHP I felt it gave me the best chance of getting up to speed quickly as I’d be familiar with some of the paradigms right off the bat. As Lithium is designed for PHP5.3+ it also makes use of some of the newer features of PHP such as namespaces and late static binding, alongside stuff like closures. Although I’m still to find out what some of these actually mean in practical code.

My new job has me stuck into Magento, which I have to say is entirely fulfilling its legend of a vertical learning curve. Magento is based loosely on the Zend framework, and I mean loosely. It uses a few classes of as a base to extend some of the core modules. Otherwise it’s touted as an MVC framework, but with its own twist. That twist being that it doesn’t adhere to any of the MVC principles and is entirely configured. Which posed quite a challenge when coming from something like CakePHP which is all convention over configuration. Still I’m starting to get the hang of it and hopefully with some attrition warfare I’ll be able to breakdown it’s complexities.

A new front-end

Ah, front end development. It’s great to feel the boon of a shift to better browsers being used as it allows us to start using proper CSS3 bits and bobs here and there to create more luscious interfaces. So in order to help this I’ve been checking out the Twitter Bootstrap, instead of my original HTML5BoilerPlate and after that Zurb Foundation. I have to admit to rather enjoying using the Twitter Bootstrap so far as it seems more complete and fully featured than the other two. I think needs to be a choice for you if you, want something a little leaner to pick and choose what to implement, or like me, you prefer to have a huge raft of gear just right there so you don’t have to spend time hunting for each little bit.

Through looking at the Twitter Bootstrap, found Less and subsequently Sass and Compass. I do recall, albeit vaguely, seeing Sass before and taking a look at it, but not really grasping the power that it had to offer. Now with a short into to Less I get it. I understand the power of the CSS pre-processor! The ability to compile your css from programatical stylesheets using mixins, variable and other tools means that you can really DRY out your code. This is totally awesome for me as I really struggle to keep my stylesheets tidy. I’m forever appending snippet to the end of sheets and repeating tags, so hopefully this will allow me to spend the same amount of time building my CSS, but also leave me spare time to refactor the Less/Sass syntax even further to get things lean.

One of the great things about these methods of course are mixins. The ability to include other peoples styles into your sheets, saving you loads of time in the process. The one that I’ve found so far which is really helpful is Less Elements which bundles in some of the basic CSS3 rules which I use quite often. Because they are mixins you can also abstract all the vendor prefixes, making life really rather simple.

If you want to learn some more about css pre-processors, you can read the Less Documentation or checkout the Getting started with Sass and Compass.

Git’s submodules

A dark grey rock covered with bright green lichenThis was something which I only found recently, but is totally awesome. We all spend time creating projects which use libraries or code built by other people. Lets face it you can’t build everything these days within the timeframe and current expectations. So we use libraries. With Git’s submodules you can checkout other peoples code directly into your project and keep a link to their repo. Thus you can actually maintain a link in Git to the project where you got the code form. This also allows you to update it as they commit and keep it bug free. Brilliant.

Find out more about Gits Submodules in the Git Book, Submodules section. If you want to find out what Git is, find more information on Wikipedia.

Deployment

I think this one is probably going to be the toughest to understand. I’m sure the Ruby and Rails peeps are thinking, srsly? But alas yes, in the world of PHP we have no Capistrano that I’ve found yet. I’m currently aiming to spend some time with Phring and see if it can help to give me a solid way to deploy stuff from version control. After all, let’s face facts, FTP’ing files up to the server is accident prone, slow and annoying, so let’s just not do that any more. It makes way more sense. If you have any tips on a good way to deploy projects please leave me a note in the comments. Currently I’m not even sure what I’m looking for. Having had a small amount of experience typing `$ cap deploy` I’ve no idea what goes into the internals.

The other option of course is to learn shell scripting and write something to make use of rsync, but I’m not sure if I can weave that into a nice command line tool for deploying a commit.

To sort of help this along I’ve also registered with Orchestra which is a PHP platform allowing deployment via a web interface right from your repository. I think this would really help to solve the deploy problem and could potentially be a really great way to hosting stuff in the future. I’m currently testing it and will hopefully deploy my test Lithium app the platform when it’s completed.



Advertisements