- You watch more TV shows and movies on your computer than you do on TV and the movie theatre.
- You spend more time blogging about movies than watching them.
- You are genuinely excited whenever Apple releases a new computer (even though it only makes your current MacBook more obsolete).
- You IM people who are right next to you instead of talking to them.
- Your wife IM's you to get your attention.
- You don't need a blankie because your laptop keeps you warm at night.
- When you do finally get tired of using your laptop you pick up your phone and surf the web there.
- If it isn't online it doesn't exist.
- You open your laptop before you brew your first cup of coffee.
- When you call your laptop your wife and your wife your mistress.
Why am I covering 3 Elixir topics at once? Well, perhaps it is to show you how the three are used together. Individually, any of these 3 are interesting, but combined, they provide you with a means of essentially getting rid of conditionals and spaghetti logic. Consider the following function. def greet_beatle(person) do case person.first_name do "John" -> "Hello John." "Paul" -> "Good day Paul." "George" -> "Georgie boy, how you doing?" "Ringo" -> "What a drummer!" _-> "You are not a Beatle, #{person.first_name}" end end Yeah, it basically works, but there is a big old case statement in there. If you wanted to do something more as well depending on the person, you could easily end up with some spaghetti logic. Let's see how we can simplify this a little. def greet_beatle(%{first_name: first_name}) do case first_name d
Comments