This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When delivering quality software, it is unwise to just hack something out that works. This way produces ugly and unmaintainable code. | |
TDD produces better results faster because you are not just flailing around making guesses about mistakes/errors. Furthermore, having a plan gives programmers a process to follow and work around obstacles. | |
Testing and TDD are not one in the same. Difference between testing and TDD: | |
* tests provide documentation of code | |
* tests help us cath future errors | |
* tests give long-term time savings because of catching errors | |
However, tests are just a tool and not a process. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//------------------------------------------------------------------------------------------------------------------ | |
// YOUR CODE: Create your Zoo "object literal" and Animal "constructor" and "prototypes" here. | |
//------------------------------------------------------------------------------------------------------------------ | |
function Animal(name, legs){ | |
this.name = name; | |
this.legs = legs; | |
}; | |
Animal.prototype.identify = function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-------------------------------------------------------------------------------------------------------------- | |
// YOUR CODE: Create your Zoo "object literal" and Animal "constructor" and "prototypes" here. | |
//------------------------------------------------------------------------------------------------------------------ | |
function Animal (name, legs) { | |
this.name = name; | |
this.legs = legs; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<link rel="stylesheet" href="http://cdn.jsdelivr.net/normalize/2.1.0/normalize.css"> | |
<link rel="stylesheet" href="main.css"> | |
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800"> | |
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lato:100,900"> | |
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.0.2/css/font-awesome.min.css"> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def bottle_song(n) | |
# n.downto(3) do |x| | |
# puts "#{x} bottles of beer on the wall, #{x} bottles of beer." | |
# puts "Take one down, pass it around, #{x-1} bottles of beer on the wall!" | |
# end | |
if n == 2 | |
puts "#{n} bottles of beer on the wall, #{n} bottles of beer." | |
puts "Take one down, pass it around, #{n-1} bottle of beer on the wall!" | |
puts "#{n-1} bottle of beer on the wall, #{n-1} bottle of beer." |