The VBScript engine does two passes on the source code. Evidence: a syntax error
in the last line will be caught before a run time error in the first line. I can't prove but
believe that the first pass will generate an intermediate form of the script to make
the second - interpreting/executing - pass more efficient. One argument: the VBA
interpreter has this functionality (you can choose Compile
or Run from the menu).
This intermediate form is not binary = native x86 code but more akin to the MIL
of the .Net languages or the byte code of Java.
In my opinion, "scripting" is to "programming" what "essay writing" is to "writing a
(scientific) book". The aims/goals are different: An essay should present the most
important facts in an easy to read way; a script should do its job correctly but
may skip some of the pedantic things necessary for a 'heavy duty' program in
exchange for being easy/easier to write.
Some people believe that French is especially suited to write essays, so let's assume
- for the sake of the following argument - that it is somewhat easier to write scientific
books in Chinese. VBScript/Javascript/Perl ... are better suited to scripting (simple/no types,
Eval/Execute, ma
ny defaults); C/C++/... are good for programming (strict type system,
compile time checks, flexibility). But modern languages blurr this difference: Java or
the .Net languages are compiled (to an intermediate language) but can generate/compile/
execute new code at runtime.
I thin
k, the most important rule is:
Quidquid agis, prudenter agas et respice finem
(Whatever you do, do it carefully/wisely, and consider the end/result)
<message edited by ehvbs on Monday, June 11, 2007 11:23 PM>