skip to content

DerekAllard.com : CodeIgniter, ExpressionEngine, and the World of Web Design

Things worth reading

June 16th, 2008

I've been kind of in isolation the last week or so, (more on that in another post) and I've not even taken the time to read my RSS feeds latesy, only skimming a few things here and there, or marking things for reading later. So today, I had a bit of time, and boy am I glad I took the time to re-visit those! Here are a few wonderful things worth your time to read.

  • How To Make An IP-To-Country Tool With PHP and MySQL. Mathew Pennel, web monster and editor of Digital Web Magazine has written up a wonderful article here. I find myself linking to one article every month or two that this guy writes and nodding my head knowingly. This guy is great.
  • Doctor Jones has completely made me re-examine Apple's Spaces with his article My Day With the New Spaces.
  • jQuery for Designers has written up Coda Slider Effect. Its sexy as all get out. GREAT work there Remy. This is super well done. I will be stealing inspired by you soon!
  • Continuing on the jQuery train of thought here is the always excellent jQuery blog. Recently they wrote jQuery UI v1.5 Released, Focus on Consistent API and Effects which contained a few big tidbits in there. Biggest? API standardization. Unless you're a nerd of pretty high-order, that's probably not as cool to you as it is to me, but something that everyone can enjoy - Enchant (the effects library) is being rolled into jQuery proper. I think this is an immensely smart choice if only for marketing jQuery to new users. New users tend to compare feature by feature and make decisions, well now there's a big checkbox in that column. Nice work guys!
  • And finally, Block Quotes and Pull Quotes: Examples and Good Practices from Smashing Magazine.

Man, there was some good stuff on tap! Something from each of those will be making their way into my work in the very near future.

I’m channeling Vanilla Ice to build ExpressionEngine 2

May 22nd, 2008

As proof that my eyes are going bleary and that I'm working really hard on ExpressionEngine 2, I present this little gem. Sometime near the end of yesterday, I started to lose my mind. I had been coding for nearly 2 days straight, and had hit setback after setback (I have very little to show for those 2 days unfortunately). An interesting thing happens to me when I'm stressed and tired and frustrated... my mind wanders. It wanders far. In this case, back to 90s rap (keep reading, I swear I'm going somewhere with this). So I did the only logical thing, I decided to drag Derek Jones into the gutter with me and hit him up over IM. He was having a frustrating moment of his own. I was eager to offer a solution:

Me - I have a solution. extend the magic class...
Jones - ::slaps head:: I forgot about it, as per usual.
Me - here's some code

$this->magic->2_legit_2_quit('hey hey');

Jones - you didn't...

And it goes downhill from here...

Igniter-zen-i-rails, my new PHP framework

February 20th, 2008

There’s some discussion in a thread on CodeIgniter about microframeworks, and there’s always some discussion about the newest, latest and greatest PHP framework.  I know the market is a bit crowded, but here’s a little something I’ve been working on outside of my time at EllisLab.  I’m a bit hesitant to release it to the world, since it competes directly with both CodeIgniter and ExpressionEngine, but its so good that I can’t help myself.  I hope you’ll enjoy it as much as me.  Here’s some highlights

  • It works on all versions of PHP (yes, even those not released yet)
  • Its FAST.  Really fast.  The fastest against anything I’ve ever benchmarked it against and is WAY faster then CodeIgniter.
  • Tiny footprint.  The whole framework is only a few KB big.
  • Compatible with every database that PHP supports.
  • Pretty good documentation (not fully developed yet).
  • Very small learning curve.  If you know PHP, you’ll pick it up right away.
  • Catchy name… I mean seriously, who doesn’t think that “Igniter-zen-i-rails” doesn’t kick ass?  Crazy people, that’s who.
  • We’re corporate… but not too corporate.
  • Albatross!

Seriously, you should try it.

I’ve included my files so far.  Its pretty mature so don’t expect any more development on it.  You can get the files by reading the full post.

CodeIgniter will not be dropping support for PHP 4 anytime soon

January 18th, 2008

There’s been renewed discussion about CodeIgniter moving to a PHP 5 only framework within the community.  This post is my attempt to articulate the point of view of the development team, and my personal reasons for why we will not go this route. 

First of all, let me just say this “I like PHP 5”.  A lot.  I use it exclusively for my personal development, and I want to see it adopted more.  I don’t like PHP 4 much, and in fact, I’d love to not need to support it.  But the fact of the matter is that the vast majority of PHP servers out there are still running PHP 4, and we want our products to be accessible for the widest possible audience.  We will not be dropping support for PHP 4 anytime soon.

What follows in this entry is my full reasoning.  Want to see a PHP 5 CodeIgniter?  Read on…

Quick Link: PHP Advent Calendar

December 04th, 2007

A few days ago I mentioned that 24ways.org was back up for this year.  Well, it seems there’s another good read available!  Chris Shifflet is posting 24 PHP articles from guest authors on his website.  I just got through “Writing Code is Like Doing the Dishes (5 Reasons Why Documenting Your Code Makes You a Better Coder).” by Elizabeth Naramore and I have to say that I really enjoyed it.

So add one more stop to your daily RSS and follow along with the fun.

Judging the work quality of other developers

November 01st, 2007

You ever inherited a site done by someone else, and looked and the site and thought “what the hell where they smoking when they did that, and who gave it to the client making it seem like a good idea”?  C’mon you web-snobs, I know you have.  We’ve all done it.  Heck, I’ve done it recently.

There are two sides to every story

Well, I’m going to stop making any judgments about the quality of other people’s work unless I know the circumstances around how it got developed.  A day of reflecting on my own work has made me rethink things.  Yesterday I was working on a project, plugging away and I thought “hey, I’ve solved this problem before, let me go see what I did”.  So I pull out some old code, and next thing I know, I’m looking over some work I did some time ago.  I wasn’t super impressed. I found a series of nested if statements at one point, when really it could have been written in one line.  Is that the end of the world?  No, but it shows inelegance, and a lack of careful planning.  If this was someone elses work I would have thought “phfft, they’re lazy”.  Anyhow, I was disappointed, so I thought I’d fix it up and upload it for my (former) client....

And then it all came flooding back. 

  • “Now, who was that client again....? oh yeah… them
  • “I had that working perfectly and then they changed the specs”
  • “Golly, another new head of the committee… welcome to the team”
  • “I remember that line of code… they actually threatened that if I didn’t have that working by the end of the day I wouldn’t get paid.”
  • “But I’ve already changed that to behave the exact opposite way you want, after you asked me to, after you told me to change it back”
  • “Design by committee is horrible, but design by committee when 3 of the 4 people who were spearheading the committee have quit or ‘moved on’ is death”

So as you can see… in a lot of the cases the slightly less elegant code was a result of a changing landscape. I don’t think I could possibly build to quality, when the idea of “quality” is a moving target.  In that case, a nested if just worked for me.  When you’re bound by the triple constraints of cost, quality and speed, then something has to bend.  If the client isn’t willing to sacrifice cost or speed, then quality is going to suffer.

So I’m no longer going to look at

$some_dudes_name 'some name';
echo 
"The name of that guy was " $some_dudes_name;

and think “why did they even bother”?  Maybe the developer was dumb (that’s always a possibility), or maybe that variable used to hold other information, or maybe they were directed that way, or maybe the dev inherited other code that the client wasn’t willing to let them alter it.  Who knows?

Until I know the history and politics around why something was coded the way it was coded… I’m reserving judgment on anyone else’s work.

Oh yeah, and that inelegant client code I found?  I never did fix it up.

Sanitize your input

October 23rd, 2007

A few weeks old, but a great one.  Just found it again today and felt compelled to put it here.  From xkcd.com.
comic about data sanitizing

Quick Link: Building a Bulletproof Contact Form with PHP

October 16th, 2007

Matthew Pennel (of The Watchmaker Project) just wrote a short and very clear article on Digital-Web Magazine on handling contact forms with PHP entitled ”Building a Bulletproof Contact Form with PHP”.  If you are new to the topic, or are just looking to get that contact form set up and working, then for sure, give it a read.

Great work Matthew!

Few notable links recently

September 24th, 2007

OK, these are the laziest of possible posts, but there have been a few things I’ve found in the last few days that I wanted to bring up.

  • 7 reasons I switched back to PHP after 2 years on Rails.
  • Jim O’Halloran has been blogging about CodeIgniter a bit recently, including Building a Complete CodeIgniter Application (there are several parts to this, so go read it).  Nice work Jim!
  • EE Design has started a rebuild/refresh/whatever and the site is starting to come alive again.  I wish the same could be said of the awesome Jambor-EE, but they haven’t updated in 8 months… ;(
  • glider.js is out, and looks sexy as hell.
  • More impressive in my mind is ModalBox which I intend on utilizing shortly.  Looks great, and is built on Prototype/Scripto, which is my JS library(ies) of choice recently.
  • Mobile Web Design was released, and I was fortunate enough to have EllisLab provide me with a copy.  There’s some real gold in there, and while I’m not doing anything explicitly mobile at the moment, I know this book will end up being one of those “keep going back to” texts that we all have.

Case Sensitive in MySQL searches

September 13th, 2007

Interesting problem I encountered this morning.  I needed to make a case sensitive search through MySQL.  So consider this search.

SELECT FROM people WHERE field LIKE '%Derek%'

This will match

  • Derek;
  • derek; and
  • DEREK

but I only was interested in exact matches.  Ah right!  MySQL cases are case insensitive by default.  Hmm… how to get around this one?

So begin the search… which brought me to a MySQL docs page called Case Sensitivity in Searches.  Buried in that page is this little gem.

If you want to make this search case sensitive, make sure that one of the operands has a case sensitive or binary collation.

But then all their examples suggest changing the collation with the “COLLATE” argument. Then something from years gone by clicked in my head, and I remembered forcing the result to binary, which led me to write this query.

SELECT FROM people WHERE BINARY field LIKE '%Derek%'

Works a charm, so I wanted to document it (for my benefit), and share it on blog (for anyone reading this).

And now that I’ve got my result, this pretty much ends my investigation into this, so if anyone cares to shed more light, or share a “proper” way of doing this, please just comment below!

 1 2 >

Derek Allard

I'm Derek Allard, a programmer, author, and award-winning instructor. I'm also a Technology Architect at EllisLab, and the programmer behind BambooInvoice, a simple, Open Source, web-based invoicing application. [ more about Derek ]

Recent Archives

Categories