Professional PHP Blog

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

ZendCon: Writing Maintainable PHP Code

October 19th, 2009

I’ve finally made it to my first Zendcon. Its nice to see some familiar faces and also nice to put new faces to familiar names.

I gave my maintainable PHP talk this morning. I love doing this talk. Thanks to everyone who attended. I’ve put the slides (pdf) up on my talks page.

Much of the material is based on Test Pattern columns that I’ve written for php|architect. Here are some of the specific columns.

Organizing For Change
This is where I developed the outline for the talk
Dependency Injection
This is a more in depth discussion of code reuse and dependency injection
Modeling Dependencies
This is where I talk about coupling, layered design and abstraction
A Closer Look at Cohesion
This is where I developed my explanations of cohesion and the single responsibility principle
Searching the Code
Good designs are searchable

One thing I like about both writing on and presenting on the same material is that I get feedback from the presentations that I can put back into the writing and vise versa. I’m looking forward to finding some better ways to explain layering and the depend on abstractions principle. If you saw the talk, was there anything you particularly liked or needed work? Leave a comment here or on the joined.in page.

Here are some of the books I mentioned in the talk.

PHP in Action: Objects, Design, Agility
This is a really good next step if you’re interested in maintainable code, testing, and object oriented design.
Refactoring: Improving the Design of Existing Code
This is the classic treatment of Refactoring. Probably everyone considering themselves a professional programmer should read this. The examples are in Java, though.
Working Effectively with Legacy Code
This is a good book if you want to start testing and refactoring in a large system that doesn’t currently have tests. Again, the examples are in Java.

I sat in on the PHP Code Review talk this afternoon. I thought it was a great complement to my talk. I tend to be a bit theoretical and this talk was very practical, but we covered a lot of the same principles. Nice talk. Nice scheduling, Zend.

I’m really looking forward to tomorrow. Unfortunately, I have to go back to work on Wednesday.

21 Comments »

Looking Towards the Cloud

May 2nd, 2009

Some people love their automobiles. They can tell you all all about their technical specifications. They buy upgrades and after market parts. Its a lifestyle and a hobby. I am not one of those people. For me an automobile is purely a means to an end. I am here, I want to be there. Having lived the last year without a car (my truck is in storage and will be for sale soon), I can say I don’t much care whether I get there in my car, or a taxi, or a zip car. This is the benefit of modern urban living, I suppose.

So, just as I look at an automobile as a means to an end, I look at servers as a means to an end. I guess that makes me a Software Guy. I know there are Hardware Guys out there. They’re doing great things and I’m thankful for them. But, for the most part, I am interested in what computers can do for us, not how they do it.

I don’t think I’m alone in my attitude. That’s why I think that computing as a commodity a strong future. We can leave things like data center efficiency to someone else and focus on the things that are really important to us. Oh, if you’re at facebook scale, you’re probably going to have to do serious cross stack optimization. And if you are at the hobby end, current cloud offerings may be pricy.

But, consider this. What can you buy with $100,000 per year? One programmer or 120 ec2 instances. (more with reserved instance pricing.)

Cloud Computing Versus Programming Talent

At a certain scale, cloud computing makes alot of sense. $100,000 is just a number. Oh, I know, you have this guy in Belarus and he works for less. But, the fundamental equation is the same. Programming is expensive and computing power is a commodity. Did I mention I’m a software guy?

Are you interested in how to use PHP in the cloud? Clay Loveless recognized the advantages of cloud computing early, jumping on ec2 as one of the early adaptors. He’s recently written a great Introduction to AWS for PHP Programmers. I’d encourage you to check it out.

36 Comments »

Holiday Tech Support

April 11th, 2009

I don’t see my family as often since I’ve moved to San Francisco. This weekend I’m home for the Easter holiday. Its nice to see everyone. Additionally, I have a backlog of tech support for my parents and grandparents. I’ve installed software purchased months ago, done updates that they weren’t even are of, installed a router and fixed rats nests of cables. I’ve restored TV setups to working order and am about to fix a vacuum cleaner. Are you the tech support guy for your family? What are you fixing this weekend?

4 Comments »

Closures are coming to PHP

March 22nd, 2009

Dagfinn has a post looking at using the new closure feature of PHP 5.3. He compares using foreach for iteration versus array_map. “Interesting,” he concludes, “but not necessarily better than conventional alternatives.”
I agree for that case. Consider instead, a more complicated operation that requires a setup and a tear down after.
 
setup();
operation();
teardown();
 
Now what happens [...]

19 Comments | Read the full post »

php | tek Wrapup

May 26th, 2008

I really enjoyed myself at this year’s php | tek. The conference seemed even better than last year. Here are the slides from my talks…

Exceptional PHP
Coding for Success: Writing Software You’ll Be Able To Understand Next Month

Here are some of the books I mentioned…

Refactoring: Improving the Design of Existing Code
php|architect’s Guide to PHP [...]

11 Comments | Read the full post »

php | tek 2008

May 20th, 2008

Well, I’ve made it to PHP|tek in Chicago. I flew in last night, had a beer with Jason and then used the WiFi in the lobby to spin up an extra large EC2 instance (via RightScale) to do some benchmarks for one of my talks. I’m using the the XL instance because it [...]

17 Comments | Read the full post »

Sarah Snow Stever

November 23rd, 2007

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

34 Comments | Read the full post »

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

19 Comments | Read the full post »

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

3 Comments | Read the full post »

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

230 Comments | Read the full post »

« Previous Entries
    Subscribe Feed
    Share Subscribe to this blog…
    Share Bookmark or share this page…
  • About

    My name is Jeff Moore. I'm a PHP programmer living in San Francico and working for a startup.

    More about me…

  • Categories

    • Agile Methods (14)
    • Mac (14)
    • Misc (17)
    • Open Source (14)
    • PHP (98)
    • Software Design (29)
    • Usability (14)
    • Web Design (20)
  • Recent Comments

    • Closures are coming to PHP  14
      WebProject | Web Design | Web Development|, jessica, kevin [...]
    • Programming Language Trends via Google  19
      Craigslist pva, jessica, Scott [...]
    • Looking Towards the Cloud  35
      bentonville multiple listing, cosmetic dental, Sam Brodish [...]
    • PHP versus ASP  8
      Marhta Blight, Ravi, Ryan Brooks [...]
    • How to Transfer Mac OS X Application Data between Computers  59
      Website Migration, harry the computer support guy, Dotty Salvage [...]
    • Working with PHP 5 in Mac OS X 10.5 (Leopard)  157
      lehuuphuc, Robert Parthemer, Lingerie Intimate [...]
    • PHP Games  25
      jessica, Tennille Cranor at Chilli Plants, Lucas Ortell [...]
    • un-PEAR-ing  5
      jessica, Eugene Panin, Arnaud [...]
    • The Legality of Republishing RSS Feeds  23
      kevinxiao, Marissa Miscovich, Quick Student Loans [...]
    • Faster Page Loading  4
      jessica, angular cheilitis, Aaron Rosenfeld [...]
  • 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
  • Site

    • Archives
    • Log in
  • Search