DoubleDee;10967895 wrote:And I appreciate that, but I was getting tired of reading books that don't relate to the real world. (I'll be 65 before I build anything at that rate?!) :eek:
My experience -- and that of many from what I've seen -- is that learning OOP often begins rather confusingly and maybe frustratingly, and then you have a few "eureka" moments where it starts to come into focus and make sense, and then you come to really appreciate it and like it. My moment came while reading Matt Zandstra's PHP 5 Objects, Patterns, and Practice, but that was on top of other reading of articles and blogs, so no guarantee it would be your personal "sliver bullet".
Why didn't my original echo statement work?
It would work, but it would only say something like "array()", not telling you what is inside of it.
I figured if I could learn how to take data from an HTML form and put it into an object, then I would have something to play with. For example, I could pass that object into a Validation Class or an Email Class or maybe a Database Class or whatever, right?
When you do proper OOP, aren't you supposed to do everything INSIDE of objects and BY PASSING OBJECTS?? (As opposed to working on naked data like the $_POST array or by passing naked data between objects??)
I am open to suggestions and coaching.
I just figured working with the $_POST array itself and passing arguments between web pages and functions was about an UN-OOP as you can get...) :queasy:
Depending on your point of view, a strength or weakness of PHP is that it is not an OOP-only language, so you can mix procedural code and OOP code (and spaghetti code) as desired to suit your skill, style, and functional requirements. In fact, you will always need at least a few lines of non-OOP code, if for nothing other than to launch your main object that would drive everything else.
Doing something like what you have started is probably a good idea, in that it is something you can re-use in multiple applications. Of course, a year from now, whatever you come up with now you'll probably think is junk and completely rewrite it anyway. 😉 The main thing I think that OOP requires from you perhaps more than less structured techniques is more forethought about your high-level and then mid-level design. Then you start getting into object-oriented analysis/design (OOAD), which can ultimately be more important than your coding syntax knowledge/skills.
Well, that's enough typing for tonight. Good luck!