If it adds to the complexity (and/or size) of code, why do it?
Why do I [usually] declare NULL?
- Clarifying code; by declaring everything before I use it, I know what variables to look for later when I’m debugging (OOP PHP does this out of necessity with class-level variables)
- When using an IDE, the software auto-references those variables later; if I don’t have a matching variable, it won’t reflect in the IDE and I can catch typos before they become time-sucking issues
- Finally, PHP flags a notice-level error when a variable is referenced that has not been pre-declared; not everyone knows to turn off notice-level errors, and it’s a waste of log space (and effort to dig through logs full of notices)
I highly recommend working with other programmers; I believe it makes us better coders, we learn new ways of doing things and thinking about things. For continuity, you need to agree on programming conventions. I’m not overjoyed about giving up NULL declarations, but all things change—Facebook just released their fork of PHP, Hack.
In my search for a simple click-tracking solution, I decided just to write one and make it publicly available.
When I say “basic,” I mean “write to flat files” basic. I also mean that simply reading the SETUP file should tell you everything you need to know about how to use it…even if you’ve never touched a line of code in your life.
I put up a new repository at GitHub yesterday that converts the entire Lime Light CRM API into a simple PHP class. The superclass (creatively called LimeLight) has two child classes, Membership and Transaction (with respect to the pertinent Lime Light APIs). This is a work-in-progress and is still in beta…it’s mostly bug-free. As there is no official PHP implementation (only recommendations and companies that will integrate for you), I figured it was high-time for an open source version. I’ve written this code probably a dozen times and frankly I’m tired of rewriting it.
Also, I lack the time to integrate Lime Light outside my existing client scope, and this is as good a way as any to put it in everyone’s hands.
It’s pretty rough and I’m working on building in controls to provide better options and more accurately reflect the API. In the meantime, take a look at the source code here, and feel free to fork it/improve it/etc. I’ve learned and benefited a great deal from open source solutions and am looking forward to giving back.
If you haven’t decided on a CRM solution yet…and you go with Lime Light CRM…tell them I sent you.
NOTE: Neither True Marketing Partners nor Lime Light CRM paid me to write this post or recommend their product. IF you buy Lime Light CRM and if you mention me on the contract, they’ll kick me back. If you buy it and don’t mention me or don’t put me down as your reference on the contract, I won’t get one cent. If you’re already using Lime Light and want to expand from the web forms to the API, this is a good place to start. I have to have a live version within a week anyway… 😉