Talk:Letter frequency: Difference between revisions

m
 
Line 139:
::: To quote from the landing page, the idea is not only ''to demonstrate how languages are similar and different'' but also to ''aid a person with a grounding in one approach to a problem in learning another'',
::: So the more we disagree, the more useful material and revealing comparisons we can generate :-)
::: No amount of iterative programming with sequence branches and loops, even for fifty years, will ever introduce us to even the basics of maps, folds, orcurried and higher-order functions, and monadic compositions, or enable us to reframe from 'doing' to 'defining', so the notion of ''even an experienced AppleScripter ... XYZ ...'' probably looks a bit less rational to me than it apparently does to you – first-year kids in college often take courses in Scheme or Haskell these days – but the only really useful commentary is just an alternative draft.
:::The only really useful commentary is, however, just an alternative draft.
::: As Knuth famously puts it, ''premature optimization is the root of all evil'', but if I did want something faster for macOS scripting, my comment on your AppleScript draft would probably just be the JavaScript ES6 draft (on this page) which uses the macOS Automation library for the file access.
::: (Just a few lines of unoptimized new code, and on this system it gives counts for each distinct character in the text of ''les Miserables'' in well under a second. I would feel ashamed of myself if I wasted any time on thoughts of further optimizing that :-)
9,655

edits