Posted 18 July 2006 - 02:00 PM
Posted 18 July 2006 - 02:11 PM
From this test case, we can see that using classes for simple tasks end up being very inefficient...
But just because it is slower, does not mean we should stop writing OOP code all together...
if you're doing simple calculation and/or processing, do not use classes, however, when you're writing a management system to obtain database information and do multiple calculations at the load of a page, you almost have to use OOP. remember that programming for web is quite different than programming for applications. if you get into it, you'll see that almost all high-end game engines are written linearly in C. why is this? well, because it runs faster. however, while the engine and renderers to many games are written linearly, when you start to delve into structure of RPGs and other more massive games, they are pulled together with OOP.
especially when it comes to writing code in PHP for webpages, i am under the understanding that the page will most likely be changing repeatedly over time. i need to write my page in such a way as to offer myself the quickest update time later. we're talking about milliseconds in processing time in most cases, and with web, many people's internet connection will take longer than the server processing time to load the page anyway. there are many things to consider, but when it comes down to it, i just write anything that is complex and repetative in nature in an OOP way.
Posted 18 July 2006 - 02:24 PM
Posted 18 July 2006 - 03:30 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users