Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Tips for writing code examples

11 views
Skip to first unread message

Janet Swisher

unread,
Apr 15, 2012, 3:09:28 PM4/15/12
to dev...@lists.mozilla.org, engagement...@lists.mozilla.org
I started a page on MDN with tips for writing code examples:
https://developer.mozilla.org/Project:en/Tips_for_writing_code_examples

Please add any tips you may know from your own experience.

--Janet

Robert Nyman

unread,
Apr 16, 2012, 3:08:41 AM4/16/12
to Janet Swisher, dev...@lists.mozilla.org, engagement...@lists.mozilla.org
Excellent about copy and past! We can't claim code is just temporary, since we know people will use it in live scenarios.


Best regards,
Robert
> _______________________________________________
> engagement-developers mailing list
> engagement...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/engagement-developers

Eric Shepherd

unread,
Apr 16, 2012, 9:55:59 AM4/16/12
to Janet Swisher, dev...@lists.mozilla.org, engagement...@lists.mozilla.org
Janet Swisher wrote:
> I started a page on MDN with tips for writing code examples:
> https://developer.mozilla.org/Project:en/Tips_for_writing_code_examples
>
> Please add any tips you may know from your own experience.

Thanks for adding this page; it's a great idea. In fact, it's one of
those <facepalm>Why didn't this already exist</facepalm> kind of ideas. :)

--
Eric Shepherd
Developer Documentation Lead
Mozilla Corporation
Blog: http://www.bitstampede.com/

Stormy Peters

unread,
Apr 16, 2012, 11:19:19 AM4/16/12
to Janet Swisher, dev...@lists.mozilla.org, engagement...@lists.mozilla.org
If we haven't already, we should also add a link from the Evangelist Reps
materials to here ...

Stormy

On Sun, Apr 15, 2012 at 1:09 PM, Janet Swisher <jswi...@mozilla.com> wrote:

> I started a page on MDN with tips for writing code examples:
> https://developer.mozilla.org/Project:en/Tips_for_writing_code_examples
>
> Please add any tips you may know from your own experience.
>

Lawrence Mandel

unread,
Apr 16, 2012, 11:36:00 AM4/16/12
to Janet Swisher, dev...@lists.mozilla.org, engagement...@lists.mozilla.org
Thanks for getting this page started Janet. I added a line based on my experience with code examples,

"This also means that you should provide all of the information necessary to run the example including any dependencies and setup."

If this resource is not specific to MDN/wiki/blog posts I would also add that for published articles, books, etc. it is recommended to have your code examples reviewed by one or more experts to help identify some of the issues that you have listed on the page.

Lawrence

Mark Giffin

unread,
Apr 16, 2012, 12:20:20 PM4/16/12
to Lawrence Mandel, dev...@lists.mozilla.org, Janet Swisher, engagement...@lists.mozilla.org
Good work Janet. We should correlate your new page with what we already
have on code sample formatting here:

https://developer.mozilla.org/Project:En/MDC_style_guide#Code_formatting

Should we combine them? Just link them?

Mark
> _______________________________________________
> dev-mdc mailing list
> dev...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-mdc
>

Mark Giffin

unread,
Apr 16, 2012, 12:22:11 PM4/16/12
to Lawrence Mandel, dev...@lists.mozilla.org, Janet Swisher, engagement...@lists.mozilla.org
Oops! Never mind, already a link there, best if I read it first!

Mark

----------------------

Janet Swisher

unread,
Apr 18, 2012, 1:33:09 PM4/18/12
to Lawrence Mandel, dev...@lists.mozilla.org, engagement...@lists.mozilla.org
While there a some bits (like formatting standards) that are specific to
MDN, I'd love it if this became a general-purpose resource.

vikash agrawal

unread,
Apr 18, 2012, 2:18:24 PM4/18/12
to Janet Swisher, dev...@lists.mozilla.org, Lawrence Mandel, engagement...@lists.mozilla.org
hi Everyone,

On Wed, Apr 18, 2012 at 11:03 PM, Janet Swisher <jswi...@mozilla.com>wrote:

> While there a some bits (like formatting standards) that are specific to
> MDN, I'd love it if this became a general-purpose resource.
>
>
> On 4/16/12 10:36 AM, Lawrence Mandel wrote:
>
>> Thanks for getting this page started Janet. I added a line based on my
>> experience with code examples,
>>
>> "This also means that you should provide all of the information necessary
>> to run the example including any dependencies and setup."
>>
>> If this resource is not specific to MDN/wiki/blog posts I would also add
>> that for published articles, books, etc. it is recommended to have your
>> code examples reviewed by one or more experts to help identify some of the
>> issues that you have listed on the page.
>>
>> Lawrence
>>
>> ----- Original Message -----
>>
>>> I started a page on MDN with tips for writing code examples:
>>> https://developer.mozilla.org/**Project:en/Tips_for_writing_**
>>> code_examples<https://developer.mozilla.org/Project:en/Tips_for_writing_code_examples>
>>>
>>> Please add any tips you may know from your own experience.
>>>
>>> --Janet
>>>
>>>
> ______________________________**_________________
> dev-mdc mailing list
> dev...@lists.mozilla.org
> https://lists.mozilla.org/**listinfo/dev-mdc<https://lists.mozilla.org/listinfo/dev-mdc>
>

I think this is a very nice addition to MDN. But on the page I believe we
can have do's and dont's as well like, the examples should have various
test-cases Or How to use <style> tag Or Why CDATA is necessary and things
like this.

Regards
Vikash Agrawal
Moz ReMo, Manipal



--
sent via HTC Sensation
0 new messages