Talk:Letter frequency: Difference between revisions

Content added Content deleted
(More AppleScript "generic" alternative discussion.)
Line 126: Line 126:


:To avoid the risk of a faintly comic impression, might it make sense for us to find a more illuminating, and more widely understood alternative to "straightforward" ? My approach obviously seems more "straightforward" to me – that's a symmetrical relationship :-) Perhaps ''Imperative'' ? ''Procedural'' ? Something else which has some precedent and familiarity on Rosetta Code, and will immediately be intelligible ? [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 10:17, 13 April 2020 (UTC)
:To avoid the risk of a faintly comic impression, might it make sense for us to find a more illuminating, and more widely understood alternative to "straightforward" ? My approach obviously seems more "straightforward" to me – that's a symmetrical relationship :-) Perhaps ''Imperative'' ? ''Procedural'' ? Something else which has some precedent and familiarity on Rosetta Code, and will immediately be intelligible ? [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 10:17, 13 April 2020 (UTC)

::"Straightforward" will do where I've used it: that is, doing the required task simply and effectively and with code which can be understood and maintained by people familiar with the language who aren't the original coder. This means not using handlers with cryptic labels and cryptic contents which do little but call other handlers with cryptic labels and cryptic contents and which aren't adequately commented.

::AppleScript's designed as far as possible to allow ''users'' of Macintosh computers, or those responsible for Macs in, say, small school or office environments, to automate tasks for themselves without having to call in a programmer wedded to a "Declarative", "Procedural", or whatever other programming philosophy. Its English-like syntax is one of its main features, allowing rank beginners often to ''guess'' their way to something — however terrible — which does what they need. On the other hand, more experienced coders coming to AppleScript from other languages find they can often still use those languages from AppleScript (courtesy of the <tt>do shell script</tt> command) or can at least follow their accustomed thinking habits when getting AppleScript to work for them. Those who take the bother to become familiar with AppleScript have a great deal of useful power at their disposal, including direct control of many applications. It's basically a getting-things-done language for Mac users, although many do grow to love it in its own right.

::As you've found, it can even accommodate ''your'' style of coding. If you're only writing for yourself and aren't interested in performance (!), it's perfectly legitimate to code that way in AppleScript (coding errors excepted). But it becomes problematic when it's presented in public as "the way things are done in AppleScript", which is simply misleading. You're the only AppleScripter in the known universe who writes code like that. It goes against the spirit of the language and against the general programming rule that code should be understandable and maintainable by coders other than the original author. Any novice Mac owner thinking of having a go at learning AppleScript and seeing your code would be put off immediately, thinking the language was all about terseness and chasing around in circles. Even an experienced AppleScripter trying to assess one of your scripts before running it, or trying to find out why it wasn't behaving as expected, would similarly lose patience very quickly and just write something more intelligible from scratch.

::I won't discuss this any further as I see you've had similar exchanges with practitioners of other languages on this site and are not to be budged from your conviction. I'm also aware that I'm in your debt for having dropped me a few hints when I first started posting here a couple of months ago, for which I couldn't at the time work out how to post my thanks. Thanks here if it's not to late. :) --[[User:Nig|Nig]] ([[User talk:Nig|talk]]) 18:51, 13 April 2020 (UTC)