Saturday, January 25, 2020

newPhoneGrat

Hey, happy to be back. I have a new phone. It's a pixel 4. It's pretty good.

I'm grateful for good friends. Jake and Julia had us over for dinner tonight. Great food, and we had fun talking. Our kids played together which is really the best part.

I'm grateful for diversity. By that I mean that I'm grateful that we all have different strengths. I focus a ton on my deficiencies. I'm not going to list them here, because that's the opposite of our purposes in the first place. But I do get great joy out of seeing friends really be good at things. Like, Jake made an awesome dinner tonight, and I'm super happy that he has that ability.

I'm grateful for a quick drive to work today. 35 minutes with no tolls. That's a quality commute. The weather was pretty and it just felt sunny, you know?

My kids are cute. And asleep. Sure love that.

I'm grateful for good kids' books. We have one (borrowed) that is 15 children's books authors explaining their favorite animals. It's cute. And I like exploring new books with E. 

I'm grateful for growing up and changing ideas. I was a conservative kid, politically speaking. And I'm not sure when it changed, but I'm way different from that now. I like those changes. I feel really good about the things I believe. 

Word, that's enough. Time for great sleep!



Monday, January 20, 2020

SabGrat

Is anyone else irritated that this gratitude journal thing works pretty well? Like I've got issues that are non trivial. And here this "enumerate the good things in your life" advice comes along and does improve the way I feel. 

Grateful for Naproxen. My daughter got dropped on my broken rib today and it was really bad. Just really not good. But two Aleve liquigels and a few hours later and I'm back to feeling good. Medicine is great. We should definitely keep using it.

Grateful for my wife and I being on the same page. Sunday school was hard today. Lesson was on Lehi's vision of the tree of life. As I've gotten older that vision has become more and more meaningful to me. The trouble is that the vision (and like, all scripture tbh) is open for lots of different interpretations. And my interpretation is different from the *very linear and proscriptive* interpretations offered by well meaning class members today. So we were both... Irritated by it today? Either way we talked and are on the same page. Most times you just have to love ward members and ignore their opinions that aren't doctrine and don't jive with yours. 

Grateful for my wife's delicious cake she made today. It was good!

Thursday, January 16, 2020

ThursdayGratitude

You might be wondering if I'm going to create unique titles for all of these posts going forward. The answer, of course, is yes.

I think I broke a rib playing basketball the other night. The pain isn't horrible, but it's bad if I move wrong. Or try hard to poo. Or try to open a drawer with my right hand. But there's really but much you can do with a broken rib. As long as you aren't puncturing a lung with jagged rib parts, you just chill for six weeks and then it should be better. Instead of getting x-rays ('Merica!) I'm just going to wait it out. Pretty sure my lung is fine.

I had an eight hour meeting at work today. I can't remember the last time I worked that many hours straight, let alone in a meeting that long. It was good though. My directors know their crap, and I feel really good about that.

Let's do gratitude.

I'm grateful for good coworkers. They are smart, kind, and interested in unified success. And they believe in me, which is super cool.

I'm grateful for good friends. We had dinner with the Salas family tonight. They're so great and we lucky that they're in our lives.

I'm grateful that the Jazz had a ten game win streak. It's over now, but it was super fun. They're fun to watch and follow. 

I'm grateful that my rib isn't worse. 

I'm grateful for this great weather.

I'm grateful, once again, for this fantastic bed. One hundred percent would buy again. Ten out of ten.

Tuesday, January 14, 2020

SkipGrat

I'm grateful for our cat. She's missing. Probably dead. But she was the best cat and we loved her so much. I'm glad we had her!

Grateful for our new successful bedtime routine. I now get two books with S and we get family scriptures. And it takes less time. A win!

Sunday, January 12, 2020

Satitude

Had a good Saturday. 

Grateful for: 
How nice our house looks when it is clean. We got interrupted while shredding our mail, then E threw all the shreddings on me one morning. We cleaned it today! FeelsGoodMan.

Grateful for a thankful wife. I bought her cans of Diet Dr Pepper tonight and she made me feel it was the biggest deal ever. She's a great receiver.

Grateful for compost and gardening and mostly I'm grateful for dreams. Maybe I'll never start that garden or company or whatever, but I do enjoy thinking about it.

Saturday, January 11, 2020

SatisGrat

Tired, but had a good day. 

There was supposed to be big storms and maybe a tornado around here today. Nothing really materialized, but we got ready anyways. Staked down the trampoline and moved the cars to the garage.

Today grateful for: Tractor supply company. I love shopping there. It makes me feel like I should be a real farmer.

Major's Burgers in Liberty Hill. We had them for lunch and they were so good. 

I got good work done today, despite work from home. 

Friday, January 10, 2020

QuickGrat

Grateful!
I got some real work done at the office today! After two garbage days with no productivity I kicked butt. I know I'll have good days and bad days but today was a good day.

We had leftover pizza for dinner and it tasted good. Grateful for that.

I did a 30 minute course on resilience at work today. Grateful Google has good mental health resources.

Wednesday, January 08, 2020

DiscourageGrat

Today I'm grateful for aww screw this let's go to bed.

SleepyGrat

Today I'm grateful for:
- scriptures. I had a good experience reading them tonight.
- my buddy Kyle. I messaged him during work. It was nice to chat with him.
- Good stories. Specifically Ecco the Dolphin. I played the games as a kid, but only read the Wikipedia articles about them today. Their plots were so cool! I never would have caught them as a kid. Lots of cool time travel though.
- I'm going to build a new computer soon. I haven't done that since the eighth grade. Funny. I built that computer so I could play Warcraft 3. I'm building this one (in part) so I can play Warcraft 3 Reforged. Stoked.

Monday, January 06, 2020

LateGrat

I'm grateful for my very nice bed. We were reckless and purchased the most expensive one they offered. Totes worth. 

I'm also grateful today for sleep and being able to go to bed early. 

I'm writing this from my bed, can you tell?

I'm grateful once again for Twitch. It's really nice to be able to escape a bit and take a mental break. 

Back to work tomorrow. I'm already a bit behind this week. Gonna have to move fast. Vroom.

Sunday, January 05, 2020

Gratitude - Jan 5 (Sunday)

Today I am grateful for:

  • 10:30 church. We were on time today! For the first time in *checks notes* three years! We didn't hate each other this morning, my kids were super pleasant, and I enjoyed church instead of hating everything about everybody. Apparently I like not nine o'clock church. Mornings are the worst.
  • We have the best friends here in Texas. Let me specify: They're not the best people. They're not the most talented or best looking. They're great, don't get me wrong. But what makes them the best is that they love us just the way we are. We have a community here. And we're all a bunch of weirdies with kids the same age that go to the same church. But I love them and am so grateful that we've got them. We get together all the time, and honestly it's the best part about our move to Texas.
  • We cleaned up some of the house when the kids went to sleep tonight. I feel good when I clean and accomplish things. Endorphins? Dopamine? Heck if I know what it is. But I'm grateful for the cleaner house AND the good feelings that come from cleaning it. 

GratPhone

Dude the Blogger App is surprisingly bad. Not sure what that's about.

Gratitude!
- the Jazz won tonight. That makes me happy. 
- My kids are adorable when they're asleep, and they are currently asleep.
- Central Texas winters are just beautiful. I could do this all year no sweat. 
- My wife made really good German Pancakes today. I was happy to eat them, but more happy with how proud of them she was.
- Grubby has been streaming Heroes of the Storm lately. I enjoy those casts. I'm learning it's okay to jump from video game to video game. I don't need to be professional or just dedicate myself to exactly one game.
- Church starts at 10:30 tomorrow! I've had 9am church for forever and I freaking hate it. Very happy to have a later start.
- Big hugs from my daughter today. Lots of cuddles with my son. Good kids.


Saturday, January 04, 2020

Late Gratitude Journal

This is from my phone. So I'll likely sound weird.
- grateful for good books. Righting Software is really good. Making me feel like I'm growing.
- grateful for the great attention to detail in Mario Odyssey. Such a fun game. 
- Grateful that wife can play as Cappy and we can co op Mario.
- grateful my wife lost a few hands of nerts tonight. I was on a ten hand losing streak.

Thursday, January 02, 2020

Reading Log - Righting Software - Apparently Chris Sucks at Design

Gotta write quickly, because it's getting late and I'm going to bed earlier this year.

We're finally to the meat and potatoes of Juval's advice on system design. As a reminder, system design is the design of the software, not the design of the project.

remember, system == the thing you are building, and project == the steps you'll take to build it.

System design comes down to decomposition. Decomposition is when you take one thing and break it down into many smaller things. Why would you want to break a software system into smaller things? Three good reasons:

  1. Decreased cognitive load. You can reason about 15 lines of code far better than you can reason about 150 lines of code. You can understand a "module" better than you can understand an entire system. Humans can handle smaller pieces better. It's just the way we are.
  2. Better testability. You can write software that will exercise your modules and warn you if things aren't working as you expected. This is way easier to do on a "piece" of a system instead of "an entire freakin' system".
  3. Protection from change. Software keeps changing. Requirements change, customers change, etc. You're going to have to change your software this week. How do you make sure you don't break everything when you make that change? You isolate the thing that changes in its own module. This is the big reason for decomposition. Decomposition, if done correctly, will make maintaining your system easier.
Juval said he was going to tell us the absolutely worst way to decompose a system. Then he proceeded to explain the way I've been designing software for the last five years. So, you know, I've got that going for me.

There are two ways to decompose a system. Functional decomposition and Decomposition by Volatility

Functional decomposition is when you separate the capabilities of your system into their own modules. If your software can slice potatoes, dice potatoes, and bake potatoes, you would end up with a sliceModule, diceModule, and a bakeModule. 

The problem here is that when anything changes in your software, there's a high probability that the change has to take place in all three of those modules. Example: When we built the system we were expecting peeled potatoes from the supplier. Now a customer has said we have to support dirty potatoes fresh from the farm. We change the software to accommodate it. Now sliceModule, diceModule, and bakeModule ALL need to modified. This sucks badly compared to...

Decomposition by volatility. Decomposing stuff by volatility sounds fancy but isn't. It means that you separate modules based on things that could reasonably change. Let's work on the potato factory, and hopefully this gets a little more clear. (aside: this was not the example in the book. I'm making this up as I go).

Our potato system needs to produce sliced and/or diced and/or baked potatoes. Is it reasonable that customers might expect or need a different way of preparing potatoes in the future? Are we going to boil potatoes? Are we going to, err, cut potatoes in half instead of dicing them? We see that these are likely things that will change in the future. We don't want to program anything that's outside of the requirements right now, but we do want to leave a seam so we can change it in the future. The way we leave that seam is by pulling "preparationMethod" into its own concept and "cookingMethod" into its own concept. We have a module that allows us to "prepare" a potato the way we want, and a separate module that allow us to "cook" the potato the way we want. "PreparationModule" is going to let us slice potatoes, dice potatoes, cut potatoes in half, etc. etc. The way that other modules communicate with preparationModule makes us not give a crap about how they were prepared. We just know we're getting prepared potatoes out of the deal.

Gonna have a cookingModule. Gonna have a "getMeThePotatoes" module, because the way we get potatoes is going to change over time. 

His idea is that we find out what might change. We group things that change for the same reason together in a module. Things that change for different reasons go in different modules. The dream is that a reasonable change that the system has to undergo will only affect one module. Like, that's the dream. But if we can isolate changes into one module that has a well-defined interface to the other modules? Well that's just gravy.

~~~~

Quick gratitude journal because E is waiting for me to go cuddle him (it's 12:30 AM, btw)
  • I'm grateful for fast food. It is available and I am blessed to be able to afford it way more often than is healthy. I know my kids will eat it. I know it will be reliably tasty. And I know it comes with diet coke, which brings me happiness. When life gets tough (and it often does), I can count on McDonald's to offer fries that will satisfy my children, diet coke that will calm my nerves, and a McDouble without pickles that will make my wife love me again.

    Today I went to three different fast food places. We stopped at Freddy's because Torchy's had a very long line. The burger was not lovely, but the fries were great and they had good fry sauce, which is hard to find in Texas. We needed a treat, so we stopped at DQ and got some blizzards. My kids were very cute and ate lots of our shakes like the little pigeons they are. After an unexpected Wal-Mart run, me and the babies got McDonalds, as they had been asleep when we picked up Freddys. We intended to save them some fries from Freddy's, but that proved a fool's errand. So we got a 10 piece McNugget and a Big Mac for five dollars. I love that mix n' match deal they throw up during off-hours.
  • I'm grateful for my wife being supportive and kind even when things don't work out. As long as she is well-fed she is very kind and patient with me.
  • I'm grateful for my cute kids. I read T a book tonight (Elephant and Piggie: There's a Bird on Your Head). She did so good with it. I've really struggled to read books with her in the past, but she ate this one up. She laughed and pointed and talked and all those good things. We bought the book from a cute local bookstore this past... err, I have no idea what day of the week it was. There have been like ten Saturdays since Christmas, so, yeah, it was one of those. 
Speaking of cute kids, I gotta go cuddle that little muffin. Thanks for reading. gl hf. 



Gratitude Journal - Jan 1, 2020

Yeah, so I'm doing this. One of my three OKRs (don't ask...) for 2020 is gratitude. One of the "key results" for this will be to write a gratitude journal each day. These will likely be short, poorly written, and without much context. They will frequently appear in my hand-written journal. If not there, I will post *something* here. It might come from my phone and it might suck. All I'm saying is not to expect much, alright?

Jan 1, 2020 ->
Grateful for:

  • Good friends who invited us over for dinner (Little Caesar's) tonight. Very kind to share their evening with us. Our kids get along great, and it was fun to see them play together. 
  • Friendly neighborhood. We took a walk around our neighborhood today as E learned to ride his new scooter. A quite drunk neighbor invited us in to watch the game. Lots of people said happy new year. It felt good to be out among my people. 
  • Good health insurance. I strongly disagree with our current health care situation. But I'm grateful that my family has what we need. I'm especially grateful for my pediatric endocrinologist, who very firmly taught me at a young age what kind of career I'd need in order to stay alive. The dude legit sat me down and said "I've got former patients who are 20 years old that come in for 'samples' of insulin to stay alive. You have to get a good job with a big company that will offer you health insurance. It's cute to 'follow your dreams', but you can't afford to do that if it doesn't come with health insurance." Sounds harsh (lol, it was), but I'm really grateful for it. 
  • On that note: I'm grateful for the mentors that have been around. As I've become more aware of my privilege I've really considered all the people that helped me get where I am. I was around lots of great people who showed me valuable things about life. I had lots of siblings that went before and paved a really solid path for me. I went to school and work with people expecting good things from me because they knew which family I came from. I knew what classes to take in college (and from which professors) because of my awesome family that figured it out first. My pediatrician, my freakin' chemistry teacher / cross country coach, my stage crew teacher / carpet install manager / friend (Tom Sharpe). Good humans. Spent time helping me. I'm grateful for that.
K that's enough. Go to bed. Spoiler alert: That Righting Software book is fetching great. Going to post some notes-- maybe tomorrow from the bus. It's legit though. 

Saturday, December 28, 2019

Reading Log: Righting (sic) Software. Part 2

Holy fetch. Leave it to Nate Cunningham to be lurking on my dead-for-several-years blog and comment within a few days. Truly impressive! Thanks Nate. You're the man.

Here comes part two of the reading log. I'm experimenting with writing these things a few days after I do the reading. This forces me to consult my notes and revisit some of my thoughts. Perhaps it will help with retention.

~~~

Juval is about to sell us his "Method", which is his specific method for planning and designing software projects. I'm naturally wary of anybody selling me a "method" to do anything, especially one that is "Completely unique to me and is guaranteed to bring you riches and success". Feels like something from my spam folder. That being said, everything I've read so far has been good.

He says that Method = System Design (the software...) + Project Design. This is actually sort of a big deal. Only that I've never considered project design to be anywhere near as important as system design. He asserts that we all suck at delivering working software on time because:

  • Project design is strictly harder than system design
  • We study and practice system design, and none of us have ever read a book about project design
I don't have data about his first assertion, but I can tell you that I'm a grown-man-who-thinks-he's-good-at-this-stuff and I've never even considered project design as being a concept I should try to be good at. I guess this just wasn't something that I thought belonged to my profession. It's like waking up after four years and being like "Oh man, I was supposed to file taxes every year?". 

 A few more nuggets:
  • We need to validate the high-level system design early. If we spend three months building something before we figure out that the architecture won't actually work, we're pretty boned. 
    • How do we do that? As part of the project design, you should make sure that work is done early that will reveal whether or not this architecture is going to fly. I'm sure he'll talk about this more, but this feels a lot like some of the Agile ideas -- Build a very thin vertical slice to prove it'll work.
  • "Designs" are really a filled out decision tree. Specifically, any design is a leaf on a decision tree. See https://en.wikipedia.org/wiki/Decision_tree for the details of that. I had never thought about it this way. This analogy works really well for computer science nerds. We use trees a lot. But we also spend a lot of time simplifying, or pruning, trees. Trees get big fast. But if we know certain decisions don't work, we can prune off the entire subtree that follows that decision. 
  • Designing a project or system should be a time-boxed endeavor. Juval basically says "You should design in three to five days. Any more and you'll just be adding unnecessary fluff". 
So, in conclusion: You're going to produce a decision tree for your system design in about four days. And then you're going to spend the next four days producing a decision tree for your project design

Thursday, December 26, 2019

Reading Log: Righting (sic) Software. Part 1

Hey all. I'm trying something new for a while. I'm going to be reading two books re: software engineering in the next few months. I'm going to write down my thoughts about each part as I read it. This is mostly an exercise to help me solidify understanding of what I'm reading.

As an aside, one of my dreams is to run an online book club about software engineering. It'd be a Twitch stream where we discuss a reading assignment once a week. We'd pick a book together and assign a few chapters. People who read / contribute get special twitch emotes or something.

For what it's worth, it's 4 AM and I'm awake holding my daughter. Who is probably awake because her teeth hurt. There's an outside chance she's just awake to be a jerk. We're watching LBB on Netflix. That stuff is baby crack.

Merry Christmas, btw.

K, part one of Righting Software. Just the intro so far.

~~~
First of all, this dude pulls no punches. He's like "Everybody sucks at software. Except for me. So I guess I'll teach you how to deliver working software on time, on budget, and defect free". This is in stark contrast to my usual philosophy. My current philosophy, informed mostly by Ron Jeffries "The Nature of Software Development", is that everybody sucks terribly at software. So, instead of like, trying to estimate costs better, or plan better, or whatever better, we should just deliver one feature at a time, minimizing complexity and maximizing quality.

Ron's approach reduces the need for up front planning. But it does ignore some realities: Particularly "How are we going to pay for this? How many devs do I need to budget for? When can I tell the boss we'll recoup some of this money?". The "Screw everything we're agile" plan works super well when you have a fixed budget and loose timeline. It has lots of merit. But Juval Lowy (except with two dots over that 'o') points out that reality frequently requires that stuff. So, uh, I guess we're going to plan stuff.

This comes at a good time for me, though. Google is a big company and they expect me to plan. My manager isn't really buying the "it will be done when it's done" approach to my code. He also keeps wanting estimates about when this stuff will be done. Seriously though. I've never successfully estimated anything in my life.

It occurs to me that I have never delivered any meaningful software on time or on budget. I've written some fantastic software. I honestly feel really good about myself as an engineer. My quality is generally really high. My code is legit. I don't feel really bad about missing our "deadlines". Like, they were arbitrary, right? And our great working software continues to win the market. But yeah, my project management has historically sucked.

Juval says that a software architect is responsible for designing two different things. One is the software. That's what you and I always do. This component and this module and that framework etc. This is what I think of when I think about "software architect."

The second thing an architect is responsible for designing is the plan to build the dang thing. Or rather, the project design. "If there's no reasonable way to build it, why design the software part of it?". So apparently projects require design. That's the planning, estimation of costs, etc. I have no idea what this looks like yet. This is a massive change from my current modus operandi.

Basically: I approach life with the base assumption that "planning is futile. We cannot possibly know how long this will take. So we'll completely finish the smallest, most important part you can define. We'll just keep doing that until we run out of budget. I hope that you have something really great at the end :)"

Juval says that's bullcrap and that we should be effectively planning projects. He posits that "applying sound engineering practices from other (real) engineering disciplines" makes this easy. Given that literally all of us suck terribly at this, I'm not yet convinced. But I'm excited to see what his process is.

I'm committed to trying it out. I'll keep writing about it as I read. I've got a new small project starting up at work, and I'm one hundred percent going to run this method on it. I'll practice all the steps and let you know how it goes.

~~~

Good news: My daughter finally decided it was time for bed. That's legit. I'm going to bed too. I'll see y'all soon.

Please drop me a comment if you read this thing. Like, I don't actually expect visitors. But let me know if you're here because that will definitely make me more likely to continue this project.


Monday, July 08, 2019

The Jist

Hey all, happy Sunday!

Tomorrow is my first day working at Google. This has been a dream of mine for a long time and I'm very excited about it. I'm grateful for the support and coaching of my wife. She has taught me how to be brave and pursue the things I want in life. I'm stoked to give this whole thing a shot.

Given that I start tomorrow, and that I have no idea what the intellectual property rules are going to be like, I wanted to vomit out the jist of the software dev book I've been thinking about writing.

I really don't expect it to be good. It's just a rehash of the things I've learned in the first five years of doing this professionally. My desire is that it can stand as a replacement of me to my old team at Xima. It's an opinionated approach to how you should write software. Ready? Let's do this thing.



You suck at programming. And it's not your fault, really. But you suck at it. And you need to understand how you suck at it so you can compensate for your inherent suckiness. One of the core values we're going to try to live by is "Don't Suck".

Why do you suck at programming? There are three reasons.

1. You suck at understanding the rest of your code. 

Your brain can only hold a finite amount of data before it starts losing things. You can think of it as a stack. You can pop stuff on there repeatedly, but you're going to start losing things off the back of it as soon as you pop too much. This is just how you're built. It's not your fault. There's a decent amount of research into this. You can only handle so much cognitive load before things start sucking. Your physical condition affects this too. Less sleep leads to less cognitive capacity. Some people will have less cognitive capacity (smaller stack size) because of a traumatic brain injury or a urinary tract infection. You might be amazing and have a relatively large stack size. But suffice it to say: There exists a program that is too large for you to understand all at once. You don't have enough working memory to keep it all available.

Essentially: You are limited in how much you can understand of your software at one point. You have a moving window of comprehension that precludes you from writing your software well. We're going to refer to this problem as "You suck at understanding the rest of your code". In this usage, "the rest of your code" means all the code that is not currently loaded into your moving window of comprehension.

2. You suck at knowing what the code you wrote does. 

Thought experiment. Indulge me on this one. You're in a high stakes programming situation. There's a beaver dam that will be blown to shreds in five minutes unless you can write a specific method correctly. You know what the input looks like, and you know what the output should look like. You have to read data in from a flat text tile, and write out a new file with the solution in it.

You write code for four minutes straight. This is in your wheelhouse. These are not things you've never done before.

At five minutes it's time to see if you saved the beavers or if they all died and became hats. How confident are you that your dam survived? Based on your normal work history, what is the probability that they aren't hats?

If you're anything like me it's pretty fetching low. Nobody doesn't have this problem. No matter how good we think we are, we always make mistakes. Or maybe we don't make mistakes but our environment is janky. We rarely understand the real details of what we're asking the computer to do for us. We're frequently surprised.

I hope that an inspection of your history will convince you that this is accurate. I have so little confidence in the code that I write. Fun fact: I have even less confidence in the code that you write. The process of translating what we want the computer to do into the language that it understands is incredibly leaky. Even though you wrote the code, you just don't have high certainty about what it does. Really.

3. You suck at knowing what your code should do.

You're going to write software and then it is going to execute. It's going to execute in foreign environments with user-generated input. There is virtually no way that you can predict or test for all of these variables.

That software, assuming it works at all, is going to give users some level of satisfaction. Based on that satisfaction they are going to award you some amount of money. In this scenario, both satisfaction and awarded money might be less than zero. Lol.

How do you maximize satisfaction? How do you minimize disasters based on environmental things you don't control? One solution is to never give your software to users. That provides a very solid lower-bound for satisfaction and requests for refunds. Unfortunately, it also provides a frustratingly immutable upper-bound as well.

Here's the real kicker: You have no idea what your users want. And you have no idea how your software is going to behave when it's in the real world. Will it crash given very specific input? Will it offend your customers? Will it be a smash hit? You're a programmer. Who fetching knows? Not you.

~~~~

So, you suck at writing software. My condolences.

Let's briefly talk about what humanity has learned about overcoming these problems. Please note that we can't completely negate them. They will always be with us. But we can use strategies to make them less painful for us. At the end of the day, you're never going to be a good programmer that doesn't have these weaknesses. You're just going to put practices in place that negate some of their suckiness.

Problem 1 was that you don't understand the rest of your code. There are a few solutions to this.

First: You minimize the cognitive cost of understanding any one unit of code. As you write a new {module, class, method}, you make sure you write it cleanly a la Uncle Bob. Except without the racism. You name things well. You refactor for clarity. In fact, you make clarity the most important freakin' thing about that code. That's all you actually care about. It does the job, and it's incredibly clear. By reducing the cognitive cost you allow yourself and others to fit more code in their brains at once. This leads to fewer window errors.

Second: You leverage abstraction appropriately. You know what abstraction is? Abstraction is "only caring about the parts of something that you really need to care about". Let me give you an example.

Suppose your code uses a Myles. Myles, in the real world, is a person with glasses, hair, and an incredibly diverse array of bacteria in his gut. But representing that in code would be very difficult. What your code cares about is Myles' ability to writeCode().

So your class DevTeam has a Set of Myles in it. But that's just stupid, because your DevTeam does not need to know about Myles' digestive system. So you make Myles implement an interface called CanFetchingWriteCode. And now your DevTeam has a Set of CanFetchingWriteCode. 

You've taken Myles, a very complicated idea, and abstracted it down into what you really care about. Ignore the other parts. They are neat, but not important to your DevTeam.

Third thing here: Write modular code. Reduce coupling. Specifically: Make sure your code in DevTeam knows as little as reasonably possible about your code over in CafeteriaLine. If understanding DevTeam requires understanding CafeteriaLine, your cognitive cost here goes through the roof. Do what you can to decouple them.

~~~~~

Problem 2 is that you don't really know what your code does until it executes. This one is stupidly simple to solve. You just execute your code all the dang time.

Write automated tests that execute the code you just wrote. That's it. That's the whole tweet. Just write tests. Are you thinking about committing some code to the repo? You should execute it first. And the only responsible way to execute it is to wrap a freakin' test around it.

"But Chris, the code I just wrote is resistant to testing!" Well dang, you just wrote code that sucks.

But in a more generous tone; Take whatever "change" that you just made to the existing code and isolate it into something that can be tested. And then test that!

The second solution to this problem is to run your full software frequently. This would likely involve releasing it to customers far more frequently that you're used to.

"But Chris, I can't release this software! It will break something!". You're absolutely right. Your job is to reduce the pain of failure. Here's something that you should really just accept: You're going to break things. I don't care how much QA you have. I don't care how carefully you test. If you're releasing software you are going to freaking break things.

Given that breakages are going to occur, let's just accept that they will happen and let's do what we can to make those breakages less costly. This is called harm reduction. It's the same principle behind needle exchanges, btw. We're going to release our new software to a small percentage of customers first. We're going to have a way to roll customers back to a safe version without a disruption of service. We're going to be able to toggle on and off new features at runtime to get things into a working state.

Can we talk about needle exchanges? The idea is that people are going to do drugs. If they don't have clean needles some percentage of them will use dirty needles and get Hep C or something and cost the state more money. In order to reduce the money the state spends on Hep C, the state sets up a needle exchange booth where people can trade dirty needles for new needles. This reduces the incidence of Hep C and saves money (and lives, maybe). It also creates a safe place for people using drugs to get in contact with people who could offer help. I'm a big proponent of needle exchanges.

There are a lot of less-progressive voices that think needle exchanges are stupid. They dislike the idea of helping anyone do drugs. Offering needles equates to assisting someone in doing drugs, and that feels wrong. We should not be promoting this behavior.

I'ma punch that straw man down, if you'll allow me. The drugs are going to happen either way. That is not something we can stop. Would that we could. But we just can't Nemo. We can accept this truth and try to reduce harm, or we can complain about it and let people get Hep C and then pay for their medical bills. Harm reduction is a cool idea.

We're going to get our software out to the real world as soon as possible and we're going to gather data about how it behaves. We are going to release bad software. But that was going to happen anyways! The key here is to release software that is carefully bad. Specifically: we're going to focus on reducing our mean time to recovery instead of reducing our number of incidents. Releasing 100 bugs and recovering from all of them in 10 seconds each (1000 seconds of downtime) is so much better than releasing exactly one bug with 5000 seconds of downtime.

We're going to stop trying to never release a bug. But we're going to make the cost of bugs much lower.

~~~~

Problem 3 is that you don't know what your code should do. Or, you don't know what the customer wants. Or, you don't know what the market is going to do in three weeks so you might be building the wrong thing anyways.

First solution here is to release frequently. Yeah, you know how frequently you're thinking of releasing? Consider releasing faster than that.

Release and get feedback. Keep your code in an always deployable state.

How do you keep your code in a deployable state? You use trunk based development (aka continuous integration) and you take measures to commit safe code. That means you put risky code behind run-time toggler (look up the article(s) about feature toggles on Martin Fowler's site already...) and you protect your butt with a nice deployment pipeline.

When you're tempted to put your code in a non-deployable state, ask yourself: "Am I willing to throw this code away if priority changes in one week?" If the answer is no, then take measures to maintain releasability.

~~~~

K, that was a fast push through the jist of it. I hope that doesn't suck. Good luck and have fun!

Please hit me up with feedback in the comments section. Thanks.

Wednesday, February 12, 2014

Morning Microwave Burrito

It's 2:05 AM and I'm eating a microwave burrito. I normally eat two of these at once, but I'm trying to be reasonable considering I should have been in bed two hours ago. I was hungry and didn't feel like sleeping. So now I'm eating a delicious burrito and blogging for the first time in 1.5 years.

Lots has changed in 1.5 years.

But this isn't the place to talk about what has changed- this is the place to talk about what's going through my head at two in the morning.

I got "encouraged to apply for a job" today. That means that there is an opening and that someone linked to that opening encouraged me to apply for it. This is always a very flattering experience, and given the respect that I have for the individual who encouraged me to apply, it was pretty cool.

The problem with being a developer about to graduate is that there are lots of viable jobs. You have to pick the one that is best for you. There are tons of factors to this- money, the tech stack, the experience you'll get, the people you'll work with, the potential for career growth, etc.

I already know where I want to end up when I graduate. But the future is a terribly long time, and I'm planning to do this whole software development thing for a long time. I can't just stop thinking about what I want to do when I grow up because I know the first place I want to work when I graduate. I could stay there for ten years and still have a good twenty plus years to work other places and develop other things. I suppose this is a longer way of saying that I want to make good career decisions but feel overwhelmed by that responsibility. I additionally feel a little bit overwhelmed by the need to balance my current financial needs with the chance to go do some original and exciting things. A lower paying job could yield more varied experience. It could also yield eating rice and beans for a few months until I graduate, and I'm really a little too fond of these burritos to accept that kind of fate.

So what do I want to do when I grow up? Well, I really like the idea of having customers. I really like writing software that makes a difference to someone. Not like, the whole meaningful difference you make in someone's life when things get sentimental and blah blah blah, but I do like having an impact. If I make a horribly mangled feature I'd like to have someone get mad at me. The only reason I want that is so people will really really like it when I make something elegant. I like the idea of my code affecting human beings.

I'd really like to do something that had a net positive impact on the world. One of the cool things about software is that you can work in nearly any industry you want. Everybody needs software these days. I'd like to do something that helps people. I'm not sure what that looks like yet, but I want to give it some thought. No Flappy Birds for me; I'd like to make things better.

Recently I've been thinking about growing up to be head of development somewhere. Mostly because I think the last head of development I worked with was such a rockstar. That guy just oozed good leadership. The company he works for is way better off for having him. He makes a big impact on pretty much all the developers who work there, including all the Summer interns they bring in. I think what I like about that human is that he has such a positive impact on the people around him. They write better software because he's in charge. I'd like to be qualified to do something like that one day. I'd like to have the experience and wisdom to be able to take a situation and make it better.

As a sidenote, I totally have a plan to make this work. Once I'm out of school (oh hallelujah) I'm going to hit the gym six times a week. I'll bike for 30 minutes a day (Or, you know, elliptical or jog if I'm feeling it). For those 30 minutes I'll read good books on sofftware development. That way I get awesome exercise and get to experience some pretty good ideas in the field. Sign me up for the two for one combo.

I would really like another burrito right about now.

So what software do you write? What software do people need right now? How do you effect a positive change (and yes, I'm pretty sure that's the correct spelling of effect right now) via some product you create and sell? I mean I could certainly go work for the church, but I'm not really feeling that career path right now. I could work in an educational setting (writing software for educational purposes), and maybe that'd fit the bill. I have trouble profiting off of education though, you know, since I've gotten all of mine for free. I think products that give people information and allows them to make good choices is a pretty good option- mint.com comes to mind. Maybe I can find or create something like that.

I mean, if you're going to spend 40 hours a week working on something, wouldn't you like to work on something that makes the world a better place? If you're going to painstakingly craft a highly specialized tool over the course of a few years, shouldn't that tool be used for good purposes? I understand that money is important (sure do), but I would like to feel good about making money doing something beneficial for everybody else.

I suppose most software isn't evil. Some of it is. I think most is pretty neutral. But I'd prefer brashly positive over neutral.

I don't know what that looks like yet. And I'm not sure what skill set I should really pursue right now to spec myself out to accomplish that. My current plan is a very solid and reliable foundation (hooray for being a Java developer), along with really solid engineering understanding and experience (I'll test my code even if nobody else will). Along the way I'll start building things for me using whatever new and fun technology is around. First up is a bug database with a Jersey backend and Angular front end. Then I'll have to publish a few Android apps this Summer. I have no idea if this is the optimal path for me. I could do more research to figure it out-- but there are about a bajillion unknowns so it's really hard to tell. This certainly isn't something to complain about. If I had a slightly better attitude right now I think that I could really celebrate because of that. Things keep changing, so there's a good chance that things will improve for you. Given a dynamic system, being a real agent that makes real decisions is a really good thing. Since things are constantly changing you constantly have chances to improve your situation. Sure, if you weren't able to make choices it wouldn't do you any good. But being able to choose in such a dynamic system gives you tons of opportunities. Fine, I'll be more cheerful about all this.

I never worried about saying too much online before. I do a little bit more now. I have a little more on the line- employment, a wife to take care of, all that good gravy. In the past it was a piece of cake. One thing that gives me comfort is the vast amount of information one can put out there. I mean, seriously, I don't care how dedicated you are to your job, you'd have to be pretty serious about stalking me to have read this far. And if I post like this every day for a year, there will be crazy amounts of text to read through. You could certainly automate that process, but what's the fun in that?

It's good to write again. I know full well that it is not high quality writing, but it's a pleasure to communicate. Not that there is an official recipient of this message. In fact, there's a high probability that no one will *ever* read it. But it feels good to me. It feels nice to say some things that are on my mind. It's something that I have missed a lot.

Things are good. School is honestly pretty good. I feel like I'm a better student now than I have ever been before. Sometimes I feel like I am not making any progress towards graduation at all, but I know it's coming. I have been way more diligent in my homework and studies than normal this semester. I have some cool classes. I've been loving my extra curricular activities. The ACM is going really well and seems to be making a positive impact in the department. I sure enjoy it. Work is a blast. I haven't had this much fun at work in a really long time. I'm implementing some outstanding feature requests we've had for a while. It feels fantastic to add functionality that wasn't there before. I love knowing that I make someone's tasks a little easier to do. Maybe all this fun of feeling like I contribute meaningfully to the success of the product will wear off one day, but for now I'm having a great time.

The future is pretty dang interesting. I have a few options. It's mildly terrifying to know that I can pick whichever option I want. There's a lot of comfort in that, though. Choosing our path is the way that it's supposed to be. It's really nice to have that luxury of choice right now. I need to cheer up and appreciate that more. Not everybody gets these opportunities.

As a happy reminder, I'm where I am now because of choices that I made in the past. Some of those choices were good, and some of those choices were bad. The important thing to remember is that where I am in a year will be directly influenced by the choices that I make between now and then. What choices will lead to the best outcomes? That depends on what I want those outcomes to be. Without defining a goal it is crazy hard to know which choices to take. Curse you, Cheshire Cat, for teaching us such a timeless truth.

It is sleep time. I would like to publicly congratulate myself on only eating one burrito tonight. Sometimes I eat microwave burritos on a plastic plate using some really fancy silver we inherited because all of our normal civilian forks are dirty. It's a mildly ironic situation- a very easy and unsophisticated meal delivered by the nicest stuff we have in the house. But I guess that's life sometimes. Everything doesn't always match up, but that's okay. You do the best you can and really enjoy the microwave burritos.

Sunday, August 19, 2012

Palindromes

Welcome to the palindrome Q&A post! I hope you enjoy.

Q: What is a palindrome?

A: A palindrome is a sequence of characters that reads the same backwards as it does forwards. Consider the word "racecar". If you read it front-to-back you get the letters r-a-c-e-c-a-r. If you read it backwards you get the letters r-a-c-e-c-a-r. So, "racecar" is a palindrome because it's the same backwards and forwards. You can make palindromes out of numbers, and those are the ones that you'll see most on my Facebook wall. the sequence "13331" is a palindrome. Get the idea?

Q: Why do you keep posting pictures of odometers on your wall?

A: I post pictures of odometers when they are palindromic, or when they read the same forwards as they do backwards. This is a special event in the life of each odometer and I think that it deserves to be recognized. Depending on how many miles your car has, this may or may not happen all that often. It's a fun nerdy hobby. Some people watch birds. Other people watch odometers. 

Q: Where do you get all of these pictures?

A: I posted my first palindromic odometer picture of June 29th, 2012. By August 19th I had received 27 pictures from friends of their own odometers when they achieved palindromicity (note: that's not actually a word..... yet). People from all walks of life have snagged the pictures and sent them in. So far I have received pictures from Utah, Idaho, California, Florida, Texas, Ohio, Montana, Wyoming, and Maryland. Only 41 states to go! I'm not sure why, but everybody seems to love catching their odometer when its a palindrome. I honestly never expected this to catch on. I've been shocked by the number of people that come up to me in the real world and tell me that they're working hard to find me a palindrome. It's a pretty great feeling. 

Q: Okay, I want to play, how do I help?

A: You can help by taking a picture of your odometer the next time that it is palindromic. It should likely happen somewhere in the next 1100 miles. Snag a picture of it when it is palindromic and send me the photo. The easiest way is to send me a facebook message or an email at cjthatcher, you know, at gmail.com. Attach the photo as well as any additional information you want to include. I can't promise it will be posted super quickly-- I have a backlog and I don't want to spam people by posting more than one a day, but I do promise that it will be posted. 

Q: Taking these pictures while driving sounds pretty dangerous...

A: So, you're right. You should definitely do everything you can to be safe while you take this picture. My favorite method is to drive with a buddy and have them take the picture while you drive like a normal human being. If that is not possible, consider pulling off to the side of the road (you know, uh, safely). As much as I love palindromes, I feel like your life is worth more than a cell-phone-camera-quality picture of a cool string of numbers. Please be safe. 

Q: So, uhh, aren't you worried that no one will ever go on a date with you again because you post about number theory on Facebook every night?

A: Yes.

Q: What if I think this is all sort of stupid, can we still be friends?

A: Absolutely! I have great respect for people who thinks palindromes are stupid. 

Leave me a comment if you have any other questions that I haven't covered yet. Much love~