working method?
Dan Shafer
revdan at danshafer.com
Thu Oct 27 02:26:08 EDT 2005
Charles...
As you can already see, this was far from a dumb question. It is one
that comes up every once in a while on the list. I am always
interested to see the various opinions about the best way to factor
code and organize applications.
From my early days in HyperCard, I have followed, more or less
religiously, Sarah's recommendation to keep all handlers as low in
the hierarchy as makes sense and no lower. I like the self-contained
feel this gives UI components. If I copy a button from Stack A to
Stack B, I don't have to go get its script separately from the group
or card or stack and copy that over to Stack B separately.
To keep track of where in the hierarchy a particular handler or
function is defined, I use the simple expedient of comments on the
lines where these operations are invoked. I tried naming conventions
but for me, they either make the name less readable and memorable or
are too hard to type or both. So I just add a comment. It helps that
I'm a very fast typist, so this kind of thing, once the habit is
ingrained, takes little extra time. It does have the downside that if
I relocate the handler, which I do fairly often particularly early in
the development cycle, I have to remember to change the comment. But
then if I used a naming convention, I'd have to change the handler
call itself; at least my way the script doesn't break.
I have not yet learned to make extensive use of libraries. As an old
HyperTalker, I can be heard to mutter such things as "Libraries? We
don't need no stinki' libraries, man!" But I do see the value and
wisdom of using them, particularly for functionality you want to
reuse in multiple applications or stacks. So recently I've started
factoring out some of my code into small libraries for this purpose.
Clearly this whole issue is a matter of style and what works for you.
The idea of using some sort of coded characters as comments to
indicate handlers that are in the card, group or stack is a shorthand
way of doing what I do and probably works particularly well for
slower typists. It also makes the comments easier to find.
On Oct 26, 2005, at 7:25 PM, Charles Hartman wrote:
> I know this is going to sound like a *really* dumb question, if
> only because it's so vague. But I'm wondering how people adjust
> their workflow to the way Transcript's code is dispersed among many
> separate scripts.
>
> I keep getting lost. I keep forgetting where my code is that does
> such-and-such. (Which script was that in?) So I keep losing track
> of what I was about to do next, and my concentration falls apart.
> It's making Rev *much* slower for me to program in than supposedly
> more complicated languages like Python and C++.
>
> Anybody think this makes any sense? Any hints how to think about it
> differently?
>
> Charles Hartman
>
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dan Shafer, Information Product Consultant and Author
http://www.shafermedia.com
Get my book, "Revolution: Software at the Speed of Thought"
From http://www.shafermediastore.com/tech_main.html
More information about the use-livecode
mailing list