对于OOP或不对OOP [英] To OOP or not to OOP

查看:114
本文介绍了对于OOP或不对OOP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这部分是一个意见问题。我使用vanilla PHP为我的

主站点进行了一些模块化。我是一个单人操作。


学习和使用OOP有什么好处吗?我还有很多其他的东西需要花费我有限的智力学习。

解决方案

5月28日,3:44下午,Gregor < rmba ... @ comcast.netwrote:


这是部分意见问题。我使用vanilla PHP为我的

主站点进行了一些模块化。我是一个单人操作。


学习和使用OOP有什么好处吗?我有很多其他的b $ b东西用于我的有限智力学习。



OOP对于单人操作非常有用。然而,学习OOP有点耗时(这对单人操作不好)。


如果你是PHP 5 ,你在OOP方面要好得多。如果你学习PHP5并使用它的OOP功能,那么它就会变得很困难,但是

然后以某种方式卡在PHP 4中,这是更多随心所欲

(想想JavaScript)。


这是一个非常难以回答的问题,因为糟糕的OOP-

影响了代码可能比某些程序或功能代码更糟糕。

但它肯定会减少对代码的破坏:


< code>

类Build_Html_Page {

公共静态函数__construct(


key){


< blockquote> str =


This is partially an opinion question. I have some modularization for my
main site using vanilla PHP. I''m a one-man operation.

Is there any major benefit to learning and using OOP? I have lots of other
stuff to be spending my limited intelligence learning.

解决方案

On May 28, 3:44 pm, "Gregor" <rmba...@comcast.netwrote:

This is partially an opinion question. I have some modularization for my
main site using vanilla PHP. I''m a one-man operation.

Is there any major benefit to learning and using OOP? I have lots of other
stuff to be spending my limited intelligence learning.

OOP is VERY useful for one-man operations. Learning OOP, however, is
somewhat time-consuming (which is not good for one-man ops).

If you''re in PHP 5, you''re a lot better off OOP-wise. This makes it a
little difficult, if you learn PHP5 and use it''s OOP features, but
then somehow get stuck in PHP 4, which is a lot more free-wheeling
(think JavaScript).

This is a really difficult question to answer, since bad OOP-
influenced code can be WORSE than some procedural or functional code.
But it sure makes it a lot less finger-breaking to code:

<code>
class Build_Html_Page {
public static function __construct(


key) {


str =


这篇关于对于OOP或不对OOP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆