Re: Fallacious Thinking (Re: Date Formatting)
Re: Fallacious Thinking (Re: Date Formatting)
- Subject: Re: Fallacious Thinking (Re: Date Formatting)
- From: has <email@hidden>
- Date: Fri, 7 Mar 2003 16:24:39 +0000
Joshua See wrote:
> What about this old AS guidebook function? Is there a reason that its
> been considered unsuitable?
I could probably think of a few, relating to the quality and
usefulness of the AS guidebook stuff in general. But maybe some other
time.
Andrew Oliver replied:
I don't think this code is considered 'unsuitable' as much as unnecessary.
Consider 2K of script in 43 lines vs. a few bytes of script in one line.
Sorry if this is a rant, but I'm really tired of seeing this old
canard. As if somebody were awarding prizes for the least number of
lines used. It's not as if you have to write any of these 43 lines
yourself - you can do it with two key presses: cut and paste. This
hardly constitutes hard work. And last time I checked I had a
half-gig of memory and 40GB of drive space, so you'll excuse me for
not caring less about a couple extra KB here or there. Don't like
your own code cluttered up with this boilerplate junk? Stick it in a
separate file and bind it with a 'load script' command. That's one
extra line of code in the entire script, which I think most folks
could live with.
That's not to mention the fact that the unix date command is significantly
faster than the pure AppleScript method.
Maybe it's fast from the terminal. From 'do shell script', you pay a
significant penalty in overhead each time. I've got two
general-purpose date formatting libraries that will stomp all over
the 'do shell' approach - up to 10x faster. And if all you need is a
fixed-format datestamp and serious speed is an issue, a hand-rolled
routine should be closer to 100x. Most arguments about speed are
totally bogus anyway, but that's another topic.
Part of the ethos of UNIX is that there's multiple little tools linked
together to create a greater whole. Using the unix date command simply
encompasses that idea.
And a fine ethos it is. I just wish the same philosophy existed in AppleScript.
Whether you like it or not, 9 is on its way out. If the author knows their
script will only be used under certain dependencies (e.g. under Mac OS X) or
is prepared to require that, then s/he'd be silly not to do so.
Lots of folk still need to write scripts that'll deploy over OS8/9.
This was the OP's point, so pedestal pronouncements are hardly of use
here. (BTW, last time I checked my libraries worked on everything
back to OS8.)
Conceptually, requiring Mac OS X and the presence of the 'date' command is
no different from running under Mac OS 9.x and requiring a particular
scripting addition to be installed.
If we never used new tools when they become available we'd still be driving
cars with 2-speed, belt-driven transmissions, like the Model T Ford had.
I had to get a new laptop six months ago, and I still haven't
recovered from parting with the 2000UKP it cost me. Frankly I
wouldn't take an attitude with anyone who wants and/or has to stick
with older hardware and older OS; more power to 'em, the fortunate
sods. (Though maybe if you could lend me a few bucks the now...)
has
--
http://www.barple.pwp.blueyonder.co.uk -- The Little Page of AppleScripts
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.