Julian said:
VK wrote:
[snip]
P.P.S. Also remember a very annoying cross-language bug in switch
construct: it executes all underlaying branches unless you stop it with
"break" statement.
[snip]
Hello VK
Just interested in why you consider this to be a "bug"?
As I escaped the classical Comp.Sci. education I dare to call bug on
bug and sh** on sh** if I feel so
)
In the particular I do not consider a nonsense to magically become a
lore just of being put in written (whoever wasted inks for it).
This has nothing to do with ECMA though - it's all the same: up to the
most pre-historic languages.
Why do I think it's a bug? Because it goes against the common
programming logic - and this is why people keep forgetting about
break's.
It's like having to put break after each function body so execution
wouldn't jump on underlaying function:
function foo() {
// ...
}
break;
function bar() {
// ...
}
- and w/o break after foo() we would immediately execute bar(). A lot
of sense? None. The same amount in
case X : ...; break; // IMHO
A perfect case of reversed logic for me. That would have some sense
maybe to have a flag to "continue" execution of underlaying branches -
but not a current annoyance twist.
IMHO IMHO IMHO