Skip to content

Instantly share code, notes, and snippets.

View jcutrell's full-sized avatar

Jonathan Cutrell jcutrell

View GitHub Profile
@jcutrell
jcutrell / a1.md
Last active August 29, 2015 14:20 — forked from r00k/a1.md

Answer to Question 1

That code violates Tell, Don't Ask..

You could also say it exhibits the feature envy smell.

Furthermore, "checking systems" shouldn't, necessarily, sound an alarm. The method both checks and responds to a state, and therefore has side effects. You might prefer to ONLY check the system without sounding an alarm.

(Violating Tell, Don't Ask and having feature envy are pretty much two sides of the same coin.)

// From the 140bytes wishlist here: https://github.com/jed/140bytes/wiki/Wishlist
// TASK:
// Create a function which can create a DOM structure from this:
//
domBuilder(
[/HTML/],
[/HEAD/],
[/TITLE/],
"Wouldn't this be cool?",
[],