Bet you weren’t expecting this…

The Carrington Theme.

I got fed up of my old theme which was breaking badly.. And came to the realisation, That i just don’t have the time to make myself a new theme; and to be honest, This was the first theme which i liked, which took the most minimal cleanup.

Yep. Cleanup.

I am SICK of themes and plugins which are  riddled with PHP Notices/Warnings, Now those of you who are programmers might be saying “Who cares, it works doesnt it?” Well the only answer i have for you is, Yes, It works, But only because PHP is guessing thats what you intended! You see, PHP is a very loosely typed language as we all know, Its it buigest (and buggiest) feature in my opinion. Its allowed plenty of generations of PHP Programmers to take shortcuts, and to not care about their code.

One such annoyance i’ve come  accross with Carrington was this:

[sourcecode lang=”php”]sprintf(__(‘Misc.’, ‘carrington’), $key)[/sourcecode]

Thats not too dodgy, But $key is undefined, Which issues a warning. But  wait, What was the point of sprintf() in the first place?

The major problem i have with themes and plugins (which i’ve not written mind you) is the lazy array index accessing. Let me ask you this: Do you see if theres a car in a Garage before you attempt to drive it out? Or do you just attempt to sit down in mid-air and then realise “Oh! There isn’t anything here!” Well thats exactly what lazy array index access is! Take this example:

[sourcecode lang=”php”]if ( $_GET[‘page’] == ‘carrington-settings’ ) {[/sourcecode]

Its attempting to drive the car out before checking to see if it exists, Thats going to cause a php notice as such:
( ! ) Notice: Undefined index: page in …..php on line x
The answer is VERY simple here… Just check to see if the car exists:

[sourcecode lang=”php”]if ( isset($_GET[‘page’]) && $_GET[‘page’] == ‘carrington-settings’ ) {[/sourcecode]

So there we have it.. Notification that I’ve started using the Carrington Theme, A Rant about horrible coding standards, And I haven’t even begun to explain why I hate “Theme  Frameworks” (In short: They contain a lot of rubbish. 1.5MB across 166 files for Carrington?! C’Mon!)

Oh. PS: Upcoming project – Any ideas?

Leave a Reply

Your email address will not be published. Required fields are marked *