1. My Best Career Move

    A Dallas Ruby Brigade meeting with a speaker talking to a room.

    When I first started going to the Dallas Ruby Brigade (DRB) I was silent. I might as well have been invisible. A fly on the wall. I didn’t want to embarrass myself.

    At the time, I was working in Perl and PHP and I wanted out. I tried a few languages and found myself really enjoying Ruby. I wanted to learn more about it and this group could teach me. I wanted to teach and present and this group could watch me. I wanted a job doing Ruby and this group could get me hired.

    I also knew that to do these things effectively I’d have to network. You can’t network if you don’t talk.

    Read More
  2. Why Aren't We Using More Service Objects Already

    Avdi Grimm recently wrote a post in which he lambastes the rise of service objects. As an advocate for service objects I was interested in reading about their shortcomings. I want to know the strengths and weaknesses of the tools I use. That’s not what I found. Instead, I found a post that simply contradicted my own experience.

    Read More
  3. Keep Ruby Weird 2016

    Keep Ruby Weird could easily be called “Remember Ruby’s Fun”. It’s a one day, one track conference in Austin that pays homage to the days of why’s (poignant) Guide to Ruby. Born in Austin, whose slogan is “Keep Austin Weird”, the city and conference didn’t disappoint. After parking my car in the hotel garage, I stepped into the elevator, and met with this disaster:

    Two columns of elevator buttons reading from left to right and top to bottom -1, ⋆1, -3, -2, 0, -1.

    On my way home the elevator stopped in the lobby with 3 men in it. I waited for someone to exit but they stood fast looking confused. I pressed “-2” to go to my floor in the garage. When the doors opened one tried to step off but the others stopped him. He exclaimed, “Where are we supposed to get off?” I can’t confirm it but in my heart I believe they’re still on that elevator.

    Read More
  4. Know Ruby: private_constant

    Constants are a part of your public interface. They can be an efficient way to share static values. But what if you don’t want to share? Some constants, like some methods, are intended for internal use only.

    To find the constants associated with a class or module you can call constants on it. The Float class provides a lot of useful information via constants.

    Read More
  5. RubyKaigi 2016

    Last week I attended RubyKaigi, the most prestigious Ruby conference in the world. Held in Japan 10 times since 2006, it boasts an opening keynote by Matz and attendance by nearly every core committer.

    Kyoto International Convention Center

    Hosted in Kyoto for the first time ever, it was also my first time attending. The organizers were able to book the Kyoto International Conference Center. It’s a stunning venue that hosted the 1992 United Nations convention where the Kyoto Protocol was drafted. Originally built in the 60’s, after 50 years it still manages to look futuristic without appearing out of place amid the beautiful landscape.

    Read More
  6. 5 Tips for Writing a Legible Regexp

    Regular expressions can be tricky to write and downright impossible to read. They can also be incredibly useful. Striking a balance between power and legibility is achievable. Here are five of the best ways I know to do it.

    Read More
  7. Clear Intentions: Do you speak 3?

    It’s easy to mistake current knowledge for universal knowledge. Decisions that were straightforward a year ago are a mystery today. We’ve all done it. Why did I pick that value? What made them do it that way?

    We check the commit history, question co-workers, and spend time learning or re-learning the domain. Hopefully the problem isn’t time critical.

    One way to mitigate this is to make your code clarify your intent.

    Read More
  8. Proper Regexp Anchoring

    In regular expressions, ^ does not match the start of a string. It might in other languages but not Ruby. That’s part of what makes this mistake so common. While we’re on the topic, $ doesn’t match the end of a string.

    Read More
  9. Know Ruby: with_index

    Have you ever used with_index? Not each_with_index which is similar but slightly different. Did you know that you can do map.with_index?

    If you’ve written code like this:

    i = 0
    lines.map do |line|
      i += 1
      "#{i}) #{line}"
    end
    

    or

    lines.each_with_index do |line, i|
      puts "#{i + 1}) #{line}"
    end
    

    then keep reading.

    Read More
  10. Don't Forget About Infinite Enumerators

    When was the last time you created an Enumerator? We use enumerables all over the place but it’s rare to see Enumerator.new. If I’m being honest, sometimes I forget it’s an option. I’m guessing you might as well.

    Enumerators don’t have to be infinite but I find that’s where the power lies. With finite enumerations your immediately limiting where they can be used. They come with an extra expectation that must be addressed. Are there enough elements for me? When they’re infinite you can just go crazy.

    Read More