On Mar 19, 5:47 pm, Jared Hirsch <[email protected]> wrote:
>
> I've only written JS to run inside browsers and server-side V8. I'd love it
> if you could share some examples of the differences between native and host
> objects :-)
>
  Well, my original statement was borne mostly out of frustration with
adobe's wildly varying support for javascript in its applications.
Most objects
work OK, but you keep coming across ones that throw a Reference Error
if you
try to access undefined properties rather than returning
"undefined" (Indesign
especially does this on nearly all objects). It's like IE all over
again.

  So you end up using a lot of try/catch constructs to support the
objects coming
from the application host.

  At the same time, you've got a wider set of objects native to the
ExtendScript
language: every Object has .reflect property that lets you query what
properties
and methods an object has; there's a global $ object that gives access
to system
information and the debugger; XML is handled by an XML object and
there are File
and Folder objects and a general Socket object too. The file system
stuff uses a
URI scheme that tries to iron out the differences between MacOS and
Windows filing
systems, and the Socket allows you to talk to just about anything as
long as you
can implement the protocol. I've got Photoshop talking to Oracle and
our renderfarm
server quite happily. Oh, and there's UI building objects that let you
make
panels that plug into the host application's interface using a much
wider range
of UI widgets than HTML ever supported (and you can laboriously draw
your own if
you want).

  It's all quite powerful, but let down by the debugger/IDE. It
crashes regularly.
It uses a non-monospace font by default! It often invokes an Undo on
your files
_whilst_ debugging, so it carries on executing the latest version of
the code
whilst displaying it minus the last changes you made. And if you
forget to issue
a redo...

  Mostly though the complete lack of any HTML DOM (obviously) means
that when you
return to browser scripting the division between the language and the
application
environment it happens to be executing in are quite clear.

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to