Hacker News new | ask | show | jobs
by Macha 1679 days ago
Javascript and C.

Neither are considered pinnacles of language design.

1 comments

Javascript requires explicit variable declaration if you're bringing it to a new scope, though. Which is to say:

    var s = "Geeksforgeeks";
    function f_global() {
        s = "Me too";
    }
    // is different from
    function f_local() {
        var s = "Me too";
    }
I like that better (and I realize I might be alone!). But I don't like that you can declare a global variable in a local function by omitting the var. It's a similar needless ambiguity and frankly much more prone to errors than the python local variable initialization. At least there is strict mode.