defining functions before they're used
- jslint complains if I use a function before it's defined, e.g.:
window.onload = initialize;
I can certainly understand why one might choose, stylistically, to
always define functions before calling them. However, I have never
the function being called.
Is this an instance of jslint merely recommending a coding style, or
can there be compile-time or run-time problems resulting from putting
the call before the function?
(It's my personal preference to put the call first because I like to
read scripts top-down, seeing how a function is used before reading
the details of exactly what the function does.)
Juniper Webcraft Ltd.