 |
Scripting for end users
Posted by forax on July 28, 2006 at 04:54 AM | Comments (4)
After reading the John O'Conner Blog about scripting, i want to share some thoughts.
First, embedding script in a desktop application is not new, Mozilla Firefox, Open Office Writer/Calc (Microsoft Word/Excel) already provide a scripting environment to their end users since years.
While i'm not convinced by the fact that
applications fully written with script are easy to maintain,
i fully agree with javakiddy when he writes this comment
about john's prose:
"Scripting is very useful in desktop applications, but generally it should be employed for the benefit of the application or the end user, not as a convenience to the programmer. ;)"
Furthermore providing a way to define scripts to end users can help you to understand what enhancement the customer want.
I love the mozilla strategy on that :
- let users create their own extension using script (javascript)
- if a script is popular integrate it in the plateform
by frozen it in C++.
So perhaps it should not be be a bad idea to see a language
that ease to define a program in a script manner
and then enable to froze some part by typing them.
Eiffel already has this kind of concept, named melted ice i think,
and i will love to see Java goes in that direction.
Ok, that's enought for today, in the next post,
i will try to show a small desktop application demonstrating
how to use javax.script.Bindings to let end users interact
with Java object.
Bookmark blog post: del.icio.us Digg DZone Furl Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment
-
Allo Rémi,Scripting is a very powerful tool, and it is extremely easy to use. This makes it ideal for both developers, and users. Developers can rapidly prototype, and test; end users can customise and extend. Oddly, only a tiny percentage of either group actually makes use of this exceptional capability.I find it really interesting to use scripting to get multiple JVMs to co-operate.John
Posted by: cajo on July 28, 2006 at 06:16 AM
-
Hi, john, i agree with you, it is more rapid to prototype and test an application using a scripting language but when the prototyping phase is over and you want transform your prototype to a typed language you have to rewrite the whole.
There is neither language nor tool in which you can do something like freeze this script.
So as a developer, it's more a quick and dirty solution than a real solution.
Rémi
Posted by: forax on July 28, 2006 at 07:22 AM
-
Oh heck, there I go again, causing trouble!! :)
The prototyping argument is a valid point. Jython in particular is very good at this, because it enables the programmer to create and manipulate Java objects without the long-winded method calls used in Java. I think thought, in most circumstances, having worked up a solution in Jython (or whatever) one should then consider implementing it in concrete form using Java. Particularly if the code is an event handler.
Sometimes desktop applications do break themselves into natural parts -- for example games often use a separate language for the logic which controls events and environment, but this has to be understood for what it really is: the code here is not part of the game engine, rather it is 'data' associated to a given level/map/mission of the game, just as an onSubmit() script is 'data' (from a browser viewpoint) associated with a web page. As such it is perfectly reasonable to use a different language -- even if the code is not intended to be edited/created by an end user.
I'd hate to see a situation where desktop programmers started using scripting heavily so they could tweak the logic of their applications on-the-fly, when in reality they'd be better off sitting away from the keyboard with a pencil and paper, planning major changes. Back when I did COBOL programming we'd submit a test job to the mainframe, and wouldn't get the results back (line printer output) for anywhere between 15 minutes to 2 hours (depending upon what jobs were scheduled.) It disciplined one to plan ahead and consider your changes, rather than just wade into the code in an endless type/compile/errors loop. I sometimes (jokingly) wonder what would happen if we limited modern programmers to only one compilation per hour... would we get a better quality of code? :)
(ps: I should point out I really like scripting in desktop apps -- but my points about benefits/user versus convenience/programmer stands.)
Posted by: javakiddy on July 28, 2006 at 09:21 AM
-
Rémi,I mostly use scripts to prototype and test compiled classes. I definitely do not recommend writing applications as scripts; but for experimenting, or individually customisng an existing compiled codebase; scripts are nonpareil.John
Posted by: cajo on July 28, 2006 at 12:31 PM
|