Douglas's interests
Douglas's posts
Post has attachment
Should JSLint require that 'export' and 'import' be at the top of the file?
-
votes visible to Public
62%
yes
38%
no
Post has attachment
Post has attachment
Post has attachment
Public
JavaScript's function scope rule says that an inner function can implicitly see the variables of outer functions and must explicitly declare its own variables.
| function javascript() {
| var a = 0;
| function inner() {
| var b = a;
| }
| }
So imagine another language that does it the other way. There is no 'var' statement because variable declaration is implicit. But to see an outer variable, you must first use a 'see' declaration.
| function another() {
| a = 0;
| function inner() {
| see a;
| b = a;
| }
| }
Any program that could be written JavaScript could also be written in the another language. The difference is in programmer convenience (very low value) and error avoidance (very high value).
Which language would be better at avoiding declaration and scope errors?
| function javascript() {
| var a = 0;
| function inner() {
| var b = a;
| }
| }
So imagine another language that does it the other way. There is no 'var' statement because variable declaration is implicit. But to see an outer variable, you must first use a 'see' declaration.
| function another() {
| a = 0;
| function inner() {
| see a;
| b = a;
| }
| }
Any program that could be written JavaScript could also be written in the another language. The difference is in programmer convenience (very low value) and error avoidance (very high value).
Which language would be better at avoiding declaration and scope errors?
-
votes visible to Public
33%
JavaScript
47%
Another
21%
Neither has a significant advantage
Public
you
How much do you make? Have you ever contemplated suicide? Are you now or have you ever been... ? Are you aware of the fact... ? I have here before me.... Electrical information devices for universal, tyrannical womb-to-tomb surveillance are causing a very serious dilemma between our claim to privacy and the community's need to know. The older, traditional ideas of private, isolated thoughts and actions--the patterns of mechanistic technologies--are very seriously threatened by new methods of instantaneous electric information retrieval, by the electrically computerized dossier bank--that one big gossip column that is unforgiving, unforgetful and from which there is no redemption, no erasure of early "mistakes." We have already reached a point where remedial control, born out of knowledge of media and their total effects on all of us, must be exerted. How shall the new environment be programmed now that we have become so involved with each other, now that all of us have become the unwitting work force for social change? What's that buzzzzzzzzzzzzzzzzzzing?
[Marshall McLuhan, The Medium Is The Massage, 1967]
How much do you make? Have you ever contemplated suicide? Are you now or have you ever been... ? Are you aware of the fact... ? I have here before me.... Electrical information devices for universal, tyrannical womb-to-tomb surveillance are causing a very serious dilemma between our claim to privacy and the community's need to know. The older, traditional ideas of private, isolated thoughts and actions--the patterns of mechanistic technologies--are very seriously threatened by new methods of instantaneous electric information retrieval, by the electrically computerized dossier bank--that one big gossip column that is unforgiving, unforgetful and from which there is no redemption, no erasure of early "mistakes." We have already reached a point where remedial control, born out of knowledge of media and their total effects on all of us, must be exerted. How shall the new environment be programmed now that we have become so involved with each other, now that all of us have become the unwitting work force for social change? What's that buzzzzzzzzzzzzzzzzzzing?
[Marshall McLuhan, The Medium Is The Massage, 1967]
Post has attachment
Post has attachment
Post has attachment
Post has attachment
Wait while more posts are being loaded


