ruby! rails! kids! oh my! … and other fun from terry heath
RSS icon Email icon Home icon
  • Language Snobs

    Posted on June 25th, 2008 No comments

    Last week one of the guys on my team left us. It was disappointing, because the guy seemed to be really smart and it’s always sad when a really smart guy goes. He said it was because of a better opportunity at his new place, where he’d largely be working from home, and that he’d get to use Python. He’d commented several times that he thought Ruby was immature compared to Python, but I hadn’t thought much of it.

    Anyways, I stalked him on the web after he left and found a blog post he wrote explaining why he left, and it sounded like it had more to do with not liking Ruby than anything else. At first I was thinking “how can someone not like Ruby? It’s so much fun to use!” and “Why would someone quit a job over a language?”

    Then I realized that I’ve done the same thing. I think the reason for learning a new language should be to change the way you code. It should show you new ways to solve old problems. Generally your first entry into a language like that (at least in my experience) will be your favorite. I liked C++, but Java offered things like Object and GC, so I switched. Then I was introduced to .NET and all its different forms of retardation, and I hated it. I left Company V for several reasons, but high up on the list was that they were a .NET shop.

    Ruby changed the way I code. I think it’s for the better, but I’m sure some people who read my horrific one liners I post to twitter are more skeptical. I’ve seen Python, and I understand that the two languages are pretty similar, but I have no drive to learn it, and I wouldn’t enjoy doing things with it. I was broken into dynamic languages with Ruby, and that’s where I’ll stay until the next new language concept is introduced.

    Uncategorized
  • Attn GenY: You’re Wussy

    Posted on June 24th, 2008 3 comments

    Decided to precede this with a disclaimer:

    1. I am drunk.
    2. I am generation Y, though I think my membership is questionable because my dad is among the very first baby boomers (was born in 1946).
    3. I thoroughly enjoy most young people I work with. They seem to be motivated, smart, and well educated.
    4. My blog is never to be taken seriously. Ever. I don’t mean what I write, and I never write what I mean (Lewis Carroll, what?).
    5. My blog posts are not the views of my employer.

    Alright, so to start things off, this is a post to introduce a new category: Drunk. @AgileJoe expressed his disappointment at my drunk post moratorium, so I’ve decided that non-technical, non-religious posts can be written in an inebriated state. So, without further adieu, dear genY, you’re all wusses.

    I wasn’t sure what generation Y was when I started at my current shop. I’d never even thought about it. Then I read from different blog posts the implications of having new workers joining the company, and how they’d react to certain behaviors (based upon observations from college and how genX had responded to things). It was enlightening, somewhat personally revealing, and at the same time depressing.

    Why, seriously, are a good portion of you living with your parents? While I’ve read that genY depends strongly on their parents to make choices, and is comfortable living with them, this seems alien to me. I love my parents, but I could never live with them again. We don’t see eye to eye. I want more than either of them did. Why would I want to settle? Why do you?

    Why, also, don’t you want to be the guy to take the point on your team? When I got to the workforce, and ever since, it’s been my goal to be the Michael Jordan of the team. I don’t just want to be awesome at what I do; I want to make everyone else better. I want to make things more clear, more obvious, faster, better. I want to show people how the work they’re doing can be completed much more easily than how they’re doing it now. But lots of you don’t have that drive. You’re fine with the status quo. “OMG we have cell phones! We have Tivo!!!” Yeah. That’s discouraging, to say the least.

    Why are you afraid to make a commitment? I’ve read, and experienced, that most of you are slower to start families and get married. Is it fear of commitment, or poor execution? I’m blaming the latter, since this is meant to be derogatory. I think you’ve either somehow managed to not find a mate after high school and college (impressive, since those are arguably the easiest times to find one) or you’ve managed to convince yourself that your career is more important than kids. You know what both of those traits exude? Wussiness.

    Commit, wuss. It’s great, though it takes a bit of balls to get started. Further, your career is worthless. Over the last 100 years, there are maybe 20 people that we can all name. Everybody else has been forgotten by everybody except their descendants. If you want to be remembered, have kids and treat them well. Play the odds here; you’re not a rockstar. Sorry. If you want to be forgotten and have several meaningless contributions to the world, play the workplace.

    Note that I don’t mean you shouldn’t enjoy your work. Quite the opposite – I love my job, but that said, if you’re missing out on all the tough choices because you’re spending all your time “working” (but not trying to be a badass), you’re wasting your life. Get to it. Wuss.

    Uncategorized
  • Steak ftw

    Posted on June 23rd, 2008 3 comments

    So I’ve been working to perfect my steak cooking. I like steak more than chicken or pork, since I’m, you know, American, so I really enjoy pursuing perfection in a New York strip.

    I’ve learned several things over the last few years of grilling. Here’s a few of them, in order of discovery. The last epiphany came about 3 weeks ago:

    • Buy good meat. If you grill and season everything perfectly, it just means you have a perfectly grilled and seasoned piece of bad meat. Don’t go cheap. Buy the best stuff from the butcher.
    • I’m on the fence about marinating. I was really into it for a while, after we made skewers with Stubb’s marinade, and Sara loved it, but I feel like it overpowered the steak goodness, so I’ve gone back to regular cooking.
    • I’ve tried a few times to do open faced grilling, but I can’t get the consistency right for the meat. Generally the outside ends up dry and tough and the inside is flavorless. Fail.
    • Get a good grill, one that can get hot and where you can adjust the temperatures. That works well for me, at least. I’ve got a gas grill that gets HOT, so I’ll turn it up, let it burn balls out for about 10 minutes, throw on the meat, wait 3 minutes, flip it and turn it down to 20 degrees past medium, win.
    • And here’s the newest one I’ve found out: buy good seasoning! It seems to be a trend here. I think with wine it’s a little bit of self deception that you taste the price (but I’ll be the first to admit that I think I like expensive wine more than cheap wine), but with steak it seems legitimate. My current seasoning consists of coarse pepper (I actually bought this delicious pepper rub from target) – 1 tsp per side for me, 1 tsp per steak for Sara, season all, and garlic salt.

    Next time (in 2 weeks or so, probably to celebrate our moving in), I think I’m going to nail it with a final touch: putting on a bit of butter before pulling it off the grill. I think actually I’d like a little bit of green on the steak too, some sort of garnish, but I’ll figure that out later. I think the butter is going to make it at least 3 times better.

    If you’ve got any great tips, feel free to let me know.

    Uncategorized
  • New Ruby Project

    Posted on June 17th, 2008 No comments

    I’m pretty stoked at work to be working largely on performance improvements. From caching strategies (expiring is always the hard part) to asset serving, I’m thoroughly enjoying the learning curve.

    To get a good starting point on knowing what actions were slowing us down, I analyzed 5 days of our logs to see what took the longest time. There are some tools (like FiveRuns) that do this for you in real time, but we’re also using old school Rails (1.1.6, to be specific).

    I’ve put the log analyzer (more improvements incoming, including abilities to delta across logs and maybe check for different requests and things) up on GitHub, so check it out here. Feel free to make improvements and do a pull request.

    Uncategorized
  • Hidden advantage built into Twitter

    Posted on June 17th, 2008 No comments

    The downtime spurs periods of productivity!

    Chalk that up as another benefit of convention over configuration!

    …And I had to blog this because Twitter is (surprise!) down.

    Uncategorized
  • Good Programmers Dying by the Dozen; Ruby Suspected. News at 10.

    Posted on June 16th, 2008 2 comments

    So, to start this off, let me say that I’m a huge fan of Ruby. I think the language embodies lots of things that programming languages should be – lightweight, gentle learning curve, object oriented, and a good core API. I love Rails as well, since it makes my job a lot more about delivering features than fighting frameworks.

    That said, after interviewing several candidates over the last few weeks, I’m wondering if Ruby is killing good coders. The ones who would be great and would know about graphs, recursion and its limits, and inheritance seem to be fewer as I get more into the Ruby space. I was told today by a guy that polymorphism is “esoteric” and makes things more confusing.

    While understanding these concepts was pivotal in earlier application development, they’re clearly not the crux of today’s engineering. Relying on frameworks like Rails, Django, Symfony, developers are allowed to work on the application and leave the low level stuff to someone else. This is good in that it churns out applications faster, and arguably more reliably than the caveman/wheel approach. It’s bad, though, because the second things start to get hairy in the application logic, the code goes to shit.

    Code Complexity vs Shittyness, Java vs Ruby

    Developers learn to rely strongly on duck punching and weak typing as a substitute for OO concepts and solid algorithm design. I love duck punching and weak typing, but I think using them in conjunction with OO and algorithm design makes for much better and robust code, and using them as a substitute, although viable, leaves the code wanting and unnecessarily confusing.

    Essentially, what this boils down to, I’m going to be teaching a language that isn’t Ruby for Nate when he decides to start coding. I’ll get those good OO principles in there, some understanding of recursion and bit orders, optimizations, maybe a bit of functional programming, and then I’ll be like “you know how hard it sucked dynamically programming in Java with the reflection API? Welcome to Ruby.”

    Uncategorized
  • WTB Evidence

    Posted on June 16th, 2008 No comments

    I read a post and a thread on Reddit the other day that said that it’s not good to answer Christians with “there’s no evidence for a God” when they ask “why don’t you believe?”

    The answer instead should explain all the things wrong with their religion, yadda yadda yadda. So, here’s my answer:

    “I don’t believe in a god because there’s nothing that can only be explained by a god. Natural wonders, like life and stars and Neil Patrick Harris, have logical explanations built upon the study of the environment for hundreds of years. Further, groups claiming to know of a god have religious doctrines that are usually rife with contradictions (their god loves you, but you have that cancer for a reason) and laughable claims (lol, prayer). I’d rather not tell my son that my imaginary friend is more important than him.”

    I’m posting this a little earlier than I’d planned (I put off posting a lot…), mostly because the code in the post below screwed up the formatting behind the menus. So I’m pushing it down. Down

    Down.

    Down.

    Uncategorized
  • Rails 2.1 + Theme Plugin

    Posted on June 13th, 2008 16 comments

    So you’ll get some crazy errors if you’re using the theme support plugin w/ the patch explained here. You’ll need to change your render_file method to look like this (thanks to Nate’s comment for making the code work for everybody):

    def render_file(template_path, use_full_path = false, local_assigns = {})
    search_path = [
    "#{RAILS_ROOT}/themes/#{controller.current_theme}/views",       # for components
    "#{RAILS_ROOT}/themes/#{controller.current_theme}",             # for layouts
    ]
    
    @finder.prepend_view_path(search_path)
    local_assigns['active_theme'] = get_current_theme(local_assigns)
    theme_support_old_render_file(template_path, use_full_path, local_assigns)
    
    end

    And boom, works.

    Uncategorized
  • John McCain’s gas tax is retarded

    Posted on June 9th, 2008 11 comments

    First off, I think it’s absurd to give a tax break to Exxon. I hope the prices go up a little more, because it’s going to start affecting their profits, the way people drive, the people who drive, and the vehicles on the road. I think in every instance it’s a better world when big oil’s profits are lower, people drive more safely, kids can’t drive as much, and fewer people are driving clunky, dangerous SUVs.

    But taking it on face value, I think I drive more than the average American (commute alone is 75 miles round trip) and I have maybe slightly above average gas mileage (22-28mpg). So, multiplying that out, even irb sees that’s bullshit:

    McCain Discount

    Gives me 32 bucks? WTF? I’d rather we keep the gas prices higher and start enjoying some of the benefits of people driving less frequently and shorter distances than have a dinner at Chili’s. Thanks.

    Uncategorized
  • RIP Trolling

    Posted on June 6th, 2008 No comments

    I’m a professional forum troll. I’ll admit it. I’ve trolled things that most people wouldn’t think of mocking, and actively solicited the worst in people (that’s the trick – realize that the goal is to make people respond and make idiots of themselves).

    Well, I haven’t trolled much for a long time. I probably won’t again, really, because the internet seems to be growing up. By “growing up” I mean “unveiling the anonymous.” It’s now a lot easier to figure out who someone is whenever they post something to a forum or chatroom. I’m not worried about the stereotypical idiot who says “where do you live? let’s fight;” I’m worried about the people who will google my name before talking to me.

    In its infancy, the internet was a great place to exchange ideas, and sites employed (and still do) forms of moderation to keep things safe for the average reader. There’s a reason we don’t have moderators in the physical world. Nobody’s going to call your mother a fat pig, or explain to the rest of the room that you were born with a genetic defect that keeps you from forming coherent thoughts when discussing anything outside Nascar. Well, they might, but odds are they’ll feel pain for it.

    I’ve found myself actively moderating my own comments lately, especially when it’s so easy for people to hear you with Twitter. It’s a little disappointing, but at the same time it means that we’ll get to start using the internets for productive communication instead of aimless rants. The moderation is also probably a sign that we’re going to have to work harder to hide things that we don’t want other people to know. Privacy is coming to an end, but that’s a whole different post.

    Uncategorized