Today I Learned

TIL, 2017-03-06

  • One of the advantages of value objects is that you can use Comparable and the <=> method.
  • I WAS ABLE TO FUNCTIONAL THINGS TODAY YEAH FAST TESTS
  • Arel is sometimes overkill. You can do this:

    correct_answers
    .select("match_answers.*, match_questions.point_value")
      .joins("LEFT JOIN match_questions ON match_questions.id = match_answers.match_question_id")
    .map(&:point_value).reduce(:+)
    
  • Do that if you need to get something from match_questions when match_answer belongs_to :match_questions.

Rails Conf 2013 Keynote: Simplicity Matters by Rich Hickey

  • Prefer the simple over the complex. Ex: keyword arguments over positional arguments.
  • First iteration, is it possible to split things into system?
  • The thing when that we should use to connect systems and programs are data. Use maps or hashes up front.
  • You have to separate simplicity and ease, and try to figure out where there are entanglements or complecting things that you introduced.
  • Do not lean on your tools, tools will not do this for you. Not all things in a language are useful.
  • We need to deal with complexity. We need to keep it to a minimum.
  • Simplicity enables change.

This project is maintained by daryllxd