So far we’ve established that CodeIgniter is simple to install, streamlined to develop and efficient to host, but what do we actually get with this package? There are two main areas of functionality provided by CodeIgniter that form the core of its existence: classes and helpers.
Firstly, classes. We are provided a whole heap of pre-built class libraries to help build a back-end that can easily deal with common situations. These are essentially a compilation of well written and thoroughly tested functions designed to simplify the tasks most web-facing applications will require somewhere in their repertoire.
As an example, dealing with user input is notoriously laborious in web development. Collating form data, validating the input, removing malicious entities and formatting the results is the bane of any productive day. However, using the form validation class provided with CodeIgniter is, by comparison, trivial. It allows us to ensure user input is safe and present when required and, coupled with the email class, allows us to quickly generate emails to send back to the user. We can allow file uploads and zip them, we can manipulate images and generate thumbnails and we can keep this all in session data for authentication or displaying errors and notices. The database class ensures we can keep a permanent record of this data easily too, and throughout this whole process we haven’t written a single function of our own.
On the front-end CodeIgniter provides us with a selection of helpers. These are a series of functions designed to literally help with the creation of an interface. Continuing from our scenario above, the form helper can dynamically create text boxes and file upload forms and even populate them with session data or previous input. We also have helpers to format text, HTML, dates and URLs and CAPTCHAs to help us retain our humanity. A full list of CodeIgniter’s classes and helpers can be found in their user guide.
Don’t be fooled by this simplification of CodeIgniter’s rich feature set. Due to the fundamental nature of the framework a certain level of technical knowledge is required to shape CodeIgniter in to something useable – this is not the point-and-click-and-blog service you will find with the likes of WordPress. But nor is it designed to be and the “right tool for the job” axiom is just as appropriate in web development as any other profession. Similarly, there are a few gaps in the CodeIgniter arsenal and we will take a look at these next time.
The favourite whipping boy of programmers everywhere has once again taken its licks in a blistering blog article titled PHP: a fractal of bad design. While no stranger to lengthy lists of its shortcomings the latest attack is a cavalcade of issues that the language suffers from. Apart from the vigorous nodding in agreement, debate online has centred on the most pertinent of questions, “Why would a programmer use this abomination of a language?”
PHP is not universally held in such low regard. It is, for the web layperson looking to dip their toe into the world of development, an easy and forgiving environment which allows them to peruse a few tutorials and have a basic site up and running in almost no time at all. By just creating a text file adding a bit of code, changing the extension to .php and uploading to a web server you can instantly create a site. Skimming a few more articles will have you connecting to a database and proudly running a “real” website. Besides it’s used on some of the largest websites in the world such as Wikipedia and Facebook, they must know what they are doing so it can’t be all bad right?
Detractors would point out that enabling amateur web developers to throw together sites will almost no idea of what they are doing is a recipe for disaster. While the site they produce may indeed work, in the eyes of a developers it is only in the most tenuous sense possible and will most likely be riddled with security holes. When such code bases are inherited the amount of refactoring require means that almost none of the original code will be kept. As a developer you will have to view PHP code that will likely leave you bug eyed in disbelief. For the language itself the bizarre rules of equivalence, the inconsistencies in everything including the standard functions will likely drive you mad. The avoidance of any discussion of parameterized sql statements in the official documentation in favour of telling you to escape your strings is insane. The list goes on and on.
So why use PHP? Simply there is no viable alternative if you need to be able to host your site almost anywhere. Other languages require software stacks and web specific frameworks to run a site, ensuring you will need to have knowledge of more than just the language used. The site produced will probably have to run under Fast CGI on a server resulting in less than grand performance. PHP in contrast is ubiquitous and supported by pretty much all web hosts. It is unavoidable if you are to be a web developer and you will need to know the language even if it is not to be your primary skill. Even then your job most likely will be using PHP given that easily 80% of development jobs will use it.
To know PHP’s shortcomings is to be able to avoid them. You do not need to program in the Cargo Cult, copy and paste method used by beginners. There are a variety of frameworks now available that take care of the boilerplate and require you to structure code with a separation of concerns. While PHP is forgiving when used poorly there is no reason you cannot code in a correct manner following best practices. Doing so will help raise the awareness of these issues with potential developers and allow them to avoid the mess of spaghetti code that has come before. When used with a framework such as Codeigniter PHP becomes almost pleasant to use, but maybe that is the Stockholm syndrome speaking.
CodeIgniter is a Model-View-Controller (MVC)-based application development framework. Essentially this means that each element of an application will be split in to three distinct sections – the model, which deals with data structures; the view, which presents everything to the user; and the controller, which serves to tie the models and views together along with processing other required resources such as user input.
The defining concept behind an MVC architecture is to seperate different aspects of the application whist providing a framework to link them together. For example, since these sections will be the focus of the application’s front-end, our design team can be working away on the view components independently of the rest of the project. This enables the development team to construct the back-end (e.g. model sections) without worrying about conflicting with design changes or, conversely, without preventing the design team from working by forcing them to navigate database issues.
This approach leads to more streamlined coding both front and back. It is easy to define flexible model functions that can be recycled by numerous views. Likewise, views can be created with just presentation in mind and dynamic content can be introduced cleanly and simply by a controller. This structure has the added bonus that models and views are only loaded as they are required which helps keep page load times and resource usage to a minimum.
CodeIgniter provides a well-trimmed solution in other areas too. The first bullet-point in CodeIgniter’s official feature list, entitled “CodeIgniter is right for you if…,” states “You want a framework with a small footprint.” And it certainly delivers. The latest version available for download at the time of writing clocks in at just 3.9 MB uncompressed, positively tiny considering the features we are promised as that list continues. The default installation is also minimal: as simple as copying the files to the web server root. The software doesn’t come bogged down with loads of unnecessary code – in fact, no models are provided whatsoever – just a simple welcome controller and view ensure there exists a default index page. These are easily removed and we’re ready to create our brand new application.
They say that ‘a picture tells a thousand words’ and if this is true, it’s crucial that you get the imagery on your website right. Potential customers will judge your business based on the photographs or graphics that they find on your website, so any images must be professionally presented and appropriate to your company.
It’s worth spending some time carefully editing the images that you use on your website, starting with the home page. This is the most likely entrance for potential customers and the images need to encourage them to stay on your site and convert to a paying customer.
Your homepage needs to be eye catching and include welcoming images that are relevant to your sector. Always make sure that your imagery suits your company ethos – whether your company is strictly corporate, or relaxed and friendly.
You don’t need to stick to the obvious when it comes to imagery. Photographs can be used to suggest the things that you offer, which is particularly important if you are selling a service or idea, rather than a product. For example, a company offering loans might show a picture of a happy couple with a new house, rather than documents or a pile of money. You can buy these types of lifestyle photos from picture libraries such as iStock.
Once a customer has been convinced that your message is relevant, they will hopefully move on to your products and services. If you have an e-commerce site, you need to make sure that product photos are well presented. If a customer can’t see your product because the photograph is blurred or too dark, it’s unlikely that they will have the confidence to buy it online. It’s therefore worth investing in professional product photography, or alternatively source images from your suppliers.
The about page is another place where you should consider placing images. This gives a personal view of your company and is a space where you can introduce yourself and your team. Head shots or a group photo are perfect for this. You could also consider adding a photo of your premises.
At every stage, the quality of the images you use should be your top priority. Pixellated, distorted, dark or blurry images are a big no-no. You need to make sure that all of your pictures are taken with a good quality digital camera. If you’re not confident taking the pictures yourself, consider hiring a professional photographer.
If you’re still not sure which images would be best for you – talk to your web designer. They will have worked with similar websites before and will understand what does (and most importantly doesn’t) work!
In recent days there have been grumblings of disquiet over a few vocal bloggers decrying an apparent rampant overuse of Twitter Bootstrap – a toolkit of simple but elegant HTML and CSS conventions used for building web apps. While this nerd backlash may seem to some to be a storm in a teacup, it’s raised a few heckles with developers who find the convenience of the library to be a good thing.
The issue appears to be the “samey-ness” of websites using the framework. Sites such as the Built With Bootstrap Tumblr feed showcase the variety of websites built with the toolkit. When flicking through the galleries a certain style does leap out and, admittedly, some even use the library “as is”. The result though is not entirely unpleasant, and as one wily commentator pointed out it is better than the ‘Geocities look’ that developers would routinely come up with on their own.
Still, there are others fighting in its corner. Dave Winer has run to its defence and compares Bootstrap to the legendary Apple Macintosh, arguing that the standardisation and ease of use it offers allows people to focus on what’s important with a web application. The negativity he believes comes from people worrying that such frameworks commoditise user experience, will block development of alternatives or even somehow remove creativity from web design. Winer believes that the benefits of adapting to resources like Bootstrap allow developers to build ever better software on these foundations rather than wasting time on the basics over and over again.
I heartily concur with his opinion. From my own perspective I have found working with Bootstrap to be a great experience allowing me to concentrate on the nuts ands bolts, nitty gritty of development without having to worry about how form controls look by default. Bootstrap offers a standardised and useful set of defaults that allow the developer to focus on content and usability rather than wrestling with getting the same appearance with a dozen different browsers. All that and it doesn’t look half bad either.
One of the cornerstones of development is to not repeat yourself. Using third party frameworks or developing your own saves wasted time and allows us to focus on the needs of the customer. Bootstrap is the beginning. The rapid take up and support it has generated shows there is a need for such frameworks. Eventually there will be replacements and soon thereafter Bloggers complaining that everything looks the same. Again.
A few moments spent with Google will reveal that a myriad of frameworks exist for content management systems (CMSs) available for use in web development. A lot of which are free to use, open source and highly hackable to specific requirements. Indeed, it would be easy to think that for every plausible project a neatly packaged solution already exists and is merely a search away.
Here at eSterling, we often find ourselves facing a unique project that doesn’t fit neatly in to any of these pre-packaged solutions. Data structures cannot always be altered due to compatibility with client software or procedure, design often doesn’t lend itself to the required templating brief, technologies are not always realistically compatible, and many other underlying requirements can be present which mean we have to start from the ground up.
However, even the most bespoke of web development projects requires a solid foundation, a way to structure growth and distribute key features whist ensuring maintainability. The vast majority of projects, no matter how niche, will require basic features such as page generation, form submission and basic database manipulation. Furthermore, these features need to be implemented in a secure and robust way to ensure the integrity of each project whilst simultaneously minimising loading times, bandwidth usage and other strains on resources.
Enter CodeIgniter. CodeIgniter is an open source, application development framework, designed to kick-start projects with a well-designed core of those basic features most sites require. Due to the fundamental nature of the tools provided it will happily exist on a variety of server configurations and requires virtually no configuration out of the box, saving headaches and that most precious of all assets, time. It is lean, modular and essentially, unlike many CMSs, it provides no front-end templates or theme (aside from an easily-deleted example welcome page) ensuring that the “default install” look is avoided.
Over the next few posts we will have a closer look at the feature-set provided by CodeIgniter, focusing on how it fulfils our needs in terms of functionality and security. There are also some areas, whilst by design, where CodeIgniter fails to address reasonably fundamental features that crop up time and again, namely user authentication and site administration, and we will see how to plug those gaps.
Last week a few of the web industry’s movers and shakers got together at a quickly arranged meet-up under the rather grandiose title of the Responsive Summit. They talked about how, in the post-PC world, web agencies can deliver websites for the reality of a multitude of web enabled devices. Aside from minor moaning on Twitter about the perceived elitism of the internet Illuminanti deciding upon the direction we all need to take, the response to the Summit has been positive. And the information I have taken from it is proving very interesting.
The hard truth that agencies like ours are facing is that mobile is not only on the rise, but will become the primary internet platform. This was recognised years ago and people boarded the responsive bandwagon thanks to such now legendary articles as Ethan Marcotte’s Responsive Web Design. In tandem with this a small number of people started doing all web design in the browser. The latest movement to pick up steam is Mobile First, whereby sites are designed for phones first and desktops second.
The Responsive Summit was an attempt to view all these developments in light of business realities and offer ideas of how agencies should move forward. So far, one of the major issues discussed is the applicability of the old print design method that has been passed down to the web. In this set-up Photoshop ‘proofs’ are produced for sign-off by clients before being constructed into a website, pixel for pixel. The argument is that this is ridiculous in light of the fact that these sites will now be viewed on screens of massively varying dimensions and resolutions.
Is the answer to produce proofs for a variety of screen widths? This would prove to be exhaustive and expensive work. The suggestion then is to follow what at first glance appears to be a process more in line with that old favourite of developers: agile. This brings the new philosophies together within an iterative development framework with designers working closely with developers to produce working responsive mock-ups for delivery to the client. Using a mobile first mindset and developing primarily in the browser the hope is that we can deliver sites that meet the clients requirements that are workable across the vast swathe of devices on the market.
This would be a large change to the established waterfall development pattern that agencies and clients are used to. Can agencies change their methods so completely? And will the client buy into this?
More information is still coming out of the Responsive Summit and there is a lot to digest, but this is the start of the conversation we all need to have. The future is both exciting and daunting for web developers…
If you’re thinking of giving your website some TLC, you can rely on eSterling to help. Whether you are looking for a simple upgrade such as adding a page, or you are looking to completely re-design your site, eSterling has the solution at a competitive price.
Our experienced web designers and developers are always willing to listen to your special requirements and help you get the best out of your project, whilst our dedicated project manager will ensure that the job will be carried out to schedule.
If you are an existing eMarketing customer, our SEO team will be able to advise you of the best solutions to maintain your current rankings. This minimises disruption to your site and keeps the traffic following even when changes are being made.
Contact us today if you need to:
- Add a new page to your website
- Get a blog for your website
- Re-design your homepage
- Re-brand your site
- Add a video upload page
- Upgrade your CMS (content management system)
Call eSterling today on 0121 766 4080 or email firstname.lastname@example.org to get things started.
As each new year arrives we seem to be subjected to a barrage of pressure to change something, to improve some aspect of our lives by torturous or expensive means.
Stop having so much fun and come and buy a sofa!
This year the January sales have been on since November and there are still Quality Streets left in the tin so as far as I’m concerned they can keep their new leaf, I’m staying as I am. And as January continues, so does my penny-pinching. I’m settling down to wait out the winter (with my chocolates) and to see what happens before I make any major purchases.
January is always a tough time for business, we’re all reeling from the pocket-washing that Christmas brings, but it can also be a time to take stock and get those little jobs sorted that you’ve put off all year. While business is quiet get your web site updated, take those photos you’ve been meaning to, write those three pages of content you need refreshing. Get yourself prepared for when the chocolate-huggers like me come out to play and to spend money again.
eSterling are offering a 10% discount on Web Site orders placed before the end of January 2012. If you’d like to refresh a couple of pages, update stock lists or just give your site an early spring clean, get in touch.
Pass the tin, mine are the purple ones…