Eloquently sums up my feelings about the disadvantages of dynamic typing

H. S. Teoh hsteoh at quickfur.ath.cx
Wed Oct 16 10:26:37 PDT 2013


On Wed, Oct 16, 2013 at 09:19:56AM +0200, Jacob Carlborg wrote:
> On 2013-10-16 02:45, Adam Wilson wrote:
> 
> >+1
> >
> >This is why I claw my eyes out every time I have to work with
> >JavaScript.  This is why I find statically typed languages to so much
> >more powerful for the work I do
> 
> One big difference between Ruby and JavaScript is that when
> something fails in Ruby you'll get an exception. But with JavaScript
> it just silently fails and all your scripts on the site dies.
[...]

Yeah, this is exactly what makes Javascript a royal pain in the neck to
work with.  I have the dubious pleasure of having to work on a large
non-trivial JS codebase at work, and it has a reputation of simply
displaying a blank page when something goes wrong. Worse yet, there is
some default error handler somewhere that swallows all JS errors, so no
errors get logged to the browser's JS console at all -- you have to
debug the entire 50k or so lines of JS with a blank page as your only
clue as to what blew up.

(And don't get me started on IE6, which used to be the de facto standard
demanded by every customer some years ago, which doesn't even *have* an
error console. Fortunately, the world has moved on since.)

Other times, when it doesn't show a blank page, the same ingenious
default error handler makes it so that scripts *continue* running after
something has gone wrong. So when you screw up and some part of the code
crashes, the rest of the page continues running as if nothing happened,
except that some buttons mysteriously do nothing, or the widget starts
acting funny.


T

-- 
Bare foot: (n.) A device for locating thumb tacks on the floor.


More information about the Digitalmars-d mailing list