[futurebasic] Re: Fear and Loathing Guide

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : December 1997 : Group Archive : Group : All Groups

From: Mike Friedman <friedo@...>
Date: Thu, 4 Dec 1997 19:50:41 -0500 (EST)
On Thu, 4 Dec 1997, Waverly Edwards wrote:

> >David wrote:
> >> Except that the BEGIN/END CLASS statement does not bracket the methods - 
> >> only the class property record.  So it will look more like this:
> >> 
> >> BEGIN CLASS "Main Window", "cWindow"
> >>   DIM helpRect.8
> >>   DIM currentTool%
> >>   DIM dataHandle&
> >> END CLASS
> >> 
> >> PROPERTY helpRect     = helpRect
> >> PROPERTY currentTool% = currentTool%
> >> PROPERTY dataHandle&  = dataHandle&
> >> 
> >> BEGIN METHOD redrawMain
> >>   'yadda
> >> END METHOD
> >> 
> >> BEGIN METHOD showHelp
> >>   'yadda again
> >> END METHOD
> >
> >I admit I don't know much about it, but this syntax design seems
> >counter-intuitive to me.  I've always though of a class's methods as
> >being "part of" the class, every bit as much as its data elements are. 
> >On the other hand, "END CLASS" looks like it's saying, "everything after
> >this is not part of the class."  Is there some reason for preferring to
> >put the methods outside of the BEGIN CLASS...END CLASS block?
> >
> >- Rick
> 
> 
> I guess I didnt say it correctly because this is the same point that I was
> making.  The way I've defined methods and properties is inside of a class
> definition.
> 
> BEGIN CLASS oddWindow
> 
>      METHOD grow
>         BEEP
>         PRINT "So you want to grow huh?"
>      END METHOD
>      
>      PROPERTY extraStorage    = 0
>      PROPERTY specialHitRect& = transparentRect&
> 
> END CLASS
> 
> 
> I find this much more intuitive.  You know for a fact that the 'grow' method
> and properties defined belong to oddWindow and only oddWindow.  Having
> methods defined outside the defining class block is confusing and implies
> that these methods are global, not belonging to any one class.  To take that
> a step further, if I wanted to define a 'grow' method for oddWindowToo, I
> think it would be rather confusing to see a two or more methods defined
> outside of a defining class block with the same name.
> 
> 

That's what I thought, too.  But, I just leanred that each class
definition exists in its own file.  So, there's no need to worry about
multiple classes getting you confused because they'll all be in their own
little files.  I agree, however, that the code structure is kinda
weird...but I'll learn to love it i'm sure.

> W.
> 
> ................................................................................
> 
> "If the only tool you have is a hammer, then every solution looks like a nail."
> 	Abraham Maslow
> 
> The only time you should look down on a man is when you're helping him get up.
> 
> ................................................................................
> 
> --
> To unsubscribe, send ANY message to <futurebasic-unsubscribe@...>
> 

- Mike