Tuesday, December 1, 2009

Re: [Java] New Member, old coding heritage...

Pete,

Sounds like you and I have similar backgrounds. I started in Data
General Assembly in the late 70s, then Intel, then C, then OOP, then
C++, then Java. OOP is a mindset that is "backward" from
Function-Oriented Programming. But, I dare say, it makes more sense.

FOP is oriented around actions: your daily routine "calls" a drive to
the bank, a bank withdrawal, and the drive home.

In OOP, you have 4 objects: home, you, the bank, and the car. The "you"
object has a method dailyRoutine () that calls car.drive (bank),
bank.transaction (bank.WITHDRAWAL), and car.drive (home). Note the reuse
of drive ().

Now, whatif you change cars? Or banks? Or move to a different house? In
FOP, you have to re-write your functions. In OOP, you extend the base
classes, but refer to the base class. Thus, your Car 1 code may look like:
Car car = new Toyota ();
car.drive (bank);
and your Car 2 code looks like:
Car car = new Chevy ();
car.drive (bank);
You only had to change one line of code! The Java runtime system does
the rest.

Take it from someone that's been there: OOP and Java are not only the
wave of the future, but they're the wave of now. Coding under OOP is a
lot easier than under FOP; there's so much that can be done.

-Java Guy

Pete Morris wrote:
>
> Thanks, Java Guy,
>
> I was afraid of that.
>
> I think I'm too set in my ways; I've long regarded OOP as a
> 'black-box' approach to scoping of variables and separating code from
> data. I expect this view is wrong, but it does seem little more than
> an exercise in semantics and mindset-adjustment.
>
> Just to fill-in a little more of my coding history, I learned Z80
> assembler in the early 1980's, and moved on to BASIC and then C in the
> early 1990's, always as a hobbyist. I have never programmed for a
> living, but have made several software tools to support my main hobby
> of amateur radio construction. My last programs were written in 1996.
> I had hoped to drag my game kicking and squealing into the present
> millenium with a 'modern' language, and Java appears adequate (easily
> ported, lots of plug-ins), I only hope I'm able to learn it before the
> wetware starts rotting too far.
>
> I'll soldier on with the Sun Tutorial series (I agree; they've done a
> nice job), but just this weekend I felt somewhat down-hearted, and
> even found myself trying to get my old Borland Turbo C 4.5 IDE running
> under Wine on my netbook. Now that's _desperation_.
>
> Pete Morris
>
> ________________________________
> From: Java Guy <javaguy@midnightmusic.net
> <mailto:javaguy%40midnightmusic.net>>
> To: Java_Official@yahoogroups.com <mailto:Java_Official%40yahoogroups.com>
> Sent: Sunday, 29 November, 2009 17:39:43
> Subject: Re: [Java] New Member, old coding heritage...
>
> Pete,
>
> Coming from C, you really have 2 concepts to learn, not one. First, Java
> is an Object-Oriented language, so you need to learn OOP
> (Object-Oriented Programming).
>
> <snip>
>
> [Non-text portions of this message have been removed]
>
>


------------------------------------

Visit http://aiaiai.com or http://jgame.org for more groups to join.
Java Official Group is created for the following topics: Java 2 Enterprise Edition - J2EE, Java 2 Standard Edition - J2SE, Java 2 Micro Edition - J2ME, XML, XSL, XSD, XPATH, Web Services, Jini, JXTA for all type of Java Geeks.
Whoever posts spam / ads / job related message will be BANNED IMMEDIATELYYahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/Java_Official/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/Java_Official/join
(Yahoo! ID required)

<*> To change settings via email:
Java_Official-digest@yahoogroups.com
Java_Official-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
Java_Official-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/

No comments:

Post a Comment