Happiness is a Choice

Blog


There are many things I believe my dad gets wrong. I also believe my dad believes there are many things I get wrong.

A most recent thing Dad has wrong is the belief that once he masters something, he has that skill forever. The example he gave was holding a pen. If you're holding a pen, your hand should never drop that pen unless you deliberately choose to drop that pen. While I can understand how disconcerting dropping a pen unconsciously can be, the actual belief that one should be perfect, and have all one's actions be perfect, is absurd in the full definition ("wildly unreasonable, illogical, or inappropriate") of the word. Professional basketball players are around 78% for freethrows, the best being around 90%. Batting .400 is amazing for just about any baseball player older than a high schooler crushing 10 year olds. Keyboards have delete keys for a reason, and that reason isn't because two finger typing is superior to touch typing.

What Dad does get right, however, is his unwaivering belief that happiness is a choice. He has managed to live sleep-deprived for decades, and still says things are as fine as frog hair ("Daaaaaaad! Frogs don't have hair!" "That's mighty fine then, isn't it?"). He has managed to live decades alone, and still has a smile for friends. He has managed a restaurant for decades, been shot at, robbed, had a truck driven through the front window, had his tools and cars stolen many times, and still helps the people around him, smiles when he greets someone, and celebrates every day that he woke up.

Recently, he woke up on the wrong side of the couch, tripped over something, banged his leg, grumbled something to himself, hit the door on the way to the bathroom, then stopped, as he relates the story. "No," he goes on telling the tale, this wasn't how his day was going to be. He woke up. He has things to do, a business to run. The sun will be shining soon enough. God gave him another day, He's not done with Dad yet. And so Dad, frustrations set aside, chose to have a good day.

Grue comments frequently that I'm the most optimistic person he knows (he clearly doesn't know my dad). I want to fight Grue on his assessment, except every time I try, I end up explaining how, yeah, I was stuck behind this car going 20 mph in a 45 mph zone, but if I had gone around instead of driving patiently behind them until they had turned, I might have hit that kid who darted across the street on the next block, so, yes, I just made driving ridiculously slowly a good thing, because things could always be worse. Then Grue laughs, because I am the only person who would tell him that driving infuriatingly slowly behind a car is a good thing.

And that's the thing that has me like Dad: things could always be worse, but I woke up today, I still have a chance to improve, to build that thing, to accept responsibility for my mistakes, to fix them, to achieve that dream, to help another person, to be better. I have another chance to make space for my grief, accept it, and then choose happiness.

Today's trophy

Blog

"How was the run today?"

"Really not good. Intrusive thoughts. Ended up stopping after about a mile, walked for a bit, ran some more. I ended up running a bit farther to make up for stopping, but that didn't go well either. So, when I finished, I sat down and started crying because everything hurt so much. And as I was crying, a bunch of ants crawled on me and on cue, all bit me at the same time. So now I'm tired, in pain, and itchy all over."

"But you did it."

"Yes, I went for a run."

"Well, then, the participation trophy is the only one that matters today!"

win!

Feet to the flames

Blog

Mike: "I need to find someone to hold my feet to the flames to get things done."

Me: "I think it is less about finding someone to hold your feet to the flames, and more about finding someone to help you hold your own feet to the flame."

Semi-retirement can be difficult to navigate if you're previously a high-productivity professional.

IDD

Blog

Okay, so, you've heard of Test Driven Development, where tests (unit, functional, system, integration, and contract) are written first, then the code that passes the tests is written to that test's specifications, as a way to write good, efficient, tested code.

There are also Acceptance test-driven development (ATDD), behavior-driven development (BDD), example-driven development (EDD) and story test-driven development (SDD) styles of code writing. I'm most familiar with the last.

We have (mostly because I wanted) a tech-debt sprint every 4th sprint on my main project at work. These are sprints where we do not introduce new features, but rather fix bugs, improve infrastructure, increase performance, or refactor that write-once-to-learn-copy-once-and-shit-copy-again code into a don't repeat yourself (DRY) bit of code. When feature development is blocked, for whatever reason, we continue developing, but the priority order is often unclear.

Until today.

Katherine commented she was doing Irritation Driven Development (IDD) and I love the term. "These things bug the F out of me, I am going to fix this" seems a great way to bring joy back into a project and code. I am delighted.

Find the bug, Rails edition

Blog

I have this code in a model in a Rails project.

  validates :name, presence: true, on: :create
  validates :email, presence: true, format: { with: URI::MailTo::EMAIL_REGEXP }, on: create

Let's put it in an Author model:

class Author < ApplicationRecord
  validates :name, presence: true, on: create
  validates :email, presence: true, format: { with: URI::MailTo::EMAIL_REGEXP }, on: create
end

When retrieving a list of all of the authors without email addresses (because, well, we are cleaning up these things) with this line of code:

  authors = Author.where(:email: nil)

... two new blank authors are created at the WHERE query. Both of their names and emails are blank. This is absurd!

Find the bug.

I narrowed the problem down to those validates lines, but could not see the bug. After an hour of puzzling, I asked Katherine to look. When she said, "what the?" I felt a little bit better that this was something weird.

She figured it out, though.

class Author < ApplicationRecord
  validates :name, presence: true, on: :create
  validates :email, presence: true, format: { with: URI::MailTo::EMAIL_REGEXP }, on: :create
end

F'ing symbols. Yay for Katherine's second set of eyes! Whoo!

MEOW

Blog

<!--       _
       .__(.)< (MEOW)
        \___)   
 ~~~~~~~~~~~~~~~~~~-->

Pages