Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure stylistic consistency across all exercises #10

Open
tannerwelsh opened this issue Dec 1, 2014 · 0 comments
Open

Ensure stylistic consistency across all exercises #10

tannerwelsh opened this issue Dec 1, 2014 · 0 comments

Comments

@tannerwelsh
Copy link
Contributor

All of the copy and code in exercises should conform to a style guide.

For the JS code, we should just pick a style guide and use it.

For our own copy and "starter code", we should enforce some basic principles. Rules can be discussed in the comment thread here and then added to this description before being ported to an official document.


JavaScript Exercises Style Guide

All exercises should live in their own, executable .js files.

The core mechanic of the exercises is to replace missing parts of a script so that it performs as specified in a use case.

Missing parts of a script must be identified by four (4) consecutive underscore _ characters, as in this example:

var ____ = ____(sentence) {
  return ____._____(____, ____);
};

Environmental constraints

Command line execution with node.js

Test cases must be written at the bottom of the file and wrapped in a if (!module.parent) { ... } block.

Single page in browser

Must provide students with a functional skeleton of an HTML file to open in their browser.

Test cases should be written as either:

  • Statements to be executed from the browser's JS console
  • Code wrapped in a <script> tag which produces either a visual result (i.e. changes the DOM) or logs messages to the console

Multiple pages in browser

Must provide students with functional skeletons of all source files.

All source files must be enclosed in their own named directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant