程序开发和OO开发有什么区别?

时间:2023-01-20 17:36:10

Of course, I can explain it in whole books. But I read a few days ago, that in a application talk, it is often asked and they expect a answer in 2-5 sentence, that should be very clear and show that you udnerstand the material.

当然,我可以在整本书中解释它。但是我几天前读过,在应用程序谈话中,经常被问到并且他们期望在2-5句中得到答案,这应该非常清楚并且表明你已经完成了这些材料。

I tried a few times to collect the answer in 2 sentence but don't get a good one.

我试了两次,用两句话来收集答案,但没有得到一个好的答案。

6 个解决方案

#1


How's about this for a succinct description:

对于简洁的描述,这是怎么回事:

Procedural Programming is primarily organized around "actions" and "logic". OOP is primarily organized around "objects" and "data". OOP takes the view that what we really care about are the objects we want to manipulate rather than the logic required to manipulate them.

程序编程主要围绕“动作”和“逻辑”进行组织。 OOP主要围绕“对象”和“数据”进行组织。 OOP认为我们真正关心的是我们想要操纵的对象而不是操纵它们所需的逻辑。

#2


Procedural Programming means dividing the problem up into smaller parts and then representing each smaller part by a definitive sub-routine,function or procedure.

程序编程意味着将问题分成较小的部分,然后通过确定的子程序,功能或程序来表示每个较小的部分。

OOP decomposes the problem to a set of interacting objects, each object is comprised of a number of elements, called members and methods (as opposed to variables and functions). The purpose of the object is to abstract part of the real world that we're interested in (our problem domain).

OOP将问题分解为一组交互对象,每个对象由许多元素组成,称为成员和方法(与变量和函数相对)。该对象的目的是抽象我们感兴趣的现实世界的一部分(我们的问题域)。

#3


Three sentences...

Defining data structures and the behavioural logic that acts on them are central to both approaches. Being able to encapsulate associated data and behaviour allows for the concept of self-contained “Object” constructs. Pure Object Oriented Programming is where no other type of construct is required.

定义数据结构和作用于它们的行为逻辑是两种方法的核心。能够封装相关数据和行为允许自包含“对象”构造的概念。纯面向对象编程是不需要其他类型构造的地方。

There is of course a mixture of both approaches in most modern high-level languages. Constructs like Value Types and Static Classes are there to provide the procedural constructs that are still very useful.

当然,在大多数现代高级语言中都有两种方法的混合。像Value Types和Static Classes这样的构造提供了仍然非常有用的过程构造。

#4


  1. Procedure development lacks Inheritance, Encapsulation and Polymorphism. Tree paradigms that make OOP a better way of developing complex solutions.
  2. 程序开发缺乏继承,封装和多态性。使OOP成为开发复杂解决方案的更好方法的树范例。

  3. With procedural development you often run into spaghetti code especially with complex solutions which makes it much much harder to maintain such solutions.
  4. 通过程序开发,您经常遇到意大利面条代码,尤其是复杂的解决方案,这使得维护此类解决方案变得更加困难。

I'm just thinking of times when I did Turbo Pascal development and the way I do it now... A complete shift.

我只想到我做Turbo Pascal开发的时候以及我现在这样做的方式......完全转变。

#5


One more difference I felt and experienced is maintenance of code. With procedural language code maintenance goes wary but it is lot better with OO. Sometimes, changing code at some where deep down in the procedural program has blown the whole functionality itself.

我感受到的另一个不同之处是维护代码。使用过程语言代码维护变得谨慎,但使用OO会更好。有时,在程序程序的深处某处更改代码会破坏整个功能本身。

#6


Main difference is that object-oriented programming (OOP) is a programming paradigm that uses "objects" — data structures consisting of datafields and methods — and their interactions to design applications and computer programs. Programming techniques may include features such as information hiding, data abstraction, encapsulation, modularity, polymorphism, and inheritance.

主要区别在于面向对象编程(OOP)是一种编程范例,它使用“对象” - 由数据域和方法组成的数据结构 - 以及它们与设计应用程序和计算机程序的交互。编程技术可以包括诸如信息隐藏,数据抽象,封装,模块化,多态和继承之类的特征。

In my opinion OOP is like the reality we live in. Everything around us is an object, has its own behaviour and structure.

在我看来,OOP就像我们生活的现实。我们周围的一切都是一个对象,有自己的行为和结构。

#1


How's about this for a succinct description:

对于简洁的描述,这是怎么回事:

Procedural Programming is primarily organized around "actions" and "logic". OOP is primarily organized around "objects" and "data". OOP takes the view that what we really care about are the objects we want to manipulate rather than the logic required to manipulate them.

程序编程主要围绕“动作”和“逻辑”进行组织。 OOP主要围绕“对象”和“数据”进行组织。 OOP认为我们真正关心的是我们想要操纵的对象而不是操纵它们所需的逻辑。

#2


Procedural Programming means dividing the problem up into smaller parts and then representing each smaller part by a definitive sub-routine,function or procedure.

程序编程意味着将问题分成较小的部分,然后通过确定的子程序,功能或程序来表示每个较小的部分。

OOP decomposes the problem to a set of interacting objects, each object is comprised of a number of elements, called members and methods (as opposed to variables and functions). The purpose of the object is to abstract part of the real world that we're interested in (our problem domain).

OOP将问题分解为一组交互对象,每个对象由许多元素组成,称为成员和方法(与变量和函数相对)。该对象的目的是抽象我们感兴趣的现实世界的一部分(我们的问题域)。

#3


Three sentences...

Defining data structures and the behavioural logic that acts on them are central to both approaches. Being able to encapsulate associated data and behaviour allows for the concept of self-contained “Object” constructs. Pure Object Oriented Programming is where no other type of construct is required.

定义数据结构和作用于它们的行为逻辑是两种方法的核心。能够封装相关数据和行为允许自包含“对象”构造的概念。纯面向对象编程是不需要其他类型构造的地方。

There is of course a mixture of both approaches in most modern high-level languages. Constructs like Value Types and Static Classes are there to provide the procedural constructs that are still very useful.

当然,在大多数现代高级语言中都有两种方法的混合。像Value Types和Static Classes这样的构造提供了仍然非常有用的过程构造。

#4


  1. Procedure development lacks Inheritance, Encapsulation and Polymorphism. Tree paradigms that make OOP a better way of developing complex solutions.
  2. 程序开发缺乏继承,封装和多态性。使OOP成为开发复杂解决方案的更好方法的树范例。

  3. With procedural development you often run into spaghetti code especially with complex solutions which makes it much much harder to maintain such solutions.
  4. 通过程序开发,您经常遇到意大利面条代码,尤其是复杂的解决方案,这使得维护此类解决方案变得更加困难。

I'm just thinking of times when I did Turbo Pascal development and the way I do it now... A complete shift.

我只想到我做Turbo Pascal开发的时候以及我现在这样做的方式......完全转变。

#5


One more difference I felt and experienced is maintenance of code. With procedural language code maintenance goes wary but it is lot better with OO. Sometimes, changing code at some where deep down in the procedural program has blown the whole functionality itself.

我感受到的另一个不同之处是维护代码。使用过程语言代码维护变得谨慎,但使用OO会更好。有时,在程序程序的深处某处更改代码会破坏整个功能本身。

#6


Main difference is that object-oriented programming (OOP) is a programming paradigm that uses "objects" — data structures consisting of datafields and methods — and their interactions to design applications and computer programs. Programming techniques may include features such as information hiding, data abstraction, encapsulation, modularity, polymorphism, and inheritance.

主要区别在于面向对象编程(OOP)是一种编程范例,它使用“对象” - 由数据域和方法组成的数据结构 - 以及它们与设计应用程序和计算机程序的交互。编程技术可以包括诸如信息隐藏,数据抽象,封装,模块化,多态和继承之类的特征。

In my opinion OOP is like the reality we live in. Everything around us is an object, has its own behaviour and structure.

在我看来,OOP就像我们生活的现实。我们周围的一切都是一个对象,有自己的行为和结构。