哲学纲领问题 [英] Philosophical Programmin Question

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

问题描述

好吧,对于我的同行大师来说,这是一个有争议的问题:为什么我们在网络环境中使用面向对象的编程呢?


从本质上讲,网络是一种无国籍的环境。基于Web的应用程序

总的来说是相当简单的事情。通常,对象在概念上被认为是具有生命周期的实体。拥有一个

对象的时间比单个页面的执行时间长,可能会造成痛苦。只有一个对象只能存活一页几乎不值得。


封装,类似概念的分组,可以用井来完成/>
精心设计的库,甚至文件命名结构。

我不认为我曾经在任何

web中使用了inhertiance或真正的多态性项目,永远。


那么给出了什么?为什么人们使用mysql_fetch_object代替

mysql_fetch_array?这是习惯吗?这是我们教的吗?我们是否需要额外的价值?


~D

Alright, this is a controvercial question for my fellow gurus: Why do
we bother with Object-Oriented programming in a web environment?

The web, by nature, is a stateless environment. Web-based applications
are, on the whole, fairly uncomplicated things. Objects are, generally,
conceptually thought of as entities that have a lifespan. Having an
object survive for longer than the execution of a single page can be a
pain. Having an object only survive for one page hardly seems worth the
trouble.

Encapsulation, the grouping of like concepts, can be done with a well
thought-out library, or even file naming structure.
I don''t think I have ever used inhertiance or true polymorphism in any
web project, ever.

So what gives? Why are people using mysql_fetch_object instead of
mysql_fetch_array? Is it habit? Is it what we''re taught? Do we percieve
some additional value?

~D

推荐答案

dracolytch写道:
dracolytch wrote:
好吧,对于我的同行大师来说,这是一个有争议的问题:为什么我们在网络环境中使用面向对象的编程呢?
<从本质上讲,网络是一个无国籍的环境。基于Web的应用程序总的来说是相当简单的事情。通常,对象在概念上被认为是具有生命周期的实体。让一个
对象存活的时间超过单个页面的执行可能会带来痛苦。让一个对象只存活一页几乎不值得给它带来麻烦。

封装,类似概念的分组,可以用一个很好的经过深思熟虑的库来完成,或者甚至是文件命名结构。
我认为我从来没有在任何
网络项目中使用过于无意义或真正的多态性。

那是什么给出的?为什么人们使用mysql_fetch_object而不是mysql_fetch_array?这是习惯吗?这是我们教的吗?我们是否还有其他价值?

〜D
Alright, this is a controvercial question for my fellow gurus: Why do
we bother with Object-Oriented programming in a web environment?

The web, by nature, is a stateless environment. Web-based applications
are, on the whole, fairly uncomplicated things. Objects are, generally,
conceptually thought of as entities that have a lifespan. Having an
object survive for longer than the execution of a single page can be a
pain. Having an object only survive for one page hardly seems worth the
trouble.

Encapsulation, the grouping of like concepts, can be done with a well
thought-out library, or even file naming structure.
I don''t think I have ever used inhertiance or true polymorphism in any
web project, ever.

So what gives? Why are people using mysql_fetch_object instead of
mysql_fetch_array? Is it habit? Is it what we''re taught? Do we percieve
some additional value?

~D




我同意。



I agree.


文章< 11 ********************** @ g47g2000cwa.googlegroups .com>,

" dracolytch" <博士******** @ gmail.com>写道:
In article <11**********************@g47g2000cwa.googlegroups .com>,
"dracolytch" <dr********@gmail.com> wrote:
好吧,对于我的同行大师来说,这是一个具有争议性的问题:为什么我们在网络环境中使用面向对象的编程?
对象存活的时间超过单个页面的执行可能会带来痛苦。让一个对象只存活一页几乎不值得给它带来麻烦。

封装,类似概念的分组,可以用一个很好的经过深思熟虑的库来完成,或者甚至是文件命名结构。
我认为我从来没有在任何
网络项目中使用过于无意义或真正的多态性。

那是什么给出的?为什么人们使用mysql_fetch_object而不是mysql_fetch_array?这是习惯吗?这是我们教的吗?我们是否还有一些额外的价值?

~D
Alright, this is a controvercial question for my fellow gurus: Why do
we bother with Object-Oriented programming in a web environment?

The web, by nature, is a stateless environment. Web-based applications
are, on the whole, fairly uncomplicated things. Objects are, generally,
conceptually thought of as entities that have a lifespan. Having an
object survive for longer than the execution of a single page can be a
pain. Having an object only survive for one page hardly seems worth the
trouble.

Encapsulation, the grouping of like concepts, can be done with a well
thought-out library, or even file naming structure.
I don''t think I have ever used inhertiance or true polymorphism in any
web project, ever.

So what gives? Why are people using mysql_fetch_object instead of
mysql_fetch_array? Is it habit? Is it what we''re taught? Do we percieve
some additional value?

~D




1)

$ b $嗯,我不同意基于Web的应用程序的想法是相当简单的事情。向salesforce.com或其他基于Web的应用程序服务器弹出来说明。


如果有的话,网络应用程序变得越来越复杂一年。


2)


OOP是一种应用程序设计方法。如果您愿意:


Note_Add()

Note_Delete()

Note_Update()


它适合你 - 这很好,花花公子。人们多年来一直在做




就个人而言,我喜欢数据封装的级别和级别

抽象OOP可以提供。



1)

Well, I would disagree with the idea of Web based applications are
fairly uncomplicated things. Explain that to salesforce.com or the
multitude of other web based app servers popping up.

If anything, web apps are becoming more and more complicated every year.

2)

OOP is an application design method. If you like:

Note_Add()
Note_Delete()
Note_Update()

and it works for you - that is fine and dandy. People have been doing
that for years and years.

Personally I like the level of encapsulation of data and level of
abstraction OOP can provide.


有一些非常复杂的基于Web的应用程序。亚马逊和

Google做了一些非常棒的事情。一般来说,基于网络的应用程序并不是那么复杂。我们不是在写高级人工智能系统,创建进化计算算法,而是用多元物理引擎做



我不喜欢Note_Add()Note_Delete()Note_Update。


note_add.php

note_insert.php

note_delete.php


虽然更有意义。这将您的演示代码

与您的应用程序逻辑分开。它还促进了重复使用(通过各种方式将信息传递给

note_insert),并且允许你做例外处理

优雅处理。


~D

There are some highly complicated web based applications. Amazon and
Google do some stuff that is simply amazing. Generally speaking though,
web-based applications are just not that complicated. We''re not writing
advanced AI systems, creating evolutionary computing algorithms, or
doing multibody physics engines.

I do not like Note_Add() Note_Delete() Note_Update.

note_add.php
note_insert.php
note_delete.php

Makes a lot more sense though. This separates your presentation code
from your application logic. It also promotes reuse (Pass info to
note_insert via various means), and will allow you to do exception
handling gracefully.

~D


这篇关于哲学纲领问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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