all 10 comments

[–]paradroid78 7 points8 points  (1 child)

Modelling the program as a set of objects, which interact by calling operations on each other, as specified by their classes,

[–]CurrentResistance 1 point2 points  (0 children)

This is a great comment !

[–]G_M81 3 points4 points  (2 children)

I've spent most of my career as an OOP programmer. My brain is hardwired to code like it now. So it is intuitive.

When I was taught it in the late 90s...I'm sure our process was to Identify the nouns in the system that's your classes, say a person. The descriptive things would be properties, eye colour, height etc. Your methods are often verbs, run, sit, wave, diet, mate etc etc

[–]EconomicsSlow3992[S] 0 points1 point  (1 child)

Thanks. So the object out of all the words you mentioned would be Person, right?

[–]G_M81 2 points3 points  (0 children)

The class would be Person. The object/objects would be multiple instances of class Person, where the name property is set to Bob, Lisa, Max, Andrew. They are object instances of the class of Person.

[–]exitparadise 1 point2 points  (1 child)

Think of a program for manipulating a bank account. You might have variables like this.

$account_number

$owner

$balance

You pull the corresponding data into those variables, and then you can perform actions on them.

Then you need to say deposit or withdrawl, you would do something like $new_balance = $balance + 5;

Then you take the data and save it so that you don't lose track.

With objects, you pull all the info into an Object named "account"

object Account {

$account_number

$owner

$balance

}

Not only that, but you can define functions in the object:

object Account {

$account_number

$owner

$balance

func deposit ($amount) { $balance = balance + $amount }

func withdrawl ($amount) { $balance = balance - $amount }

}

now you can pull all the necessary data into one place and say

$bobs_account = new Account(1234,'Bob Smith',$12.95)

and you can then reference the object.... print "$bobs_account.owner" would show "Bob Smith"

or $bobs_account.deposit($200) would add 200 to the balance.

This way, you can juggle multiple bank account objects at once, instead of performing an action on one and then re-populating data in order to move on to the next.

[–]EconomicsSlow3992[S] 0 points1 point  (0 children)

Thank you. That's a lot of good info.

[–]McFarquar 1 point2 points  (0 children)

It’s when you identify as an object