Prefixes for Variable Names

30 views
Skip to first unread message

cmclane

unread,
Jun 28, 2018, 6:10:26 PM6/28/18
to SuperCard Discussion
In many SuperCard scripts I see variable name prefixes like "p", "t", "s" etc. Is this Hungarian Notation or some variant of it? Is there a list of the prefixes that are most commonly used or generally considered as good practice in SC scripting?

Scott

unread,
Jun 28, 2018, 6:25:06 PM6/28/18
to SuperCard Discussion
My method is to prefix locals with a 't' (temporary), globals with a 'g', and user propnames with a 'p' or 'u'. Makes scripts much more readable and eliminates reservedWord errors.

jen...@adelaide.on.net

unread,
Jun 29, 2018, 12:44:37 AM6/29/18
to SuperCard Discussion
(Hmm... I don't think that my email reply three hours ago has got through, so I will repost via the groups.google.com website.)

Hi Charlie

I have been using such variable name prefixes for years, based on a recommendation from Richard Gaskin for "liberal use of what is commonly referred to as Hungarian notation, in honor of the famous Microsoft programmer Charles Simonyi".

I see that Richard still has his Scripting Style Guide at 


It's recommended reading.

Peter Jenkins

Charles McLane

unread,
Jun 29, 2018, 10:00:12 AM6/29/18
to superca...@googlegroups.com
Peter, thank you for pointing me to the style guide that Richard and others put together. It looks like a great resource. It not only answered my question about variable naming, but just in skimming it I picked up a number of tips - - e.g. how to differentiate various types of comments in a script. I'll read it in full before attempting to work with the SampleDraw project (which I can see follows many of these conventions).

--
You received this message because you are subscribed to a topic in the Google Groups "SuperCard Discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/supercard-talk/IF4qFc3r8No/unsubscribe.
To unsubscribe from this group and all its topics, send an email to supercard-talk+unsubscribe@googlegroups.com.
To post to this group, send email to supercard-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/supercard-talk/3f8e9e1a-0547-4371-b8e7-7b031ae2efa6%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Charles F. McLane III, PhD
Principal

707 Alexander Road, Suite 206 - Princeton NJ 08540
Direct: 609-919-2701  Fax: 609-987-8488
Reply all
Reply to author
Forward
0 new messages