Skip to content

Instantly share code, notes, and snippets.

@Jhowden
Jhowden / Notes
Created October 28, 2013 02:42
TDD Video
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.
@Jhowden
Jhowden / zoo.js
Created October 22, 2013 02:53 — forked from dbc-challenges/zoo.js
//------------------------------------------------------------------------------------------------------------------
// 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(){
@Jhowden
Jhowden / zoo.js
Last active December 25, 2015 19:38 — forked from dbc-challenges/zoo.js
--------------------------------------------------------------------------------------------------------------
// YOUR CODE: Create your Zoo "object literal" and Animal "constructor" and "prototypes" here.
//------------------------------------------------------------------------------------------------------------------
function Animal (name, legs) {
this.name = name;
this.legs = legs;
}
<!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>
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."