Inconsistent comma requirements
Mark Waddingham
mark at livecode.com
Mon Jun 26 06:55:42 EDT 2017
On 2017-06-26 12:41, hh via use-livecode wrote:
> No reason to get angry. This thread started from an excellent LC Lesson
> in the forum ( http://forums.livecode.com/viewtopic.php?f=7&t=29403 )
> There is only one line to know:
> function logarithmicSearch @pArray pItem pLeft pRight
>
> Presumably a lot of people uses scripts from these lessons (that are
> pretty good, recommended for beginners). So "forget pretty quickly"
> seemed
> not appropriate to me. And a candidate for your "certain percentage" is
> each and every beginner.
I wasn't getting angry - hence the 'wink' at the end...
It was just merely a reminder that none of us are 'omnipotent' - its
always useful to reference discussions if they are mixed from different
places (there's a lot of posts everywhere, and many times we can only
survey the headlines).
> But please don't judge this as 'bug'. It is a wonderful feature!
> Beginners can learn from it. Would be better to explain the advantages
> and
> disadvantages for using spaces instead of commas (one could use parts
> of
> this thread).
In general I'd perhaps say that we should normalize the lessons to use
code forms which are considered best practice - so I would consider
lessons which use spaces and not commas as a bug for this reason.
I'm not sure I can see that using spaces between arguments *is* in any
way best-practice as it hides a required notion when you actually have
to call the command (and can hide subtle typing errors as Paul pointed
out) - the synergy between parameter declarations and parameter use is
probably an important concept thus should be reinforced at every
opportunity.
Something Richard mentioned about '=' being used in constant and var
init also sticks in my mind as slightly jarring - it is perhaps
something we should tweak to allow 'is' and '=' (yes, *technically* a
synonym, but we can make the 'is' form strictly preferred as a slightly
better way of expressing what you mean):
constant kFoo is 100
local tVar is 200
In LCB, we chose 'is' rather than '=' for very much this reason.
I think it is probably generally true that the more consistent and
simpler the language is, the easier it is to learn.
Warmest Regards,
Mark.
--
Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps
More information about the use-livecode
mailing list