Hack hack hack...

An open journal-- some of it written for you, but most of it is for me.

FIS Day10

Yaml is more about structured data. Markdown is more about content.

Koans don’t really demonstrate variable scope.

Vint Cerf:

built TCP

Programmer of the day

Kent Beck:

  • invented smalltalk
  • smalltalk design patterns, refactoring, test-driven development, extreme programming, the agile manifesto

The nature of errors are unmet expectations you made an assumption and for some reason that is not longer true.

Test Driven Development

define your expectation

  • writing tests is writing the code I wish I had
  • testing is not about quality assurance

If you are using a case statement your code isn’t object oriented.

execute batch

Ruby

Hooks

initialize
1
2
3
4
def initialize(arg1, arg2)
  #by specifying that initialize 
  #in initialize its very much ok to use initialize
end
class Methods
1
2
3
4
5
6
7
8
9
10
11
12
13
class Artist
  def self.top_5
  end
end

class Artist
  class << self
  #this method is hard to read if you are scrolled all the way down.
  #it doesn't explicitly say it's a class method in the method signature
      def top_5
      end
  end
end

Mini Library Project

Lessons Learned
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
begin
  assert_equal find_songs(library, "Poker Face").first.name, "Poker Face"
rescue => e
  puts e
end

#notice that find_songs has an implicit receiver. Since it's not a 
#class method, it has to be called OUTSIDE a class...

# ALSO

def search_songs(library, song)
    library.songs.find_all { |ea_song| ea_song if ea_song.name.match(song) }
end

#make sure that I'm calling the .find_all on an ATTRIBUTE of an object. 'Come on Jonas,' you are better than that.

Comments