Eloquent Ruby
I have been reading Eloquent Ruby by Russ Olsen. Up to Chapter 5 today. I find that its best to do my reading in the morning as my mind is still fresh and less distracted.
Just some notes I want to capture while reading the book.
One example was to look in the ruby codebase specifically set.rb
This involved me reading more about Set vs Array
Atomic Object - Set better than Array?
Set.class Big Takeaways
- only has unique objects
- cannot! access elements ie Unordered list
- Fast search time using #includes?
- why? Set compares via
eql?
- Array compares via
==
- why? Set compares via
- Not Core Library, but in Standard Library
- require”set” in file
So I need to ask myself, when would be the best time to use Set?