Why’s and How’s Behind Commenting

Commenting is a bug bear of mine as I suppose it is with every developer that does comment their code but has to trail through other’s code to work out what’s going on/wrong.

Funnily enough the statistics tend to be that those who comment write ‘better’ (whatever better is) code. My personal belief is that this has very little to do with the skill of the developer but if the code you are writing is coherant enough that consise and to the point comments can be ADDED IN AS YOU GO ALONG! as apposed to code being so complex that you need to write code to explain your code and you take this approach as a coding guideline then you can look at somthing and think… “that just doesnt make sense” and you can re-write it, if you cant comment somthing in one or two lines of comments then perhaps it needs breaking up into explainable chunks. Also if your not commenting at all then what about somone who perhaps isnt at ou level coming along.. are they going to understand your code.

Alot of developers go with the saying “well It’s self explanitory” and while that might be true for the developer writing it for another developer to come along and look at the code out of context and just as a bug to be fixed… well its painful.

As well as it being painful its not helpful.. good fully commented code is a valuable learning resource, you can explain why you did somthing and this will help more junior coders in there journey… ofcourse if you cant explain what your doing then you shouldn’t be doing it.

Coding, Unit testing, code coverage and metrics are topics that get over looked way to often, development in general but especially web development has become less about writing good code and more about writing somthing that works.. for me this isnt acceptable. And whats more, its costly for the agency/company/software house you work for in the long run. If you encourage developers to write untested and below their par code then you can expect nothing less then for it to fail at some point down the line.

Systems change and since the 80′s people have been coming up with design patterns and coding standards to make the transitions easier and less risky.. its time that your bosses understood this. Change requests/tickets/bug fixes are costly for everyone involved but they can be reduced/minimised and in some cases eradicated.

ZF: Redirection and URL param clearing at the same time.

WOW huge gap in posting here, its a long and boring story so I wont bore you.

The Problem

Well a lot of the time in Zend Framework when you run through an action that doesn’t have a view related to it at the end of that action you just want to redirect the user to back to the page they came from or another page in the site. You will notice however that if you just do a plain old:

$this->_helper->redirector( ‘example’, ‘index’, ‘index’ );

This will do the trick in terms of redirection but it will maintain the params that you passed originally, to solve this you may have tried setting the fourth param to null or false, with no success. The answer is pretty obvious:

$this->_helper->redirector( ‘example’, ‘index’, ‘index’, array() );

Pass an empty array as the fourth param and that will clear any pre-existent params on the URL.

SEO: My Rankings and Why?

So a lot has been going on recently with work loads and the like and I haven’t had chance to update the blog… sorry!

My site has been going for around five months now (the home page really hasn’t changed much.. I’ll get round to it!) and I’ve been checking my rankings pretty much everyday just to see if there have been any shifts, and my word has there been! Continue reading

Freelancers: Finding the Balance

As a freelancer I’ve found that what was all my free and available time has now been taken up by wave after wave of incoming jobs. While working full time there is the 9 till 5 ethos, of course if there are deadlines to hit or promotions to be won you will work all the hours god sends but as a freelancer your only motivation is money. This is of course a fantastic motivator but I’ve found it very hard to find the balance between work and play (or sleep as the case may be). Continue reading

Business: Web Networks

Wow big break in posting here, had a lot on… sorry.

Having been around the net for most of my life I’ve seen a lot of new companies come and go on I’ve also seen a lot of the big players like Google and Yahoo grow and develop over a period longer then your average Joe internet users. This can give you an insight into how the internet is evolving and where its likely to head next in terms of monetization and business structures. Continue reading

CMS: Perch CMS

I had a project come in recently which involved using the very small and light weight Perch CMS. And I have to say it was a refreshing experience, the admin section was simple but intuitive, and adding content in is as simple as defining a content place holder in your PHP file, which is automatically linked up to the admin section where you can populate it. Continue reading

Search: Paid For Analytics

I think everyone who owns or runs a website will be familiar with the Google analytics pages and how to navigate them to find the information they need. Its a product most of the small business and personal sites have come to know and love. But what about when you need more, what about when the analytics provided by Google just simply isn’t enough or isn’t updated fast enough to show proper results. Continue reading