We recently had a question on the PHP forums where a guy was trying to create a PHP survey form and though he had bought the Complete Web Programmer package, he did not know which way to go.
The conversation in the forum (PHP forms) fills in more details.
So we decided to work on streamlining and speeding up StudioWeb’s basic functionality. When it comes to user perceptions of a web application’s speed, the most important thing to look at is the request/response cycle. But first, the most obvious thing you can do, is to just increase your server’s speed:
Faster disk drives
Empty disk drives – <50% full disk always move much faster.
… New servers are coming very soon to StudioWeb. In the meantime though, there are things you can do the application’s code itself.
AJAX with JSON
StudioWeb makes heavy use of AJAX to submit answers to the server for processing. So we decided to utilize JSON to send the data – rather than posting just a raw strings of text. What we get out of this, is a much faster response time from the users point of view.
… But now I am getting deep into nerd territory. All you need to take away is that using JSON to pass information to and from a server can speed up things a lot.
I wrote this post originally for killerSites.com but then I figured that PHP programmers are probably the biggest suckers when it comes to page design – in short, you probably need this more than most!
To begin with, look to design principles:
– font use
– color use
If you have your page elements nicely lined up, don’t use more than two fonts on the page(!), keep your page colors properly matched (no clashing colors) and give the page a lot of breathing room (good use of whitespace) … that will go a long of making the website look good.
It’s been a long while since I’ve blogged about anything here … been busy building things.
Refactoring a Prototype
Recently, we were refactoring a PHP/CodeIgniter based project, cleaning up the code from a quick prototype we put out. When you have an idea for a piece of software, it is almost always a good tactic to first put out a rough prototype, to see if it has any legs … will anyone find use in your brilliant new idea?
Get user Feedback ASAP!
Another advantage of quick prototyping, is that you can use user feedback to finetune your app to their needs. I became much more successful as a developer doing things this way, over building a rock solid app from the start. Users will always find flaws in your original ideas and many of your ideas will simply not work … so it’s best to get the app into peoples hands as soon as you can.
Normally people think of laziness as being something negative. Generally it is, but when it comes to programming, laziness can be a virtue. But why?
Programming is all about saving time.
Don’t forget that the whole point of writing software, is to automate some process … to save time. You should carry that forward, into your actual programming as well, where you are always looking for ways to make your code and your coding more efficient. In PHP that can mean:
Leveraging PHP libraries – never write from scratch.
Learning OOP PHP – harder at first to learn, but in the end, writing OOP PHP will save a lot of time.
NOT using PHP when other more efficient options are available.
I think the last point is the only one that needs clarification. PHP is a great language, but sometimes it may make sense to use some outside language or even the server itself to get the job done.
For example, let’s say you need to run a PHP script say every day. The easiest way to get this done would be to run a cron job on your server. This functionality is built into any Linux server and a simple command can be used to run whatever PHP script/page you want:
The above cron code will cause the server to run your PHP page every day at midnight.
Some people may want to figure out a way to do this all in PHP, buy why bother when you can get the job done with one line of code?
What we can learn from the lazy?
The larger point is to always look for ways to save time – lazy people naturally look to do this all the time. They don’t equate success with lots of hard work, they equate success with getting the job done as easily as possible – you should too.
… Of course, some lazy bastards are so lazy, that they equate success with doing nothing at all. That doesn’t work to often unfortunately!
I wasn’t sure what category to put this blog post in, because it isn’t really about PHP code or even about code in general, but there are a few things to learn from my recent update to the Killervideostore.com website:
If adding something to a page/site DOES NOT have any measurable impact, remove it.
Remember that people tend to skim pages, so keep that in mind when structuring your UI.
Seemingly small things can have a big impact on user behaviour and sales.
Remove the unnecessary:
I am always experimenting with different variations to the layouts of our pages – adding/removing buttons, adding a video, replacing link text to image buttons etc … The thing you should always strive for is simplicity – remove what is not needed. Buttons, videos and images that don’t do anything are actually distracting the user.
We recently added a video in our header, introducing the video store to anyone who cared to clicked on the video … very few did. In fact, only about 6% of bothered. Conclusion: waste of space. And so we removed the video.
Check out the old killervideostore header- with video in place:
.. Just click on the above thumbnail to see what it was like.
When people come to a website, they skim the pages quickly … unless you catch their attention with something. So you need to remove clutter from the page to increase the chances that people will find what they are looking for.
Little Things can be Big Distractions!
I can’t overstate how important it is, that you make changes to your websites very cautiously … especially when you have something that is working.
Over and over again, I’ve been amazed at how even seemingly simple things, can have a huge impact on user behaviour. For example, we once turned our store pages from a light green to a dark green … and watched sales immediately drop 50%! We then reversed back to our old lighter green and sales jumped right back up.
One of the mistakes web developers make is to spend too much time perfecting the code base in a project. This waste too much time and ignores one very important fact: you need to get the software into the users hands as quickly as possible, so they can give you feedback.
… Most end users/clients have very little idea what they really want before they actually use the software. Once they do get their hands on it, they will be able to give you much more accurate feedback in terms of what the software should do ultimately.
In the following vblog I address this issue, framing it in the ‘good enough’ principle of application development:
I just wanted to announce that we will be releasing a PHP log in system video tutorial within a few days.
Like all our videos, as you learn to build the project at hand, you will be secretly taught reusable PHP techniques and even some dreaded PHP nerd theory! Don’t worry though, the nerd theory will be woven into the videos, so you won’t even notice it seeping into your brain.
Many of the videos will be released on this blog for free, but the whole course (and source files) will only be available to Killersites University subscribers or as part of our upcoming complete web developer training package.
… Yes, a shameless plug but nerds need to eat too (and play video games) so we have so charge you guys a little sometimes!