Posted: Wed Sep 14, 2005 2:24 pm
In my opinion, one should start OOP as soon as possible. The fact is, that most sophisticated projects are always coded using OOP paradigm. So, if you think you will ever want to participate in development of one of those, why waste your time coding procedurally only? Use OOP from the start, it works in all kinds of projects while strict prcedural does not. And I've noticed that very often in more serious job offers they include OOP knowledge as a must.
Sorry to go offtopic, but I've just noticed a quote in McGruff's post I'd like to ask him about. I hope you don't mind.
Sorry to go offtopic, but I've just noticed a quote in McGruff's post I'd like to ask him about. I hope you don't mind.
Now, why would you want to validate email by using a separate object just for that? What methods/properties would you code in the class? I'm really not sure, because with email validation (or any other field) it's a pretty simple process: is the field empty - for that you have PHP's native function, no need to use your own, is the value an email - for that you would probably use a simple regex method. I can see only one method here (validation). Is it worth to create a new class just to contain one method and probably only one property (the value to validate)?Email validation for example would certainly be carried out by an object - or rather a whole group of objects designed to carry out input validation.