Well, I like programming language comparisons, so how could I resist this chart (via) promoting the simplicity of the io language by pointing out how few keywords it has. The interesting thing about this is that Java and PHP are tied on this measure of simplicity with 53 keywords. Perhaps that reflects Java’s heritage as a simplification of C++ (63 keywords) and PHP’s heritage as an amplification of C (37 keywords) toward a specific purpose? As usual, Perl is the poster child for language complexity. Ruby does well with 40 keywords. But, before the Ruby fans get too uppity about the simplicity of their language, they should contemplate the cat walked across the keyboard while I was holding down the shift key predefined variables that they inherited from Perl.
Keywords and Language Simplicity
October 11th, 2007Improved Error Messages in PHP 5
October 7th, 2007Sometimes its the little things that make a difference. If you run the this test program in PHP 4 (tested on 4.4.7):
< ?php function test($arg) { echo "talk like a pirate."; } test(); ?>
You get the following message:
Warning: Missing argument 1 for test() in /usr/bin/- on line 2
The error message here is reported at the position of the definition of the function, but really the error was in how the function was called. The required parameter to test was not passed. This error can be annoying, forcing you to consult a stack trace to find the actual error location. Something some beginners may not know how to do.
However, if you run the same message in PHP 5 (tested on 5.2.2):
Warning: Missing argument 1 for test(), called in /Users/jeff/- on line 3 and defined in /Users/jeff/- on line 2
Sweet improvement!
One more reason to ditch PHP 4 and go php 5.
Michigan Taxes Graphic Design Services
October 1st, 2007The state of Michigan, in a bid to become the most confusing state to operate a business in, has passed a sales tax on a bizarrely random selection of services. These services include such illustrious professions as astrology services, social escort services, and graphic design services.
The enumerated list of taxable services (sec 3d) (PDF) lists “Specialized design services, as described in NAICS industry group code 5414.” The 5414 designation includes “planning, designing, and managing the production of visual communication in order to convey specific messages or concepts, clarify complex information, or project visual identities. These services can include the design of printed materials, packaging, advertising, signage systems, and corporate identification (logos).”
Custom programming, web design and hosting services are not taxed (they have NCAIS codes outside of the enumerated ranges). However, a service such as logo design would be taxable.
To do the right thing, as I understand it, and I am SO NOT A LAWYER…
A Michigan business offering a mix of services must collect the tax on the graphic design component of their services.
A graphic designer in Michigan must have a sales tax license and collect the tax as appropriate.
A Michigan based consumer of out of state graphic design services must report their graphic design purchases and pay the tax.
Meanwhile, Michigan has the worst unemployment rate in the nation and is the worst state for creating new businesses.
I’m glad 541511: Custom Programming Services was spared from the tax.
Ruby versus PHP or There and Back Again
September 23rd, 2007Well, I imagine that this opinion piece by Derick Silvers will cause some conversations: 7 reasons I switched back to PHP after 2 years on Rails. The gist being that a big bang rewrite of an existing code base is always a risk and that Rails is optimized more for the greenfield case. [...]
Mighty Mouse Kryptonite and Exceeding Expectations
September 18th, 2007I’m a fan of Apple’s Bluetooth mighty mouse. I cart my laptop all over and I like the ability to have a full sized mouse with a scroll wheel and right click without the hassle of cable management on some narrow coffee shop table.
Imagine my horror when just such a table caused the chain [...]
reCAPTCHA – Combining Distributed Problem Solving with a Web Service
May 30th, 2007I ran into an interesting project this morning called reCAPTCHA. In the spirit of distributed computing solutions, such as folding@home, it tackles a difficult problem by splitting it up and farming the pieces out. What makes this interesting is that instead of having computers solve the problem, people do.
ReCAPTCHA actually tries to solve [...]
php|tek Slides
May 19th, 2007Well, php|tek is over. It was a great conference and I’m really glad I went. This was my first PHP conference.
One of my main goals was to meet some of the folks at php|architect. I’ve been writing the Test Pattern column for them for over a year now. I was finally [...]
Let Your Properties be Properties
May 8th, 2007There is a coding pattern that I see (and have used) in PHP code that defines generic methods on a class for setting and getting properties.
function set($name, $value);
function get($name);
Google code search for examples
Some times there are some ancillary methods to deal with unsetting, checking for existence, setting via an array, or dealing with references in [...]
Where do you get your Wi-Fi?
May 6th, 2007Sometimes you just have to get out of the house or out of the office. And some of those times, you have to use the internet as well.
I’ve collected a (short) list of places around town that have Wi-Fi. I usually use the Wi-Fi at a small local coffee shop. They are [...]
On the Perils of Inline API Documentation
April 13th, 2007Travis Swicegood has a post questioning the value of the docblock. I have a deep sympathy with this sentiment.
Even on projects with extensive generated documentation, I find that kind of documentation to be of extremely low value. The problem with inline API documentation is that there is no sense of priority. Developers [...]