40
Yvan
6y

Maybe it's time to stop jQuery being lazy and start using vanilla JS like a pro!

Comments
  • 1
    @1989 I am shitty at JavaScript myself, but I see this as a practice challenge!
  • 2
    Your code will be longer, and less readable. Unless it's a speed dependent thing I don't think it's worth it (my last two js things involved a lot of svg, canvas and animation and needed to be lightning fast so I went full vanillat there)
  • 1
    I think avoiding dependencies where possible is a good goal, but those dependencies exist for a reason... It's a balance between speed/readability.
  • 5
  • 1
    @ArtNo yes I did while I was sleeping, I used that framework.
  • 0
    NO!
  • 1
    @1989 could not have said that better myself. To op, just use whatever you want man. But I must say, it is a good experiment in getting good with basic JS
  • 2
    I wish more people appreciated vanilla JS. It's such a strange creature, but people are too lazy to type a few extra words and just hit up jQuery like it's not just JS with shortcuts.
  • 1
    @nbamaral learning vanilla JS is good just because there will be times jQuery isn't feasible or necessary, and you'd look pretty silly not being able to do basic tasks without a massive helper library
  • 1
    @Crazed
    You're right, everyone should know the vanilla syntax, dom selectors, events and even object inheritance before even learning jquery (SO doesn't help, most answers are jquery anyway) - browsers are compliant enough now (that was the need for something like jquery was written for).
    I already know more of javascript than I want to 😄, I'll use vanilla when appropriate, jquery when it's sufficient (hell more readable an year later).
    Can't say I miss the times you started by checking for "layers" (netscape) or had to use too different ways to hide things 😄
  • 1
    @nbamaral I learned jQuery first like a pleb and got frustrated when I realized I should have learned JS first lol. Def know more JS now than jQuery, but DOM selection and manipulation in jQuery is convenient.
  • 2
    Today, when there’s native querySelector in vanilla JS, there’s no need for jQuery. Just ask on StackOverflow how to do something in JS and... whoa, jQuery everywhere, people once again forgets the roots...
  • 0
    @mlask exactly...
  • 0
    @mlask but $('#thing') is shorter than document.querySelector('#thing') so obviously jQuery is a superior language

    /s
  • 0
    @Crazed and I always thought, that longer is better and the technique matters ;)
  • 0
    @mlask const truth = Hunnies.love.apply(JSDev, ['all']);

    alert(truth); 😥
  • 0
    @mlask
    But the roots were shaky 😄
    I lived through the hell of netscape 4 vs ie 5 vs ie 5.5 vs opera days (yes I'm old).
    So jquery was a godsend until it all got compliant and coherent.
    In a sense js is catching up with jquery (not the fault of the language itself but mostly the different implementations by vendors).
  • 0
    jQuery is efficient.
  • 0
  • 1
    Seems interesting @Cyanide I will check it out!
  • 1
    Just think from the perspective of the people who suck at frontend (me). Without jQuery I wouldn't even be able to do some small tasks that a backend engineer has to do
  • 0
    I hate doing frond-end, having knowledge about JS sometimes also are pre or must haves at some companies. @arpit1997
  • 1
    @Yvan yeah yeah I know. I know backend side js aka node.js so I am quite on safe side but its the frontend side js that bugs me
Add Comment