One of the most valuable lessons Ive learned in my development career is the art of stubing. (which works great with TDD by the way)
So what is stubing? Stubing is the act of “imagining” how your application will work by writing how you would use it first.
Before building this class I would write out what the class does and how I would use it.
$nithin = new Human(“Nithin Meppurathu”);
Now as you can see, i know exactly how I would use of the Human class. I want to create a new human with the humans name. Then I want to use the class to tell the application the name of the user.
Next step would be to write a quick interface for the class. And eventually create the class itself.