PHP And Object Oriented Programming

I’m not an anti framework or Object Oriented haters the fact the I’m graduated as B.S Computer Science Major in Object Oriented Programming I love it, but I’m just disagree in some concept that Object Oriented is trying to pretend on PHP or other programming language.

http://en.wikipedia.org/wiki/Object-oriented_programming

  • Paul Graham has suggested that the purpose of OOP is to act as a “herding mechanism” that keeps mediocre programmers in mediocre organizations from “doing too much damage”. This is at the expense of slowing down productive programmers who know how to use more powerful and more compact techniques.[36]
  • Joe Armstrong, the principal inventor of Erlang, is quoted as saying “The problem with object-oriented languages is they’ve got all this implicit environment that they carry around with them. You wanted a banana but what you got was a gorilla holding the banana and the entire jungle.”[37]

Here’s how http request process over the internet.

HTTP is a stateless protocol. A stateless protocol does not require the server to retain information or status about each user for the duration of multiple requests. – wiki

While PHP is a general-purpose server-side scripting language originally designed for Web development to produce dynamic Web pages. - wiki

When the user requested a page in a web server PHP scripts create the content for the user, but the web server and PHP didn’t maintain any objects once the request is completed. If the user request for the same content PHP will execute again to re-create the content, so there is no really an object and creating a bunch of object in PHP is useless because it’s going to be re-created and destroy on every request.

In the same concept I agree that the Object Oriented is just a group of mechanism that runs in procedural.

Okay no offend to java I’m also do java programming and java is doing great in Object Oriented but…

If Java had true garbage collection, most programs would delete themselves upon execution. — Robert Sewell

Advertisement

No comments yet.

Leave a Comment