DEV Community

Cover image for Top 5 DEV Comments from the Past Week
Peter Kim Frank for The DEV Team

Posted on

Top 5 DEV Comments from the Past Week

This is a weekly roundup of awesome DEV comments that you may have missed. You are welcome and encouraged to boost posts and comments yourself using the #bestofdev tag.

In response to Regex Cheat Sheet, @bkichler shared a positive comment and offered a link to another great RegEx resource:

I go cross-eyed dealing with regex, but this is an excellent reference I'm definitely coming back to. I almost always head to regex101.com whenever pattern-matching starts to devour my brain.

After reading Load Pages Instantly with instant.page, @solkimicreb very respectfully offered some additional context and a recommendation in response to the post. These sorts of exchanges are incredibly valuable for everyone involved:

I see this repo frequently nowadays and I feel like I have to go a bit against it. Sorry. 😕

TLDR: This goes nicely with some server rendered and static pages but not so nicely with SPAs.

Prefetching is an amazing tool but it is meant to be used selectively, in context-specific use cases. Making all links into a prefetch one is not a good idea, if it would be the browser devs would have done that instead of giving us an API.

This does prefetch pages on hover but prefetching a page only involves fetching the entry point (index.html), it does not fetch secondary resources. A lot of modern pages have tiny index.html files and huge secondary bundles (JS and CSS). In this case prefetching has no impact and server push or a PWA could be utilized better.

Most SPA routers use 'fake' a tags (with prevented default event handling) under the hood for client-side routing. This is done to combine the best parts new-school and old-school routing - like keeping the right-click 'Open in new tab' functionality. Prefetching on hover events over these 'fake' a tags will simply fetch your SPAs index.html once more. This is just added network traffic with zero value.

There are so much more that can be prefetched, apart from links and whole pages. Just always pay attention when you add a new resource and decide if it benefits from prefetching. It is usually not a big overhead.

I think this is a witty idea and the code looks very clean though. Also props for raising awareness regarding the newish prefetch capability!

EDIT: I wrote this based on my personal experience, without getting into the spec. Please correct me if I mentioned something incorrect.

Short and sweet, @nektro offered a recommendation in response to What are some Browser plugins that you can't live without ?:

All browsers should come pre-installed with uBlock Origin.

In a wonderful article, 6 Mistakes You Might Be Making As A New Web Developer & How To Avoid Them, @hamatti selected one point where their opinion differed. It led to a productive discussion, and even an update to the original post!

Great post!

I do disagree with this however

But one of the biggest mistakes most beginner developers make is jumping straight into learning these tools without a strong understanding of JavaScript.

There are different approaches to learning. I started from a very theoretical point of view and wanted to have good base understanding before moving forward. I ended up not building a lot of things because there was always so much to learn.

My suggestion for any beginner developer or junior is just to build things. Don't worry about tools, don't worry about making things perfect. Just build things. When you do, you'll learn about all sorts of things related to software development. It also makes it easier to understand the core things of Javascript because you have something to relate that knowledge to.

I tried to understand the this weirdness in Javascript for a long time. Finally after I had a lot of experience with building things without fully understanding it and encountering the issues first hand, it was much easier to understand how it works.

So I would say that both approaches are fine for a beginner developer, it all depends on what's the best way for you to learn.

Finally, @shoupn answered After you start a new job as a software developer/engineer, how long it took before you feel you are very productive? by talking about the ramp-up time involved in most jobs:

Comment Not Found

See you next week for more great comments ✌

Top comments (2)

Collapse
 
peter profile image
Peter Kim Frank

Congrats to @bkichler , @solkimicreb , @nektro , @hamatti , and @shoupn for making the list this week!

Collapse
 
nektro profile image
Meghan (she/her)

Surfing the 'net can be dangerous! Thanks for putting me on the Fab 5! 🤯😊