fo shizzle

In an e-mail recently someone used the phrase “fo’ shizzle.”

Now having worked at Plaxo I’ve heard the term and seen it used when we play Counterstrike and such, and it’s used on television more, but I never saw it written out. For some reason print or e-mail is different than chat or IM. I have a distinct recollection of when “da bomb” (1994) or “so ghetto” (1998) reached that point, followed by a quick musing of where the hell the term came from—I mean besides the obvious answer in this case: Snoop Dog.

Urban Dictionary provided it to me:

“fo shizzle ma nizzle” is a bastardization of “fo’ sheezy mah neezy” which is a bastardization of “for sure mah nigga” which is a bastdardization of “I concur with you whole heartedly my African american brother”

I love the internet.

The Shu Ha Ri of strings

In a discussion on the speed differences between various types of strings, I was completely misunderstood (or ignored).

Sad.

George told me his all-time favorite PHP talk of mine was the first one I gave: “OOPs: The PHP Fear and Loathing Guide to Basic Object-Oriented Design.” Perhaps one reason may be is this segment (click the image below a bunch to playback the slide deck):

Shu-Ha-Ri is the way you learn in Aikido, but it applies to everything. For those who didn’t play back the above slidedeck or understand it, here is the ideas I want you go have in your head:

  1. Shu – Hold – Copy
  2. Ha – Break – Deconstruct
  3. Ri – Leave – Transcend

Shu: Use the single quote

Here is a summary of results a PHP developer who leads the unexamined life:

  • Single quotes are always faster than double quotes but the difference is negligible.
  • Function parameterization is faster than concatenation (use commas over periods when calling print or echo).
  • String concatenation is always faster string interpolation.

But this can be understood with a simple Ri maxim:

“In PHP, always code for readability first.”
—Me circa 2004

I’ll explain how to get from Shu to Ri in gory detail below and answer a couple of my favorite interview questions in the process.

[Gory details after the jump]Continue reading

Sensing a great disturbance in the force

…of my 2008 budget.

“Depth of field” huh?

Pentax 645D prototype (200609-06)Pentax 645D prototype rear (200609-08)

A Pentax medium format digital camera. 19 or 31 megapixel CCD sensor with 1.4x crop factor in 645 format (44mmx33mm). Basically that’s twice the image area of 35mm “full frame” or .7x “crop factor” 35mm equivalent. Just saying this just shows the total futility of thinking in crop factors. Both use an offset microlens technology that first saw light of day in the Leica M8 to deal with vignetting.

Price (estimated): $7-12k. It’s Pentax so you know it’ll be much cheaper than that the Hasselblad H3D (48mm 39mp $32k, 48mm 22mp $27k and 44mm 31mp $25k), and the Mamiya ZD (48mm 22mp, $12k est.). On the other end you have the Canon EOS-1Ds Mark II (36mm, 17mp, $7.4k). Another reference point is film 645 format cameras are around $3k.

Also known are multi-channel readout, SDHC and CF media support (I hope they’re using UDMA instead of PIO). 1/4000s max shutter speed in a leaf shutter. Probably a max ISO around 800. The usual suspects: AE and AF lock buttons, bulb, MLO, cable releases, flash sync. Burst speed and buffer is unknown (a fast camera in medium format digital is is 1 shot in 1.5 seconds).

While we are dreaming wishlist: Pentax sensor-shift-based shake reduction in a medium format digital. I’d open my wallet this year if it had it. Seriously.

[Lenses for medium format cameras after the jump]Continue reading

Vote for Andrei

This is a shameless plug for my friend Andrei.

Vote for Andrei

Andrei is writing something that forms the very essence of my future employment: PHP 6, and more specifically, unicode support in PHP 6. ICU in PHP is three meaningless letters about three other meaningless letters to most of you. I get that. Even though this meaninglessness stuff has 60% market share and powers sites like Yahoo!, Wikipedia, WordPress, Facebook… (The “Vote for Andrei” generator above was written in PHP. It powers the websites for JPG Magazine and Flickr below.)

So when I say that it’s really important to keep this guy happy, please believe me. Think about the last time that you visited to the above websites. You wouldn’t want them to suck do you? If your native language is not English, then you would want them to work in your country right?

Luckily, photography is infinitely more accessible than the stuff that pays the bills. So please, take some time off from your day of ignoring my blog posts to do the world a favor and vote for this photo on JPG magazine (and tell your friends to too):

It’s a great photo and utterly appropriate with the theme of the month. My only complaint with it is he should have gotten with the bandwagon on photos like this and LOMO’d the sucker beyond recognition. I can almost recognize what it is.

[Andrei and photography after the jump.]Continue reading

My programming pattern maxim

There are few people this side of Harry Fuecks who have rode the php design patterns money train as much as I have. In fact, programming patterns have been very good to me: they’ve provided trips to exotic locales, paid for my conference admission, impressed all the hot women…

Well maybe not that last one.

But Alejandro’s recent spate of GoF patterns on DevShed, besides being a blast from the past, made me realize that practicality hangs over my Pattern Bubble like the Sword of Damocles, pointedly showing just how oppressive programming design patterns in PHP are.

Time for a new rule:

“With few exceptions, by the time you deduced what a pattern is from its clever name, you could have just coded it.”
—Terry Chay, 2007

and my original inspiration:

“PHP isn’t Java. Deal.”
—Terry Chay, 2003

[The Flyweight makes an appearance after the jump]Continue reading

Interesting PHP factoids

It’s times like these that I wish someone just told the reporter that PHP is a programming language for web development that has a larger marketshare than Java J2EE and Microsoft dotNet combined:

[Web 2.0 technologies] also mean applications can be built much more quickly, says Mr Boloker. He is a big fan of PHP, an open-source scripting language which makes building mashups even easier. Originating in Greenland, PHP is now managed by an Israeli company called Zend.
Sydney Morning Herald

I didn’t realize that Rasmus wasn’t in Canada when he wrote PHP and that Cupertino is now in Israel.

Good to know.

Oh yeah, it’s nice that they’re allowed to use Apple Macintoshes in IBM, I didn’t know they’re so generous. Will they be taking his away with the Intel switch?

Other than that hilarity, thank you Dave Boloker for plugging PHP. Now I can go around saying that the former chief of Java Technologies at IBM Software Group is a “big fan of PHP.”

Rock on.