• 0 Posts
  • 9 Comments
Joined 1 year ago
cake
Cake day: July 9th, 2023

help-circle



  • People creating functions as objects inside of other functions. A few days ago saw a person create a function with two object functions inside, then passed one of the functions as an argument to the other function. Then returned the second function.

    It’s hard to find such a mess in other languages. Yeha, functions as objects are cool. Closures are also cool… But why abuse that shit?


  • pazukaza@lemmy.ml
    cake
    toProgrammer Humor@lemmy.mlProgramming Languages
    link
    fedilink
    arrow-up
    0
    arrow-down
    1
    ·
    1 year ago

    Come on, Javascript is pretty nasty. Trying to read that shit always gives me brain tumors. Why do they need to wrap every fucking thing in a function inside a function inside a function that is passed as a parameter to a function inside another function?

    Like, bro, you know people are meant to understand what you just wrote?

    It just gives too much freedom and people forget they need to write code that is easy to read for people who aren’t totally familiar with the code base.

    They even bring that shit into typescript. Like they are already using a language that is meant to fix that shit and they are like, nope, let me create 5 nested functions just because.




  • Actual question. Isn’t installing stuff from third party repos like super dangerous? The package scripts run with root access, right?

    So, I guess you could tell if the hash of the package matches the hash of the code after you build it… But, what about upgrades on that package after it is installed? They could change the setup scripts and screw a lot of people right?

    Not saying these guys do it, just wondering about security stuff.