Making Your App Infintely More Testable

You’re writing a PHP application. You know you need to write tests. Tests aren’t something that comes naturally to you yet; you’re still working on learning the ins and outs of PHPUnit (the default standard framework). But you know that right now, your app isn’t testable. What can you do to make it testable?

The single most important thing you can do to make your app testable

(more…)

Thursday, April 4th, 2013 @ 8:00 am | Comment (3) | Categories: Object-Oriented Development, PHP, Testing, Best Practices

Abstraction In The Real World

Abstraction is one of the subjects in software development that’s really difficult to fully grasp without practice. It’s easy to read about it, talk about it, and profess doing it. To actually do it is another thing entirely: it requires practice, and patience, and experimentation.

I decided the best way to show abstraction in action is by showing the commits I made as I worked to abstract a model that contained the validation and database logic inside the same class. You can see my progress, as well as my notes about what I’m doing as I go along below.

(more…)

Monday, March 25th, 2013 @ 8:30 am | Comment (4) | Categories: Best Practices, Object-Oriented Development, PHP

Writing Intentionally Bad Code

I’ve done my fair share of speaking; I won’t say I’ve done a lot of speaking (not at least compared to people like Laura Thomson, Chris Hartjes or Rafael Dohms), but I’ve done a bit. Every time you speak people expect to see code in your slides. And they expect to see both a wrong way and a right way to do a particular thing.

That’s all fine and good; slides aren’t big enough to write an entire application. But in preparing for my class, The Object Oriented PHP Masterclass, my task has been to write a complete application that my students can refactor using the principles they have learned. And writing code wrongly, on purpose, is hard.

(more…)

Wednesday, March 6th, 2013 @ 7:03 am | Comment (1) | Categories: Object-Oriented Development, Learning, PHP

Interfaces or Abstract Classes?

Developers in PHP have a wide array of useful tools for object oriented development. From a full visibility model to concepts like abstract classes and interfaces, the PHP developer can make use of each tool in its own way and offer up an array of interesting solutions.

The problem is that often this leads to confusion among developers as to which tool to use. This isn’t uncommon in PHP; in fact, it’s very common that developers use the wrong tool or the right tool in the wrong way.

(more…)

Thursday, February 21st, 2013 @ 7:00 am | Comment (10) | Categories: Best Practices, Object-Oriented Development, PHP

Knowing When To Break The Rules

Software development isn’t a sure thing a lot of the times. Sure, there are rules, but when do you know how to break them and when to enforce them? It’s hard to know exactly when you should stick rigidly to your principles, and when to fudge on the accepted best practices to solve a problem. You know that this careful balancing act takes work, but what rules can you apply to help yourself be better at distinguishing these times?

The problem with following the rules

(more…)

Thursday, February 14th, 2013 @ 7:00 am | Comment (1) | Categories: Object-Oriented Development, Best Practices

Becoming An Object Oriented Master

Too many developers struggle with their object oriented programming skills. Concepts like abstraction, single responsibility principle, unit testing, refactoring, architecture and SOLID seem out of reach. You wonder how you can grasp the concepts. You buy books. You attend conferences. You go out of your way to try and learn. Nothing works. You feel stuck.

When I sat down to write Mastering Object Oriented PHP, I recognized that people needed an easy to understand resource. They needed to be able to read the book, understand the material and be able to use it. But books have an inherent flaw, and one that I think needs to be addressed.

(more…)

Tuesday, February 5th, 2013 @ 7:00 am | Comments (0) | Categories: Object-Oriented Development, Software Development, Learning

« Older Entries Newer Entries »

Copyright © 2023 by Brandon Savage. All rights reserved.