tags:

views:

70

answers:

2

Reading the book I found the following:

The way of thinking when you model the problem by its single elements its the base of objected oriented programming.

Also when I want to make a game (e.g.), the player is one element, the level is one element? Those are just basic elements which my application logic consists of?
It also says the OOP is closer to way humans think — that is beucase we think more in "objects"?

A: 

Yes. Yes. & Yes.

the player is one element, the level is one element? Yes, they should be some class in your program.
It also says the OOP is closer to way humans think - that is beucase we think more in "objects"? Yes, we think in objective way. for example, when you mean Player, you know that player could score some points, win or lose, so you could code that "events" as methods of Player's class. After that, using your instance of player will be very natural.

Rin
A: 

I would say that The way of thinking when you model the problem by its single elements is the base of object oriented modeling.

In a sufficient complex program you have classes that represent the problem that you want to solve. In a bank app coustomer, account, in your case, player, enemy, maybe level.

I other parts you have classes that represent the solution* of the problem, or the implementation part, such as regex class, maybe a sprite class, string class an so forth.

An object is a collection of functions and variables that have a common purpose, in some cases represent a real-world object, but it is not the mayority of the cases.

I suspect that the reason to a lot of programming book authors compare the programming language object with real world object is make is simple to get a first understanding of what OOP is. But if the author never continue to tell what an object really is a lot of people can be confused, at least for a while.

Gorgen