6
Drogooo
4y

Bruhhh why you use random single character in your variable names in javascript src code? Do you have uglifier installed in your brain?

Comments
  • 0
    And a bit of Pascal for magic!
  • 1
    “Uglifier” 😂
  • 3
    @Cyanide there is actually a program for JS sources named uglifier which compresses the source by reducing unnecessary spacing and names.

    TBH, I don't get why websites don't use any sort of compression instead. Like, even the simplest zip compression would do marvels for plaintext
  • 3
    @iiii uhm. They do? Like GZIP / Brotli / ...
  • 0
    @IntrusionCM then why do they use the minimizers then? It's pointless with compression.
  • 0
    @24th-Dragon same question
  • 1
    @iiii not really.

    Pointless is just the way most of web development takes place.

    Thanks to the "super duper" assemble all trash from the universe JS (node/yarn...) most of uglify was to parse and reduce the JS / CSS .... to a less fuckity size.

    Some uglifiers go so far and rewrite the JS to remove unneeded code.

    Many deployments in web development have - when everything's "linked" together - more than 100 MB in size.

    The reduction might seem pointless, but it has its purpose... Thanks to the pointless way of developing
  • 0
    @IntrusionCM I see... But why uglify to such extent that it makes code basically obfuscated?
  • 0
    @iiii because every bit counts. I guess you have never seen an full node dependency tree of a large web application?
  • 0
    @IntrusionCM luckily, no. I have a vow to never ever go into web dev or at least never touch anything related to Javascript: frontend and Node.js backend.
  • 1
    I use single letter var names. other devs understand certain single variable names like i, j, k, x, y, z, a, b, c etc. Esp when using functional programming primitives in JS.
  • 1
    @justamuslimguy i and n is ok, k and v is ok when obj [k] = v , xyz for three dimensions but a,b,c? come on bro. go two letters
  • 1
    @melezorus34 meh, if the variable needs to be described I'll be descriptive, but there's nothing wrong with arr.sort((a,b) => a.count < b.count ? 1 : -1)
  • 1
    @justamuslimguy l and r for left and right?
  • 1
    @melezorus34 that works too. I'm just saying there's a lot of times that it's more expressive to have small variables because the focus is on manipulating any type of data, not necessarily focus on what exactly the data is.
  • 2
    @justamuslimguy I'm not judging, I'm just trying to help you a week after trying to read your code 😂
  • 1
    @iii is it really pointless?

    Also what do you mean random character? like for fish1 fish2 etc.. they use fishB fishH etc.. ?
  • 1
    @lopu they replace every variable name and function name with a single character if possible.
Add Comment