News for hackers. Stuff that matters.
Re:Ask HN: What are these low quality “code snippet” sites? by bbarn on Wednesday December 01, 2021 @01:37PM (#29407398)
I've seen several developers google "w3schools someDomEvent" because they are conditioned by those search results. Has it accidentally become a halfway useful site?
Re:Ask HN: What are these low quality “code snippet” sites? by kilburn on Wednesday December 01, 2021 @02:49PM (#29408298)
> Has it accidentally become a halfway useful site?

It has. It is nowhere near the quality of MDN, but also nowhere nearly as bad as it used to be.

W3Schools has less information than MDN. This is bad for the experienced, but a relief for people who are entering the trade.

As an example, consider an inexperienced web developer that wants to do something when a button is clicked. They google for it and find these two pages:

- https://www.w3schools.com/jsref/event_onclick.asp . Right there in the middle of the page is an example snippet that will get the job done. If I scroll down I see other ways to do it, all of them fully contained (i.e.: I can copy-paste it to some website and they will work).

- https://developer.mozilla.org/en-US/docs/Web/API/Element/cli... . There's a table of things I don't understand (Bubbles? Cancellable?), two lengthy discussions about weird edge cases in some browsers, and (finally!) a single not-so-simple example that is not even enclosed in <script> tags.

What website do you think they'll pick?

Re:Ask HN: What are these low quality “code snippet” sites? by valenaut on Wednesday December 01, 2021 @01:41PM (#29407449)
It's fine for simple things. I referenced it a lot when I was first learning JS and HTML because it was usually at the top of Google results. I think MDN is strictly better.
Re:Ask HN: What are these low quality “code snippet” sites? by vlunkr on Wednesday December 01, 2021 @02:39PM (#29408188)
IMO it is a legitimately useful site, but strictly for beginners, and probably only for html/css. It teaches you the basics and has the sandbox to test things out. It's fine, just not what you want to see when you're looking for actual documentation.
Re:Ask HN: What are these low quality “code snippet” sites? by myohmy on Wednesday December 01, 2021 @02:50PM (#29408303)
I used it to learn CSS way back in the day and it still seems to be a good balance between too little and too much for the beginner, so I still send my newbies there.

Not surprised it shows higher than the actual spec. I think the HN community is just getting to the greybeard stage (I'm still cutting out grays), and this is our version of JUST READ THE MAN FILE

Re:Ask HN: What are these low quality “code snippet” sites? by blahyawnblah on Wednesday December 01, 2021 @04:59PM (#29409673)
I do the same, but with "mdn" instead of "w3schools"
Re:Ask HN: What are these low quality “code snippet” sites? by 5e92cb50239222b on Wednesday December 01, 2021 @02:15PM (#29407891)
Are you positive the first term wasn't prefixed by a hyphen-minus?