14

Hey, senior developers, is there a reason for this?
I just can't believe it.
The line that makes me wanna kill is the
$("#" + id).val(val);

Taken from a very profesional site.

Comments
  • 0
    Are the pixelated images an account setting or what?
  • 4
    Nope, devrants compression algo
  • 13
    The moment you see jQuery on a website in 2020, you already know it's age-old legacy, or stupid moron shit. Or even both at the same time.
  • 2
    @c3r38r170 been a long time since I've played with jQuery but unless I'm mistaken the function copies the value from an input to another (visible to hidden).

    IMHO, from the most offensive to the least:
    * The global line 2
    * The fact that first input value should be obtained from the event and therefore from the function argument, dropping line 3 altogether.
    * getting the second input's id instead of the input itself, allowing to chain with a set and dropping line 4 as well.

    Thoughts?
  • 0
  • 7
    I'm more annoyed by:

    DDLID = ddlId;
  • 2
    It is false to believe “professional == good”. At most I will give you is “professional == paid” but even that is iffy now.
  • 2
    `#${id}` YOU HAPPY NOW MR CRABS
  • 0
    @Commodore Thank you so so much for the carbon.now.sh link. (Although I wouldn't reproduce this specific code piece myself in order to share it.)
Add Comment