Re: Help Constructing Fictional Cross-Religious Movement
- From: Brooks Moses <bmoses-nospam@xxxxxxxxxxxxxxxxxx>
- Date: Sat, 27 Aug 2005 16:31:28 -0700
Wilson Heydt wrote:
In article <430FC09A.10502@xxxxxxxxxxxxxxxxxx>, Brooks Moses <bmoses-nospam@xxxxxxxxxxxxxxxxxx> wrote:That's one of the first big Important Things about objects -- it's like a typedef in the sense that you can declare lots and lots of them, but it also can have private variables within all those objects that only certain functions can access.
If it's such an important discHtinction, why is it that I can clearly see how to do the exact same thing in non-OO langauges that I've worked with for over 30 years?
I see three reasons: (a) You know how to do something in Fortran that I don't know how to do despite being pretty familiar with it, (b) COBOL can do this where Fortran 95 can't, or (c) one of us isn't understanding the other about what the "exact same thing" is.
Given that this is something that I'd really like to know how to do in Fortran -- and, while Fortran 2003 has objects, there are as yet no Fortran 2003 compilers -- would you mind explaining how you'd do the following in COBOL or Fortran or something similar?
Consider the following subroutine, which defines what amounts to a "point" object of sorts:
subroutine point
real, save :: x, y
real :: xin, yin, xout, yout, d entry setpoint(xin,yin)
x = xin
y = yin
return entry getpoints(xout,yout)
xout = x
yout = y
return entry getdistance(d)
d = sqrt(x*x + y*y)
return
end subroutineNow suppose that I'd like to have multiple points that are like this one, which have independent x and y values but have identical functions. Specifically, I'd like to have an array of points, and some other points that aren't in that array, and I'd like to be able to pass them as arguments to other subroutines. How would you do that?
[...]
My analogy here is that insisting that there is some mystical difference between
an object and a function or subroutine is the same sort of roadblock that insisting
there is some mystical difference between a row and a record. Sure, there are things
that are a whole lot easier to do to or with a database row than with a flatfile record, but those differences aren't fundamental to what they are. I do understand
the utilitarian differences between objects on the one hand and subroutines or functions on the other. Rather, it is the insistence that the naming convetion carries something important in and of itself that matters coupled with mischaracterisizing what can be done under the previous "labels" that is the problem.
I only agree with that partway, which is a good part of why I've been debating this. I think that the naming convention _does_ carry something important -- namely, it carrys a way of thinking about the program, and that way of thinking leads to things being trivial that might not otherwise be.
Now, I definitely agree that mischaracterizing what can be done under the previous labels is a problem, and I also agree that descriptions of objects tend to claim a lot of things as differences that really aren't, and tend also to describe things in object-specific jargon in ways that amount to completely begging the question.
That's why I found the O'Reilly book's author so refreshing when he came out and admitted that an object is just a function by another name and went on from there.
Any problems I have with Java aren't because I don't know what an object is. The problems I have with the language are probably do to general ossification of the brain that have come with age. Just as there are "9 and 60 ways of constructing
tribal lays, and every single one of them is *right*", there are a myriad of ways of writing books on Java and I have yet to find to one that meshes smoothly with
me so that I "get" the language. I may never find such a book, or one may turn
up tomorrow. Who knows?
Certainly not I. In my experience with learning C++, what worked for me was finding a programming problem that seemed reasonably amenable to object-oriented programming, and that I wanted to write starting from a blank slate. Specifically, something that I already wanted to do, for reasons other than learning programming. Once I had that, mostly what I needed was a book that had a good index and layed out the basic programming syntax thoroughly and concisely.
- Brooks
-- The "bmoses-nospam" address is valid; no unmunging needed. .
- Follow-Ups:
- Re: Help Constructing Fictional Cross-Religious Movement
- From: Wilson Heydt
- Re: Help Constructing Fictional Cross-Religious Movement
- References:
- Re: Help Constructing Fictional Cross-Religious Movement
- From: Joann Zimmerman
- Re: Help Constructing Fictional Cross-Religious Movement
- From: Wilson Heydt
- Re: Help Constructing Fictional Cross-Religious Movement
- From: Brooks Moses
- Re: Help Constructing Fictional Cross-Religious Movement
- From: Wilson Heydt
- Re: Help Constructing Fictional Cross-Religious Movement
- Prev by Date: Re: Representing futuristic English
- Next by Date: Re: Morality Question
- Previous by thread: Re: Help Constructing Fictional Cross-Religious Movement
- Next by thread: Re: Help Constructing Fictional Cross-Religious Movement
- Index(es):
Relevant Pages
|