all 18 comments

[–]m68k 6 insightful - 3 fun6 insightful - 2 fun7 insightful - 3 fun -  (0 children)

I see => as "equals or greater than". Me being someone who programed in assembly, C and BASIC, JS doesn't seem to be something I'd want to learn anytime soon. :P

[–]trident765 4 insightful - 2 fun4 insightful - 1 fun5 insightful - 2 fun -  (5 children)

Modern scum seem to derive extreme pleasure from being presented with features that have a very narrow set of applications. The second way may save a few characters of typing in one of the rare cases where the function only needs to be one line, which I imagine is why modern scum love it. They like the idea that there is a designated feature for writing one-line functions.

[–][deleted]  (4 children)

[deleted]

    [–]fschmidt[S] 4 insightful - 2 fun4 insightful - 1 fun5 insightful - 2 fun -  (0 children)

    I missed this and I want to respond to it. First, Javascript is not used primarily as a functional language. Javascript's functions aren't really functions, they are closures. The difference is that closures have state while functional languages are stateless. I would describe Javascript as a table/closure language like Lua and my Luan. Javascript "objects" are misnamed and are really tables (maps). Javascript's object-oriented features have always been a grotesque hack.

    If I want to sum an array in Luan:

    local sum = 0
    for _, v in ipairs(a) do sum = sum + v end
    

    More verbose than:

    local sum = reduce( a, function(x,y) return x+y end )
    

    But the first is clearer to me and is more efficient.

    I haven't followed tech ideas in about 20 year since they are all crap, but I do hear mentions of this asych stuff which I assume is some glorified map-reduce. Anyway, there is no valid reason to handle DB requests this way, they should just be done sequentially (in a civilized multi-threaded language). There are valid use cases for map-reduce like gathering a lot of HTTP requests, but this is rare and so this should be as verbose as possible to make clear what is happening.

    [–][deleted]  (2 children)

    [deleted]

      [–]trident765 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (1 child)

      The functions should just be given names and then async.parallel can be called in a single line.

      [–][deleted] 3 insightful - 3 fun3 insightful - 2 fun4 insightful - 3 fun -  (1 child)

      It's those python mfers, trying to make everything a goddamn one liner

      [–]jamesK_3rd 3 insightful - 2 fun3 insightful - 1 fun4 insightful - 2 fun -  (0 children)

      Bingo.

      [–]IMissPorn 3 insightful - 2 fun3 insightful - 1 fun4 insightful - 2 fun -  (0 children)

      Weird. Super compact syntax has its place I guess, but I'd have thought it more relevant for shell scripts and the like. I'm not sure why you need in JavaScript.

      Edit: Actually I thought of a use-case. This might come in handy when you're embedding malicious code in sneaky places and every byte counts.

      [–]zyxzevn 3 insightful - 2 fun3 insightful - 1 fun4 insightful - 2 fun -  (1 child)

      Those ideas come from PhDs who think that Haskell is a good language.
      And thus they make it more difficult for people who actually make commercial products.

      [–][deleted] 2 insightful - 2 fun2 insightful - 1 fun3 insightful - 2 fun -  (0 children)

      This is nothing haskell-like. First of all, haskell doesn't have comma-parameterized arguments, and secondly, haskell has separate declarations for a function type and the function definition. Sure, haskell-esque syntax is very confusing and a bit high-minded, but this is not remotely similar nor something a haskell dev would suggest at all.

      Also, haskell is an awesome language, lol.

      [–]package 3 insightful - 2 fun3 insightful - 1 fun4 insightful - 2 fun -  (0 children)

      You legit have to be some kind of barely functioning drooling mongoloid retard to complain about modern javascript vs old javascript of all things. Concise, expressive syntax along with more reasonable scoping behavior have turned a truly horrible and irredeemable dumpster fire into a very usable and useful language.

      [–]SoCo 2 insightful - 3 fun2 insightful - 2 fun3 insightful - 3 fun -  (0 children)

      If this irks you, don't peek at the direction Python has been going...

      [–][deleted] 2 insightful - 2 fun2 insightful - 1 fun3 insightful - 2 fun -  (0 children)

      I don't disagree. They are one step away from ML, like let add a b = a+b but chose to just take the let keyword and forget the nice syntax.

      [–]ID10T 2 insightful - 2 fun2 insightful - 1 fun3 insightful - 2 fun -  (2 children)

      The second one liner is more readable. Don't let yourself get stuck in the past. Don't get comfortable with your current skill set. If you want to stay relevant in this industry you will need to constantly be learning. Else you become a dinosaur and eventually unemployable.

      [–][deleted]  (1 child)

      [removed]

        [–]ID10T 2 insightful - 2 fun2 insightful - 1 fun3 insightful - 2 fun -  (0 children)

        Lol ok cool

        [–][deleted] 2 insightful - 1 fun2 insightful - 0 fun3 insightful - 1 fun -  (1 child)

        Did you try flutter ?

        It's script-able in dart. I only do back-end(: "databases", encryption and "automatizing") , so i myself don't give a fuck about dart itself.

        But some colleagues of mine seem to value it highly when i hear them talking about it, although it surely is just another google-scam.

        So there has to be something to it, i suppose.

        [–][deleted] 4 insightful - 2 fun4 insightful - 1 fun5 insightful - 2 fun -  (0 children)

        I have done application development in flutter, it isnt really a great option for web yet. Its a composable object-oriented framework using widgets, rather than html/css. The benefit of Flutter is one team can do the all the dev work. You don't need separate ios/android/desktop implementations, and the backend and frontend are even often done together in one codebase.

        Personally I like Flutter for apps for one reason: its cross platform and doesnt require javascript, which is an abomination, but flutter is really janky for web. Im hoping WASM will someday be a feasible replacement