lol. This language is a joke

  • 23
    Yeah... Another rant on JS without basic JS function knowledge. Now go and read about parseInt and its parameters. And about Array.map as well.
  • 2
    Wtf 😨
  • 2
    @mlask are we fighting ?
  • 6
    @zombieleet should we? 😉
  • 1
    @mlask Why do this happen?
  • 16
    parseint takes two parameters and map tries to pass three.
    So parseint is being called like this:
    parseint("10", 0)
    parseint("10", 1)
    parseint("10", 2)
  • 3
    parseInt(value, (keyof value) as radix)

    @jespersh faster :(
  • 4
    If I recall correctly then you're suppose to use Number instead of Parseint
  • 2
    @jspersh this is just a joke, nothing serious
  • 5
    @zombieleet I only explained it those wondering why. I didn't comment on the jokeness
  • 2
    @zombieleet well the original idea had potential and you fucked up the delivery, It happens.
    Better luck next time.
  • 2
    @jespersh thank you for the explanation.

    @mlask you've gotta admit that pretty fucked. documentation is important, but so is reading code and intuively knowing without documentation, what it does.

    that code looks like it should work. the fact it doesn't is a serious design problem imo.
  • 7
    @deadPix3l it’s not a UI, programmers are supposed to read how to use the tool before using it
  • 2
    Well, in hindsight it's obvious... but that sure had me wondering.

    I knew about parseInt's radix but forgot about map also supplying index and array to the callback.

    I agree that surprises are generally bad but I guess I lack the perspective to be horrified when a callback doesn't need to be passed its arguments explicitly.
  • 4
    @deadPix3l A more serious design problem would be crippling this retarded and lovable language even more because one person didn't RTFM for a language that has, like, the lowest barrier to entry ever.
  • 1
    @devTea I agree. reading the documentation is super important. but you can't expect every single person to read every single line of the docs before they write code. I program in several languages, so if I'm made aware that map() is available, I might not read all the ins and outs and each parameter. I have a pretty good understanding of of what I expect map to achieve. and that violation of expectations is a design flaw if you ask me.
  • 1
    @ihatecomputers low barrier of entry? JavaScript is not only filled with so many inconsistencies on its own, but enough misinformation and Vue/react/bootstrap/jquery/prototype/mootools/(I could literally do this all day) questions marked only under the generic "JavaScript"

    then we come to ecmascript. what's the difference? I don't think there is but this ES6 thing has me thinking I'm wrong.

    then node which is making a web language into a system language. but then electron which does seemingly the same thing? and typescript which I believe just transpiles into unreadable, generated JavaScript.

    and finally, breakdowns of expectations that adding a string to an int will require explicit casting, NaN is a number, and all the other things JavaScript is known for in memes.

    JavaScript and nodeJS has maybe one of the highest barriers to entry of any language i ever seen (excluding ASM and joke languages like brainfuck, both of which I willingly use before I would touch JS)
  • 4
    @deadPix3l that will just make every language is similar to each other, C uses 0 and 1 for true and false, and I think read somewhere that not every language uses this commonly

    I don’t think there is any rule for programming language to copy each other just so everyone can understand easily
  • 0
    Honestly JavaScript is the only language where people routinely get told to read the specification in order to use it. Also it's the only language I know of where something ambiguous like this isn't an error
  • 0
    @M3m35terJ05h which is kind of a redundant statement, right?
Your Job Suck?
Get a Better Job
Add Comment