News for hackers. Stuff that matters.
Re:In spite of an increase in Internet speed, webpage speeds... by azangru on Tuesday August 04, 2020 @06:24PM (#24055150)
> with some simple jquery

Plain javascript, if you want to go down that route. Jquery is around 30kb of javascript, if I remember correctly.

> but that's not cool and not good on your resume

On the contrary, writing vanilla js is pretty cool and impressive on the resume, when every other developer puts react there; but it's pretty miserable too, compared to using frameworks.

Re:In spite of an increase in Internet speed, webpage speeds... by bob1029 on Tuesday August 04, 2020 @06:29PM (#24055193)
If I see the words "vanilla JS" or "SQLite" on a resume, I will automatically place it into my maybe pile.
Re:In spite of an increase in Internet speed, webpage speeds... by ant6n on Tuesday August 04, 2020 @06:33PM (#24055218)
Is that a good or bad thing?
Re:In spite of an increase in Internet speed, webpage speeds... by bob1029 on Tuesday August 04, 2020 @06:48PM (#24055335)
Yes, its basically a shortcut when I am doing a quick first scan through resumes. The moment I see one of those keywords I will flag it for 2nd pass review and move on.
Re:In spite of an increase in Internet speed, webpage speeds... by asddubs on Tuesday August 04, 2020 @07:08PM (#24055487)
I'll bring some demos of my snowflake animations and cartoon character gifs that follow the cursor around to the interview

I actually quite like writing vanilla js in my spare time, but I can never tell if I'm doing everything horribly wrong or not

Re:In spite of an increase in Internet speed, webpage speeds... by bob1029 on Tuesday August 04, 2020 @07:52PM (#24055786)
As long as it makes sense when you read it after a few days (i.e. its well organized) and it also works as expected, then you are probably doing well.

Javascript is actually incredibly fast on most devices, especially if you are constraining yourself to the vanilla API and not something like jQuery. Remember, every web browser's JS engine has been hyper-optimized to support decades of half-assed website implementations.

It's really hard to screw up perf on document.getElementById(). There's honestly not a whole lot of ways to hang yourself with the vanilla methods unless you are trying to build something ridiculous like a raytracer or physics engine.

Re:In spite of an increase in Internet speed, webpage speeds... by asddubs on Wednesday August 05, 2020 @09:27AM (#24060507)
i think the biggest thing for your average app is just causing a lot of layout repaints. as long as you spam requestanimationframe everywhere and group style changes and polling, you'll be good. I was really surprised how good I was able to get things on even an ancient ipad 2 I had laying around
Re:In spite of an increase in Internet speed, webpage speeds... by azangru on Tuesday August 04, 2020 @09:01PM (#24056196)
> document.getElementById()

Can we at least do document.querySelector? Pretty please? :-)

Re:In spite of an increase in Internet speed, webpage speeds... by snet0 on Wednesday August 05, 2020 @12:58PM (#24062981)
Just use the 1 line jQuery:

const $ = document.querySelector.bind(document)

Re:In spite of an increase in Internet speed, webpage speeds... by abhishekjha on Friday August 07, 2020 @03:27AM (#24079286)
What does it do?
Re:In spite of an increase in Internet speed, webpage speeds... by aryonoco on Tuesday August 04, 2020 @06:40PM (#24055283)
Vanilla JS is pretty cool. Eleventy is even cooler, it gets you most of the things a framework gets you, but gets compiled to fast, vanilla JS and that's what served to the browser.

Svelte/Sapper also has a lot of potential as it only ships the parts if the framework that are absolutely needed instead of the whole thing.

But in reality, you can make plenty of very fast React sites and plenty of slow vanilla JS sites.

Re:In spite of an increase in Internet speed, webpage speeds... by j-krieger on Tuesday August 04, 2020 @06:51PM (#24055356)
Any modern JS Framework gets compiled to vanilla JS. That‘s exactly the problem: Because Browsers don‘t implement ES6+ Syntax natively, it has to get compiled to complicated, long winded ES5 or filled by heavy polyfills. If browsers were all spec compliant, code bundles would be way smaller.
Re:In spite of an increase in Internet speed, webpage speeds... by azangru on Tuesday August 04, 2020 @07:21PM (#24055563)
> Because Browsers don‘t implement ES6+ Syntax natively

Erm what? What browsers are you talking about now?

Re:In spite of an increase in Internet speed, webpage speeds... by IggleSniggle on Tuesday August 04, 2020 @08:39PM (#24056042)
This almost certainly means Internet Explorer, if they’re only referring to ES6. But honestly I love all the feature since then. It’s actually difficult for me to imagine not using TypeScript these days, let alone not having access to asynchronous/await or async iterables, plus all the tiny little syntax improvements it’s easy to take for granted like Array.includes()
Re:In spite of an increase in Internet speed, webpage speeds... by duckmysick on Thursday August 06, 2020 @05:58AM (#24069554)
Old Android browsers, UC Browser.
Re:In spite of an increase in Internet speed, webpage speeds... by wnevets on Tuesday August 04, 2020 @10:13PM (#24056625)
Feel free to replace jQuery with regular JavaScript in my post.