PHP Classes

OOP Syntax

Recommend this page to a friend!

      PHP Classes blog  >  Extending PHP Classes...  >  All threads  >  OOP Syntax  >  (Un) Subscribe thread alerts  
Subject:OOP Syntax
Summary:OOP Syntax just is not Intuitive to me.
Date:2015-05-20 20:54:29
Update:2015-05-21 01:38:14

  1. OOP Syntax   Reply   Report abuse  
Picture of Jurgen_v_O Jurgen_v_O - 2015-05-20 21:44:24
I have never been able to get a grasp on OOP. While I believe that the OOP concept is great, and I do get the OOP concept intuitively. I just cannot get a grasp on the OOP syntax. The OOP-syntax is so not intuitive. Everybody understands a statement like "if ... then ... else" without much explanation. And is able to use it properly without much exercise. That's intuitive. Nobody understands "$this->thisClass = get_class($this)" without thorough explanation and exercise. I hate OOP Syntax. It needs a total rework.

  2. Re: OOP Syntax   Reply   Report abuse  
Picture of Dave Smith Dave Smith - 2015-05-21 01:38:14 - In reply to message 1 from Jurgen_v_O
I have seen some pretty confusing if... then... logic in my day.

if(($a != $b && $b < count($c)) || ($a == $b && $b > count($c)))

It is only intuitive if you speak the language.

$this->thisClass = get_class($this) is just an assignment to a variable, no different than $result = function($variable) that you will see regardless of programming style.

No matter what programming language or style you encounter, there will be a learning curve to understanding it. Back in the caveman days, we had FORTRAN (mathematical) and COBOL (intuitive). They where both procedural, however if you spoke one of the languages the other one was foreign and you had to hire an interpreter.