View Single Post
AsLan^
Not a tame lion...
 
Join Date: May 2004
Location: Narnia
 
2006-01-25, 13:38

Quote:
Originally Posted by chucker
I'm sorry, but I'm not sure you really understand what exactly I'm trying to learn. I could learn Java if I were so inclined, but I would still approach it with a procedural idea, and that's just badâ„¢.
I understand exactly what you are trying to do :AllKnowingGrin:

You want to break your procedural habits and learn object oriented programming... you stated as much.

Here's a secret, that you hinted at before, object oriented programming starts out procedural. You dont think they jump into extending an class right after hello world do you ? although they do jump into methods which is a key part of OOP, if you are familiar with functions... you'll have no problems with it.

As for not liking java or obj-c, well... you have to start somewhere, and if you are wanting to learn, the cutting edge is probably not the best place to start (i.e. ruby, python). Start with a language that has well entrenched coding practices so you can learn the basics. Time spent learning java for the purpose of learning OOP is not wasted even if you have no desire to code java apps.

As for the palindrome example... this is what you need to do to make it object oriented, very simple... two classes:

Create one class for reading in user input and passing that input to the other class.

The other class evaluates the string passed and determines if it is a palindrome or not, then passes back a boolean.

The first class then informs the user on whether they typed a palindrome or not based on the results of the answer it got from the other class.

It is very similar to a function call, but it is object oriented.

I will be up for about another three minutes to see if you respond
  quote