top | item 14504604

The future of MDN: a focus on web docs

294 points| paublyrne | 8 years ago |blog.mozilla.org | reply

108 comments

order
[+] mxuribe|8 years ago|reply
Yeah for this statement, "...often Web developers are looking for quick examples...", I don't even care if the examples are higher up on the page or not...I just would like more and more examples. Sometimes the examples are too few or don't fully exemplify options of particular functions, etc. Nevertheless, I'm absolutely grateful to all the folks who put in so much work into MDN. If you are one of those people, know that I thank YOU!
[+] cx1000|8 years ago|reply
This is one of the only reasons I sometimes end up back at w3schools after reading the mdn docs: when I'm looking for a quick, working, live example. A short example is worth a thousand words.
[+] stdgy|8 years ago|reply
Yeah, it's a great resource. I'd love to see more examples as well. Bonus points if the examples are runnable and extra-bonus points if there's a 'debugger' version that would let the user jump into a portion of the code to examine the state.

I find one of the first things I do when approaching non-trivial new features is to sketch out an example and then step through the example by adding a few strategically placed breakpoints. The breakpoints allow me to examine both the execution flow and the internal state of the various objects associated with the new feature.

Both Chrome and FF support the handy 'debugger' statement, which you can place directly in your code and which acts as a breakpoint when you run the code with devtools open.

Edit: Apparently the debugger statement is standardized! Neat. Didn't realize that. Thanks MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

[+] bastawhiz|8 years ago|reply
> I just would like more and more examples.

I'd like relevant examples. It's incredibly frustrating to look at an MDN snippet to see code that no sane human would ever write. Self-executing closures that return callbacks inside for-in loops, initialization code that still checks readyState, code that avoids more than one function for no obvious reason...MDN can be a real crap-shoot. Hell, I'd be happy if they would name their variables sensible things instead of trash like `numFoo`.

[+] b0rsuk|8 years ago|reply
Certainly there's room for more examples. Having to choose between often abstract MDN and the opposite - often zero theory Stack Overflow - is awful. I've learned to take SO with a dose of salt - you may pick up bad practices (especially for rare problems), outdated solutions etc.
[+] hobarrera|8 years ago|reply
> Sometimes the examples are too few or don't fully exemplify options of particular functions

TBH, that's why actual documentation is there. Examples can never really cover everything something can [or cannot] do.

[+] westoque|8 years ago|reply
I just wish they had better SEO than say W3Schools
[+] savanaly|8 years ago|reply
I've just had to get into the habit of appending mdn to all my web development queries to make it show up at the top. Can't count the number of time's I've done the search "[some new array method] mdn". Invaluable website.
[+] vog|8 years ago|reply
Same for RFCs.

Let's search for "rfc 1855". The first item is indeed the original plain text source, unfortunately without links or anything:

- https://www.ietf.org/rfc/rfc1855.txt

But the second hit is a third-party source, that doesn't provide much over the plain text version. It doesn't even contain the RFC contents directly. I can't imagine anyone seriously linked to that page, let alone that so many are doing it to push it to the second place:

- https://www.rfc-editor.org/info/rfc1855 ... wtf?!

Moreover, the RFC authors group itself, the IETF, already provides a beautiful HTML representation, with links and everything:

- https://tools.ietf.org/html/rfc1855

But you won't find that in the first 10 hits. Not even in the first 50 hits, for that matter. You will find it, however, if you click at the third item, which is the corresponding Wikipedia entry:

- https://en.wikipedia.org/wiki/Etiquette_in_technology

The very first item in the "External links" section points to tools.ietf.org.

Given the prominent low-quality links to w3schools, rfc-editor and so on, I'm asking myself if Google is actively harming Mozilla and IETF. Maybe not harming, but being ignorant. These issues are known for years. If they want to be the best possible search engine, why don't they do anything about these widely known issues? I understand that they'd rather fix their algorithms than adding special rules for IETF, but then, they should have analyzed their algorithms how they can be tricked by low-quality sites. And fix that. Meanwhile, years have passed and nothing changed.

Maybe we should introduce a new search engine:

"Second-Order Wikipedia"

It would work like this:

1. Look up the search terms in Wikipedia articles

2. For each hit, show the Links of all articles' "External Links" sections.

[+] roselan|8 years ago|reply
I installed "Personal Blocklist" extension exclusively for w3schools...
[+] randallsquared|8 years ago|reply
Me, too. However, if your opinion on W3Schools is from ten years ago when they were sketchy and misleading, it may interest you to know that it's much better now. I don't reflexively hit the back button when I land there from a search, now -- sometimes the info I'm looking for is actually there. ;)
[+] Kiro|8 years ago|reply
Am I the only one who prefers W3Schools over MDN? It's much less cluttered and immediately gives me the example usage I'm looking for.
[+] ungzd|8 years ago|reply
It already appears usually in higher positions than w3schools in Google, at least for me.
[+] parthdesai|8 years ago|reply
i just add mdn at the end of my query.
[+] lucb1e|8 years ago|reply
Depending on the topic, I often get MDN above w3schools. And adding mdn is not much of a bother.
[+] microcolonel|8 years ago|reply
They show up pretty high on DuckDuckGo. I think W3Fools has more traffic and more hyperlinks from the DHTML years.
[+] natmaster|8 years ago|reply
Google sucks and you're complaining to Mozilla? I can't believe people have become so complacent with search they will start blaming great content on the internet for being hidden by shitty algorithms.
[+] alunchbox|8 years ago|reply
A small feature in chrome you might like, there is a quick write up about it at the link listed below. Basically configure the URL search bar for MDN to be a searchable website. Change the keyword from the full Mozilla link into something simple like mdn. Then simply when searching in the url instead of going to google.ca just type 'mdn' and space then it will use the configuration of the search query to look inside the website so something like looking to see how Array.protoype.map() works just type mdn space before that and you'll go straight to the search results.

This isn't limited to just MDN you can use it for Youtube, and other sites that support the query search string.

If you are having trouble finding the settings in Chrome to get to then simply

hit the 3 dots on the top right > settings > then at the top bar search for 'search' > Under the Search heading there will be a button labeled 'Manage Search Engines' click it > and read the article to see how to set it up.

If you have visited MDN before it will show up in the lower section. All you need to do is change the middle text box to mdn and save. otherwise the last box will need to be https://developer.mozilla.org/en-US/search?q=%s&w=3&qs=plugi... the first box is just a label used to display the search name you can leave it at default.

happy searchin!

https://www.wired.com/2013/09/h2-chrome-omnibox/

[+] mbel|8 years ago|reply
Firefox has the same feature. To use it right click on any search box on any website you visit to assign it a keyword. This works great with vimperator, which has tab-completion for search keywords.
[+] ripdog|8 years ago|reply
Or use DuckDuckGo as your search engine, and you get thousands of those quick searches for free.

You can use !g for google, !a for amazon, !mdn for MDN, !so for Stack Overflow, etc etc. If you want to search an even vaugely popular site, you can probably just type !domain and DDG will search it.

https://ddg.gg

[+] flanbiscuit|8 years ago|reply
I have found doing this unnecessary (for me) because just searching for "mdn whatever" in google gets me the MDN results I wanted as the top result with the rest of the page being populated by other related MDN results.

Not saying that people shouldn't do it. Just offering a possible simpler alternative to be tested as well

[+] md224|8 years ago|reply
I don't remember who built it, but MDN.io is a neat little tool that allows you to quickly jump to the MDN docs for a given topic.

For example: http://mdn.io/flexbox

Admittedly, I don't use it, but cool that it exists!

[+] alistproducer2|8 years ago|reply
I always tell my co-workers that MDN is the de-facto documentation for JavaScript. Whenever asking a JS question, they almost always ask me to look at some crap W3Schools article. The first thing I do is always check MDN first.
[+] toxican|8 years ago|reply
Any extra love and attention given to what I'd consider to be one of the greatest resources out there for web developers is great news to me.
[+] WA|8 years ago|reply
Only one thing I care about: for Gods sake, remember my language preference in a cookie. No, I don't want to read incomplete docs in German. My English reading capabilities are just fine. And I certainly don't want to change the language every day when I revisit. Thanks
[+] scotu|8 years ago|reply
as a workaround, if it's ok for you to have most of the web in english, you can change the preferred language in the browser settings: you put english first and then lower priority german. I'm not sure it will work in mdn, I tried it quickly and seemed to work
[+] klez|8 years ago|reply
I'd guess they could have kept the acronym to mean Mozilla Documentation Nexus.
[+] smitherfield|8 years ago|reply
I mean, they could've kept it "Mozilla Developer Network" — it's not like that doesn't sound like an online documentation resource (c.f. Microsoft Developer Network). I guess there's some ambiguity with e.g. a meetup group, but it should be obvious from context.

It's possible the name change is for SEO reasons. Although they shouldn't need to; Google really ought to swallow their competitive pride and make MDN one of their previewed snippet sources, or else create their own webdev documentation source of equal or better quality.

[+] sgentle|8 years ago|reply
One thing I think could really make a difference would be wrangling the reference data into some kind of semi-structured format with an API/machine readable format like the Node docs: https://nodejs.org/api/events.json

There are a lot of documentation, code completion etc type things out there that currently rely on manual updating (eg Tern.js) or scraping (eg devdocs.io) to maintain this kind of data. It'd be good if there was a canonical source.

[+] fiatjaf|8 years ago|reply
Please stop forcing those stupid horrible-quality Portuguese translations upon me!
[+] cosinetau|8 years ago|reply
I love the resiliency of Mozilla. It seems like most news about it and Firefox are are doom and gloom, especially when we're comparing Firefox to Chrome.

So what does Mozilla do? Make their great documentation even better, and enrich the development community.

These choices by the Mozilla foundation might be unrelated. However, if things go south, I hope the community remembers who is consistently advocating for it.

[+] Etheryte|8 years ago|reply
One thing that would be brilliant and would also help with numerous other issues would be if the site was open source and available on Github.

This change would allow numerous improvements such as up-to-date, relevant examples, issues and pull requests for discussions and improvement etc.

[+] klez|8 years ago|reply
MDN is a wiki, so you can in fact fix problems you find.

Discussion is done via mailing list.

[+] nashashmi|8 years ago|reply
By the way, whatever happened to real web doc formats being established, like something that could one day make obsolete Ms word addin and PDF.
[+] kellengreen|8 years ago|reply
Keep up the great work MDN! You're truly a life saver.
[+] amelius|8 years ago|reply
Can we please have a comments section on every page of documentation?
[+] goldfire|8 years ago|reply
MSDN has this, and I have never seen a comment there that actually provided value to a reader of the page. It makes even less sense on MDN, because MDN is a wiki; if you think something is missing, you can get it added.
[+] Etheryte|8 years ago|reply
While the idea seems great in theory, I doubt Mozilla has the manpower to moderate it. The volume of comments would be astonishing, think Stack Overflow's Javascript tag – there are countless questions that have been answered time and again. Sorting and moderating them takes an insane amount of man-hours.
[+] callahad|8 years ago|reply
MDN is a wiki. If something is wrong or could be improved, you're empowered to fix it directly. :)
[+] Already__Taken|8 years ago|reply
I don't know why this was done years ago instead of that web platform push.
[+] opendomain|8 years ago|reply
The Web Platform was a great idea and had Adobe, Apple, Facebook, Google, HP, Intel, Microsoft, Mozilla, Nokia, Opera, and the W3C as stewards.

Unfortunately, it may have been politics between some of the companies that prevented a real success.

The good news is that we will revive the web platform on WebPlatform.Com as part of OpenDomain - anyone that wants to participate is welcome!

[+] niutech|8 years ago|reply
There is [edit: was] also a community-driven alternative to MDN: https://webplatform.github.io/docs/
[+] peternicky|8 years ago|reply
Discontinued in 2015. Why would you recommend anyone use that site?
[+] klez|8 years ago|reply
MDN is community-driven.

Source: I was part of that community for more than a year (first as a translator, than as a topic-driver).