Thanks Joe!
Answers inline.
Am 31.10.2016 um 18:40 schrieb Joe Medley:
> Florian,
>
> I really like your informal approach to syntax. I like it enough that I'd be happy to help rewrite syntax sections across the site and write instructions how do do them properly.
This sounds great! Having instructions on how to write the syntax
section might help this discussion (which I started twice already.
Thanks Sebastian, I completely forgot it).
> But, I'm not crazy about putting an example in the introduction. Though I agree with the intent of putting something up front, I think it's going to be hard to enforce keeping it simple. I'm not just thinking of writers who may not respect the restriction or who think philosophically that every nuance has to be covered up front. Many cutting edge APIs require more context for their examples than do basic JavaScript features. That also means more explanation and the possibility that the intro becomes bloated to the point that it's no longer effectively an introduction. (Yes, I just made a slippery slope argument. Those are easy to assert and difficult to prove. But I rarely make them, and when I make them I don't do it lightly.)
I think there is no general approach to examples in the introduction.
MDN is not using auto-generated API documentation, so we are able to
make judgements on a case by case basis.
For many ECMAScript methods, a lot can be explained in 5 lines of code,
and often that is all you want and people go to w3schools just to copy &
paste code that uses Array#slice, because they don't memorize how to use
it. For the Array pages, I've added the simplest case of using a method
and have left out any more complicated use in the intro. More advanced
code that uses all parameters etc should go in the example section more
below on the page. I completely agree that the intro shouldn't be
bloated, so the goal is indeed to be very short and concise. The only
exception here is the Array main object page itself, where multiple
small usage examples are presented. I also think that this makes sense,
but I am eager to hear more opinions.
Our docs try to serve example-driven and concept-driven programmers, we
believe that we have served more concept-driven programmers in the past.
By being more focused on the examples (and having them presented first),
I hope to help example-driven programmers faster (Stackoverflow has
shown that there are a lot of them).
Florian.