|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
PHP OOP vs Procedural
I read an interesting article about the disadvantages of OOP regarding debugging time (albeit it was regarding C++) - OOP was much more time-consuming for debugging than procedural (with programmers brought in not familiar with the code).
Of course, that article you mention is on server performance, but that is neglible compared to human time; I value my time more than the cost of a bigger server. If you want a designer's perspective, I prefer spaghetti code, possibly because the suits are sneering at it so much lately, but perhaps because it is more open to collaboration. I'm a designer, and I don't like Flash, go figure. Regards brickred.com cardssolutions.com crimsonlink.com |
|
#2
|
||||
|
||||
|
RE: PHP OOP vs Procedural
Quote:
Do you have a link to the article? That result does not reflect my experience. Quote:
Am I reading this wrong or are you suggesting that poorly written code is better because managers can't understand it and will need to keep you around to maintain it? How is poorly written code more open to collaboration? |
|
#3
|
|||
|
|||
|
RE: PHP OOP vs Procedural
Well, I can't say much, I work on a daily basis with 100% OOP code (yay for C#)
but it seems to be leaning twoard the preferred method of programming, I think its easier, I like it much more than procedural personally |
|
#4
|
|||
|
|||
|
RE: PHP OOP vs Procedural
i get the basic concepts of OOP, but once you start talking private and public and destructors and overloading, i get lost pretty quick. in other words i can read the code and modify the code but i don't understand the terminology enough to know exactly what is going on or to write it on my own.
i should probably pick up a non-PHP book that focuses strictly on OOP concepts. |
|
#5
|
|||
|
|||
|
RE: PHP OOP vs Procedural
you could learn java, that forces OOP concepts on you, and the new PHP5 OOP stuff is alot like Java (moreso than now, now it resembles structs in C++)
|
|
#6
|
||||
|
||||
|
RE: PHP OOP vs Procedural
I learned basic OOP in java and found it very easy to switch over to PHP5 (4 isn't that bad - but the references kill me). As for the PHP Object model being more like C++ structs - only used C structs and it isn't like those very much at all. ;)
|
|
#7
|
|||
|
|||
|
RE: PHP OOP vs Procedural
I have been fooling around with classes lately and truthfully...I can do the same thing in most cases with properly constructed functions rather than dealing with classes.
I do like the concept of OOP, however as was stated earlier in this thread, every manual or book that I have on OOP doesnt really give a definite and easy to learn example of how to construct these classes for not only easy to use implementations, but what the hell it is exactly many of these new class definitions such as public and private provide and when or how to use them. Its discouraging as I have been really moving in the functions arena and would like to structure better code through the class methods..but my classes are literally elementary level at best. |
|
#8
|
||||
|
||||
|
RE: PHP OOP vs Procedural
I wish I had a good source to give you guys for really learning OOP without all the extra rules and conventions imposed by specific languages. I learned most of my OOP basics through two classes in college - they're both online now through MIT's OpenCourseWare program, but without the right background (and even with the right background), they aren't the easiest things in the world to get through nor are they simply about OOP:
6.001 Structure and Interpretation of Computer Programs 6.170 Laboratory in Software Engineering I'll keep looking. |
|
#9
|
|||
|
|||
|
RE: PHP OOP vs Procedural
I started using OOP while learning Python. It took me a lot of reading to get the hang of it, but now that I'm used to the syntax, going back to procedural takes a bit of mental restructuring.
Certainly, the simpler tasks can just as easily be done with functions rather than full classes, but the amount of code reduction gained using inheritance and overloading makes a real difference in more complex tasks. |
|
#10
|
|||
|
|||
|
RE: PHP OOP vs Procedural
Here is the mother of all anti-OOP websites if you want complaints about OOP:
http://www.geocities.com/tablizer/oopbad.htm It suggests that if you "get relational" and set theory, you don't really need OOP. |
|
#11
|
||||
|
||||
|
RE: PHP OOP vs Procedural
Yeah, I'm the same. I learned OOP in C++ in my, back then local, community college. There's a simpler way of defining OOP in my opinion, but I don't know if it's a accurate definition. Once I started using the definition with myself it became easier. I always thought that OOP is the organization of code so that functions and variables don't get double declared or collide with functions of another part of the program. Certain functions, once in an object, can't and shouldn't be accessed by any other function in the program as it'll lead to disorganization of data and functions. Things like public and private are declarations of what can be accessed from outside that object and what should only be access by other functions within that object. I'll look out for some good oop intro books too. I'll post articles and book titles if I found any.
|
|
#12
|
|||
|
|||
|
how about in performance?
hi guys.. how about in performance/loading speed? what is the difference between OOP and non-OOP? lets say in PHP for example
|
|
#13
|
||||
|
||||
|
There's so much more that goes into performance than OOP vs. procedural, that your question doesn't make much sense. For example, algorithm design, skill of the programmer, understanding memory access, writing/reading to files or databases, and network latency, affect performance far more than structure of the code.
Trying to squeeze out tiny little performance improvements, especially out of a language like PHP, often means you end up sacrificing readability and maintainability of the code for very, very little increase in performance. If you've never heard of premature optimization, read that link. |
|
#14
|
|||
|
|||
|
will it make a difference?
ahhh.. i know some of the stuff that makes a difference in performance.. but i am ignorant on many of them..
![]() |
|
#15
|
||||
|
||||
|
Run-time performance, with all other thigns being equal, any difference between OOP and procedural will be negibable in most applications.
Asking the question regarding development-time is the basis of flame wars. You might as well be asking if developing in vi is faster than emacs. |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Programming Theory > PHP OOP vs Procedural |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|