I honestly believe that a concept of 3 different nulls (null, undefined and
false) in ECMAScript is... well, just yet another thing ECMAScript did
wrong. By reducing it to 2 nulls HaXe did it some justice, but I'd still be
happier with only one :P

And, you are really arguing on unimportant issues - how many poor victims
of Sun and Oracle write that x == null every single minute of their working
days? I think that if they can, we could've done that too... Actually, in
this regard Lisp offers a good solution - just use a function: (null x) or
(zerop x) and so on! :P

Re comparison vs cast - that's precisely the same speed, tested in depth on
many platforms, I would even assume that the ARM or MIR or w/e it's called
what gets generated from that expression is the same. It is also the exact
same count of bytecode instructions. But the time used to execute either
set of instructions is _absolutely negligible_ even if you are writing a
highly optimized algorithm, such as to do cryptography or image processing
- it doesn't matter! Trust me, I'm almost an engineer! (well, I did some
cryptography, seriously).

The [] vs new Array() - is by the virtue of ASC, it is true, that there's a
difference in performance, but it shouldn't be like that. If ASC was
smarter, it wouldn't matter. It's not like in C++ you'd allocate on heap vs
allocate on stack etc - it's really a matter of writing a sane compiler.

HaXe provides very basic documentation API - it only gathers the comments
and it would expose it to any program willing to process them. That's why I
mentioned NaturalDocs. The later, however, is much more robust tool then
ASDoc. You are just thinking very specific to AS3, not realizing there may
be entirely different solution that both covers your needs, and, may,
potentially create other interesting opportunities.

XML and JSON are equally bad formats :) I kind of fail to even notice the
difference. So, arguing in favor of one of them is like choosing the kind
of punishment for yourself - I'm not sure I'd like it either way.
Re' your particular example - I'd be rather thinking about a printf-like
function that would format strings, so that you could avoid verbose string
concatenation. To help that a bit, HaXe supports multiline string literals,
so given your example, the theoretical printf could be something like:

XML.parse( printf(
"<%1>
    %2
</%1>", "foo", "bar")) => <foo>bar</foo>

One step away from XML.printfAndParse(
"<%1>
    %2
</%1>", "foo", "bar") => <foo>bar</foo>

Kind of looks OK to me... :)

Reply via email to