Professional PHP Blog

PHP Programming, Web Development, PHP Advocacy and PHP Best Practices.

Sarah Snow Stever

November 23rd, 2007

Sarah

I am very sad. Two weeks ago, my cousin Sarah had a stroke and died. She was 35, two years younger than me.

As kids, Sarah and I, (along with her sister Rachel) would spend weeks in the summer staying at my grandparents house, playing and doing the things that ten year olds do on a farm. We sat around the campfire at family reunions. We played cards and games, talked and argued. I always looked forward to seeing all my cousins at holidays and family gatherings, but Sarah and Rachel were special then because they were closer to my age.

As adults, Sarah and I also did stuff together on occasion. We still sat around the campfire at the family reunions and visited during the holidays. But, we also went to bars and restaurants, Sarah always knew the best bars. We went to Cedar Point and shared an automobile accident. She would cut my hair and I would fix her computer. But mostly, we just talked. Sarah was just plain easy to talk to and always interesting.

In recent years Sarah moved to Atlanta to build a life for herself there. She opened a salon there and infused it with her character and personality. It was a place where she was at home and happy. I’m sure her clients felt happy and at home there as well. (A client remarks on Sarah’s passing)

But, the most important thing about her move to Atlanta was meeting her husband, Kevin there. I’ve only met Kevin a few times, but the one thing that I know about him is that he made Sarah happy.

I haven’t seen Sarah as much in the last few years. Atlanta is far from Michigan and she disliked flying. She came to fewer and fewer holiday functions. Despite her many invitations to visit Atlanta, I didn’t go.

That is until September, when I went to the php|works conference in Atlanta. One of the reasons I wanted to go to the conference was to be able to see Sarah. After the conference, I stayed with her for a couple days.

Sarah showed me her Salon and I could see how much she loved it. She introduced me to the dogs that she saved. We went out to eat and visited the local Atlanta attractions. But mostly, we talked. We talked about family, dating, kids and careers. We talked about her writing, the gym she liked, the church she had joined and the things she wanted to do.

Sarah tried very hard to convince me to move to Atlanta. I think she felt that all I needed to do was to move there and I would meet the love of my life and l could live there happily to the end of my days. After all, she did.

There is so much that I still want to do with Sarah. I feel like I’ve always taken it for granted that that she would be around for us to “do that later.” I guess not. I’ll miss Sarah.

Sarah’s obituary.

23 Comments »

Benchmarking PHP’s Magic Methods

November 4th, 2007

Larry Garfield has an interesting set of benchmarks covering many of PHP’s magic methods. His results correspond pretty well to my own benchmarks in the area. The thing to take away is that its not necessarily the overhead of the magic methods, but rather what you do inside them. Its hard to do anything useful inside a magic method, such as __get or __call that isn’t 10 to 20 times slower than the “non-magic” solution.

There are probably more than a few naive programmers who would read results like this and start to avoid these constructs in their own code for performance reasons. These are the same kinds of people obsessing over a few single or double quotes, who eschew “slow” objects in favor of switch statements that are many times slower than the polymorphic method calls they are trying to avoid.

But, that’s not the end of the story. Larry ran his benchmarks using 2,000,000 iterations. The N really matters here. Sure, iterators are slower than arrays, but you aren’t going to be iterating over two million things. I tend to fetch my database records in lots of 25 or 50. You aren’t going to be making two million invocations of __call. But how many will you make? Under what value of N does the performance of these techniques cease to matter? Is it ten, one hundred, one thousand, or ten thousand? You may be surprised at how few calls your program actually does and how little impact it has on performance.

As Wez and Travis point out in their comments, profiling is the way to find out the potential impact and to discover your true N.

Paul M. Jones has a good example of what I’m talking about. There, call_user_func_array appears to be a bottleneck, but it turns out that its the function being called, htmlspecialchars, not the calling process that consumes the balance of the time. In that case, the function was “only” called 300 times. I find that order of magnitude to be fairly typical. Something to be aware of, perhaps, but not something to obsess over.

8 Comments »

The Endpoints of the Scale of Stupidity on Video

November 2nd, 2007

A quote from Cal Henderson (via simonwillison) presents a “Web Application Scale of Stupidity:”

| OGF (One Giant Function) ---- Sanity ---- OOP (Object Oriented Programming) |

The scale that Cal is talking about is actually better known as modularity:


| Few large modules ---- Sanity? ---- Many Small Modules |

If you haven’t listened to Alan Kay talk about the benefits of many small modules, you should do so now. Alan Kay coined the term Object Oriented. Love OO or hate OO, if you have an opinion on it, you should know what he was thinking. Hint, it wasn’t C++.

On the other end of the scale, One Giant Function is generally known as Big ball of Mud(PDF) Here is Brian Foote’s presentation on the paper (read the paper first).

No Comments »

Working with PHP 5 in Mac OS X 10.5 (Leopard)

October 28th, 2007

Mac OS X is a great development platform for working with PHP. Leopard comes with Apache, PHP and many other development tools, such as subversion already installed. Leopard brings a much needed upgrade from Tiger’s tired PHP 4 to a very modern version of PHP 5.2.4. This is a guide for setting […]

121 Comments | Read the full post »

Keywords and Language Simplicity

October 11th, 2007

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 […]

8 Comments | Read the full post »

Improved Error Messages in PHP 5

October 7th, 2007

Sometimes 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 […]

11 Comments | Read the full post »

Michigan Taxes Graphic Design Services

October 1st, 2007

The 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) […]

No Comments | Read the full post »

Ruby versus PHP or There and Back Again

September 23rd, 2007

Well, 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. […]

12 Comments | Read the full post »

Mighty Mouse Kryptonite and Exceeding Expectations

September 18th, 2007

I’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 […]

3 Comments | Read the full post »

reCAPTCHA - Combining Distributed Problem Solving with a Web Service

May 30th, 2007

I 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 […]

4 Comments | Read the full post »

« Previous Entries
  • Search

  • Subscribe

    Subscribe All Posts
    Subscribe All Comments
    Subscribe All Bookmarks
    Subscribe with Bloglines Subscribe with My Yahoo Add to netvibes Subscribe in NewsGator Online Subscribe with Google feed reader
  • Share This

  • Categories

    • Agile Methods (14)
    • Mac (14)
    • Misc (16)
    • Open Source (14)
    • PHP (93)
    • Software Design (27)
    • Usability (14)
    • WACT (7)
    • Web Design (20)
  • Recent Comments

    • How to Transfer Mac OS X Application Data between Computers  34
      Khaled bin Alwaleed, Oscar, TeeJay [...]
    • Sarah Snow Stever  23
      Snowcore, ennah, Philippine Website Developers [...]
    • PHP Development From Java Architects Eye  9
      Bobrila, FelhoBacsi, Angsuman Chakraborty [...]
    • Working with PHP 5 in Mac OS X 10.5 (Leopard)  82
      Luis Oscar Cruz, xentek, website design [...]
    • Improved Error Messages in PHP 5  9
      ennah, Khumaer, retry [...]
    • The value of MVC  7
      Vulchak, อะไหล่แอร์, Derek Scruggs [...]
    • Why PHP is easier to learn than Java  13
      , , WTF [...]
    • goto in PHP  38
      Goldilocks, , SFM [...]
    • Keywords and Language Simplicity  6
      Handy, minikperi, PHP Encoder [...]
    • OOP is Mature, not Dead  13
      deltawing, asd, Coen [...]
    • WordPress BBCode Plugin  21
      wow, Márcio Pereira, lucas03 [...]
  • Pages

    • Tags
  • Recent Bookmarks

    • More bookmarks...
  • My Other Stuff

    • Lively Debate
      My blog on Politics and non-technical topics
    • Web Application Component Toolkit
      PHP MVC Framework
  • Other PHP Blogs

    • Dynamically Typed
    • Jason E. Sweat
    • John Lim
    • Marco Tabini
    • Marcus Baker
    • Norbert Mocsnik
    • PHP Patterns
  • Archives

    • 2007: Jan Feb Mar Apr May Sep Oct Nov
    • 2006: Jan Feb Mar Apr May Jun Jul Oct Nov Dec
    • 2005: Jan Feb Mar Apr May Sep Oct Nov Dec
    • 2004: Apr May Jun Jul Aug Sep Oct Nov
  • Menu

    • Register
    • Login