Don’t add unnecessary code.

Many people do this for a variety of reasons.  Don’t be one of them.

Why do people add unnecessary code?  It can happen for several reasons.

Sometimes it’s a fun bit of extra stuff. Avoid this. Write code to create business value, not for your own amusement. If you have that kind of itch, start a side project.

Often you will see developers writing code in anticipation that it may need in the future. Don’t do this. Only code to the current requirement. Most of the time, anticipatory code goes unused. YAGNI – You Ain’t Gonna Need It.

For some, it is easy to add a little extra code rather than ask if it is really required. Please, if you’re not sure about the requirement, you’re not talking to your business partners enough.

Occasionally a programmer invents extra requirements that not documented or even desired. And the requirements turn out to be bogus. Work with the business and meet their needs, deliver working software that adds business value. Everything else just causes problems.

Deleted code has fewer bugs.

This is a simple one.

Sometimes the problem with a complex code base is that there is simply too much code there.

There may be code that was created as a spike, to explore ideas, or to support business functionality that is no longer used or wanted. This code should be deleted. Leaving it in place only confuses the reader, and worse, may give other programmers the impression that the code actually belongs there and should be used.

Other code may be horribly complex and could be refactored to a simpler solution. Add five lines so you can delete twenty.

Don’t make things more complicated than they have to be. You’ll be amazed how often stuff gets over-engineered with highly complex code that needlessly adds confusion to a project.

Beware human errors in transcription.

Anytime someone has to type data in a field, bad things can happen.

This occurs in many places. During software development, a transcription error can occur when copying data and formulas into the code. Errors can also happen when copying logic from a whiteboard sketch or other diagram. One must always be careful here, and having good test cases with accurate examples is a must.

For the user, errors can easily occur when they are entering data into fields. Here, you need to add sanity check to the inputs. An SSN should have nine only 9 numerical digits. A phone number should not have letters. Date of birth should not be in the future.

Where possible, you can have the user select from drop down lists to limit options and reduce the chance of error. Alternately text boxes can checked against lists of known good values, if the drop down would be too long (like in the case of state codes). 

For more complex fields, auto-complete against a searched table may work. In other instances, a complex regular expression will do. But the more you can avoid a user accidentally typing bad data, the more problems you’ll avoid.

Follow conventions when naming things.

Classes, methods, objects, data elements – please be consistent and predictable.

Establish some good naming conventions for your team. Follow the conventions always.

If you are working with a framework, then follow its conventions where possible. This will benefit you greatly when you add people to the team who have worked with the same framework at their previous job.

With the right conventions, everyone should know what the obvious name of a new object should be. There should be no surprises.

It should also be immediately obvious what the name represents when you encounter the name in the code.

Following this behavior accelerates development and reduces bugs.

Don’t start without a plan.

Writing software goes a lot better if you plan first.

Software architecture is important. If you just code randomly you’ll end up with a  jumbled mess with lots of redundant parts that end up doing similar business functions in a different way.

Get others involved when you plan. Never develop a plan independently. This should always be a group effort.

If you fail to plan, you will need to a ton of rework, both in the short and long term. You’ll create a mountain of technical debt. Don’t be that guy.

An Elegant Puzzle

A previous manager gave me this book last year. He was impressed by it and gave a copy to everyone on his team. After reading it, I can see why; it’s a fascinating read, and maybe one of the best books on issues unique to the management of software engineering organizations.

The author, Will Larson, has bona fides from managing technology in some well-known, high-profile organizations, including Digg, Uber, and Stripe. Not all of the ideas in the book are going to be useful to everyone, as most people manage much smaller organizations than he has. Still, there is a lot of gold to be mined here for any manager.

He starts with a discussion on the sizing of teams. While many of his ideas are wise, he also neglects to identify how certain specialists fit in an organization. For example, maybe his ideal organization has six teams of six software engineers each, but then where does the DBA fit in? Also, in my experience, not every employee requires the same amount of management, so sometimes a team is a better fit at four people instead of seven… or vice versa. But the general ideas he has in the book are sound.

Other areas of the chapter regarding teams had lots of great insights. Larson gives his opinion on when to grow teams, how to handle rapidly growing organizations, and giving teams the slack they need to operate effectively. There are also comments in here about reducing interruptions to make teammates more effective. He closes out the chapter with some thoughts on succession planning.

The next chapter talks about tools, in particular establishing metrics for the processes around software engineering. After all, you can’t improve what you don’t measure. He also talks about the process of paying down technical debt by doing migrations.

The chapter then goes into topics like IT controls, presenting ideas to the bosses, and time management. It also talks about creating communities of learning. Honestly, the book is packed with topics, with new gems appearing every few pages. It’s simply amazing how dense it all is.

Chapter four delves into the topics of policies, relationships, and managing priorities. He also talks about the various problems managers have in the act of, well, managing.

Chapter five explores the various aspects of company culture. It starts with identifying those people with the greatest potential to become future leaders and how to develop them. Among the ideas here is the danger of the hero programmer, and why that role needs to be defeated.

Chapter six talks about careers. It starts with advice on defining roles and recruiting talent. Then it moves on to reviewing employee performance, when to promote, and what kind of career levels one should have in an organization. This, of course, comes back to metrics once again.

Finally, in chapter seven, he sums up with a list of books and papers he’s found very educational over the years. It’s a good list.

Overall, the book is a must-have for anyone who is involved in the management of technology organizations. While I don’t agree with every one of his ideas, I do agree with many of them. Because it covers such a wide range of topics, it’s probably a good idea to revisit the book every few years.

The Phoenix Project had great ideas.

This is an amazing book that reflects upon many of the problems software development organizations face on a daily basis. The story starts with a mid-level manager in a moderately large manufacturing company as he is suddenly promoted to head up IT operations. The previous head and the CIO were suddenly separated from the company; it’s not made clear if they left the burning ship of their own accord or were pushed out. The organization is in a massive death spiral. Technical debt is massive; there are no IT controls, and the number of change requests is in the hundreds. Managers are purely reactive and respond to whoever screams the loudest. It’s pretty horrible.

The first several chapters of this story demonstrate these problems in gory detail. It really feels like a horror story. Perhaps I had that unpleasant reaction because many of the issues described were so similar to the problems I have seen at several real companies. The political backstabbing, the shadow IT, the marketing people who feel free to disobey the rules, the people who go around other’s backs, the blame games… all of these I have seen at several real companies. Heck, one really good reason to work at small startups is that they haven’t gotten big enough to encounter these problems yet. The plot turns were so horrifying that I almost didn’t make it through the book.

Thankfully, the hero of the story, the new head of IT operations, starts to make a few smart decisions and changes processes for the better. It’s slow going, but he eventually starts to right the ship. He’s assisted by the “wise old teacher” character, who, aside from being a bit of a cliche, is fascinating to watch. Basically, he takes the lessons from manufacturing and helps the hero apply them to IT operations. Things like the Toyota Production System, Kanban, Lean, the Theory of Constraints, and many more.

Now, the problems in the book get resolved much too quickly to reflect reality, but the lessons learned from the various techniques are quite valid. They will make a big difference and can be applied to many organizations. As such, I highly recommend this book for IT operations and software engineering managers everywhere.

One of the biggest ideas in the story is that it is critical to model the workflow and identify the constraint. Modeling the workflow is also the first key point of Kanban, and Kanban’s ideas weigh in heavily in the book. Here, though, it is merged with the lesson from the Theory of Constraints: any improvement to the workflow that doesn’t improve the constraint is an illusion and a waste of time and resources.

There were many other important ideas, as well. Such as:

  • the importance of establishing metrics
  • identifying the various different types of work and allocating resources for each
  • reducing WIP, less multitasking (also from Kanban)
  • reducing cycle times and wait times (also from Kanban)
  • faster, smaller releases
  • automating parts of the integration and deployment processes
  • avoiding speculative code (YAGNI)

In addition, the sage in the book pushes the idea of the “Three Ways”. The first way is all about maximizing flow. The second way is about improving feedback, including alerts and metrics. The third way is about continuous improvement, which means applying 20% of resources towards nonfunctional improvements.

The book also spent a lot of time educating the reader on the four types of work. It identifies these as: 1) business projects, 2) IT projects, 3) changes, and 4) unplanned work (bugs and support issues). Only when all four are properly being tracked does the organization fully account for the use of resources.

Another lesson taught in the book was that much of the work in traditional IT Audits is a waste of time. This is a strange lesson, as finding material weaknesses is critical to system security. Perhaps the key thing here is that if an excessive effort is wasted on findings of low value instead of items that will increase business value, the result will be suboptimal.

Finally, things really don’t start turning for the better until the hero and his partners start interviewing the business unit owners. As part of the new focus on delivering business value, the goals change, and for the better. Also, the business unit leaders switch from being complainers to being champions, which is crucial towards getting their buy-in for the significant changes.

Overall, this book had an amazing amount of good ideas to offer. Also, it framed it in an exciting, compelling story. I highly recommend this book.

What have we done?

So, good news this week with the whole coronavirus situation. Up until April 2nd, the numbers here in Florida were quite alarming. The number of daily cases kept increasing every day. The number of people tested positive seemed to double every three days. Doing some back-of-the-napkin, I figured that, at that rate, before the end of April, the entire state would have tested positive and there would be no one left to test.

But then things slowed down. For the past couple of weeks, the rate of new cases has no longer been increasing. It appears that all of the drastic measures we have taken with social distancing have resulted in flattening the curve. Please note, that while the country was making noise about Florida being late to adopt restrictions, the three counties in South Florida (Miami-Dade, Broward, and Palm Beach) shut everything down in the middle of March, pretty much in line with New York City.

All events were canceled. Concerts, sporting events, any gathering of any number of people. All of the restaurants were closed for dining; those that couldn’t live on a greatly reduced delivery or take-out business had to shut down. Some went out of business. Businesses tied to the travel or hospitality industries were hard hit; I know of several that companies that outright failed as a result. Others had massive layoffs.

Service industries were shut down as well. You can’t even get a haircut anymore. This means even more companies failed, more people lost their jobs.

The cities have closed the parks and the beaches. Some put in curfews. Personal liberties have been severely curtailed. People are miserable.

The economic impact has been disastrous and will be long-lasting. Instantly, the country has been plunged into a recession. There won’t be a V-shaped recovery; there’s no way all of these people will suddenly get their jobs back. In many cases, there won’t be any jobs to go back to. And with everyone hunkered down, people are spending less, causing a greatly reduced demand for goods and services, which makes the economy even worse.

The government has been spending money like they’re in a socialist’s fever dream. People have been getting hundreds if not thousands of dollars. Unemployment benefits are boosted. The government has been giving countless small companies millions of dollars in forgivable loans. In addition, the Fed has been printing money like crazy and lowering interest rates to near zero. The scale of government intervention has no precedent. There will be massive long-term side effects as a result of this, most of which no one is thinking about right now.

Thankfully, all this sacrifice is paying off. The curve is flattening. Just look at the charts.

From here, you can see the cases per day has definitely leveled off. This is even more interesting when you consider that only recently has the number of testing kits available increased. So even with more testing, the number of testing positive has decreased.

Still, the number of people tested has always been a problematic statistic. We may never know the real number of people infected because even today, the general populace can’t get tested unless they are presenting symptoms to a qualified medical professional. But there is another statistic that is more reliable: the number of deaths per day attributed to the virus.

Here, we can see that the number of deaths has peaked a week ago. Also, the number of deaths per day looks like it’s in decline, which is really good news. So while our economy has been trashed, the government has been saddled with massive debt, and our personal liberties have been harshly restricted, at least we saved lives.

There’s just one problem.

Those charts up there? They’re not from Florida. They’re from Sweden.

And Sweden, as you probably know, is the one country that decided not to adopt extreme quarantine measures. In Sweden, you can still dine in a restaurant. In Sweden, you can visit friends. In Sweden, stores are still open. (Hell, I bet they still have toilet paper there.) They didn’t trash their economy. They didn’t plunge their governments into massive debts.

So why are they experiencing the same flattening the curve that we are?

What have we done?

Were all these heroic measures in vain? Did our trips to the grocery store infect everyone anyway?

The massive recession we have now entered, could it have been much less? The trillions in debt from government payout, the trillions in quantitative easing, the unlimited bond-buying facility… how can this not lead to the devaluation of the dollar and inflation?

Every day as I see Sweden’s situation improve, I get more frustrated with what we’ve done to our country here.

Don’t run with scissors.

Accidents happen when you’re not careful.

Deleting unneeded code and data is good, but you must be sure. Removing unneeded objects reduces complexity and follows the value of simplicity, and thus is definitely and exercise that one should practice. But you must be sure the object is no longer needed.

You can’t be sure if you are moving fast.

My Goals For 2020

New year, new goals. It’s an excellent time to reflect on 2019 and set new goals for the new year.

I had intended to write this in January, but life got interesting, and soon I was facing the challenge of starting a new job. I had to wind down my role at my old job, help with the transition, and prepare for the changes in my life coming with the new position. But now, I’m ready to get back to some writing.

Work was very stressful in the first half of 2019. There were a lot of problems with the systems, and it required several changes to processes to bring stability and sanity. Still, I tried hard to ensure I was also spending time on my own needs. As I get older, it becomes evident that there is only so much time left, and if I want to do things someday, then they need to start happening now. So while I managed to stay employed and continued to do great work, I don’t want to be defined solely by my day job.

Physically, I stayed in good health much of the year, having to fight a cold and allergies a couple of times. My back muscles also flared up a couple of times, which isn’t fun at all. For the most part, though, I was able to stay healthy and do the things I wanted to do.

Surprisingly, the stock market’s performance exceeded the expectations of most people. Despite all the hatred for Trump, the economy’s been doing rather well. Bitcoin rallied strongly until July and has slowly receded since then. Still, it was up about 90% for the year. Ethereum was down for the year, though, and most of the other altcoins lost a lot more. Stellar, Tron, EOS, XRP (Ripple), IOTA, Dash, and most of the other major alts were down a ton, sometimes losing over half of their value. Binance Coin was an exception; it was up big like Bitcoin was. Still, when Binance kicked their US customers off the system, their value reduced. They moved some of them to Binance.us, but residents of the largest states aren’t allowed to transact there, forcing them to trade on other exchanges. I still think cryptocurrencies are a good investment but should only be a small part of a larger portfolio, and one should probably focus more on Bitcoin. Predicting which of the altcoins will be successful has been very problematic.

So, how did I do on last year’s goals? Let’s see. 

A year ago, I set a series of goals. Here’s how I did on each.

❌ Write 4 short stories. Another year has gone by without making much headway on this. I tried writing backgrounds of characters, and sort of did a draft of one but basically failed at this goal

❌ Write 24 blog posts. I only wrote 7. I really thought this would have been easy. It turned out that I just couldn’t maintain an interest in writing blog posts. I did do a few on cryptocurrencies mid-year.

❌ Make new friends. This has never been a strength of mine. I do have people I game with, and I had some interesting experiences with some people, but none that I would really elevate to the status of “friend”.

❌ Achieve certification as an AWS Solutions Architect. Work was too much in crisis mode for me to spend a lot of time working on this.

✅ Finish 4 online courses related to cryptocurrency or blockchain technologies. I put this off until the fourth quarter but then managed to get through it.

✅ Master issues with cryptocurrencies and taxes.  This was a big priority in the first half of the year, and I feel comfortable that I’ve figured it all out now.

❌ Develop some kind of exercise habit and lose more weight. Unsurprisingly, I didn’t develop any exercise habits. And I paid the price by hurting my back a couple of times.

✅ Gain 15% on my portfolio. Amazingly enough, I managed 17% this year. Woot! I’ve been anticipating a recession for so long, and it always surprises me when we continue to have good years.

✅ Read 25 books. I track these on Goodreads, and read 35 books last year. I really feel great about this; reading all these books has been such a joy.

❌ Sell or donate more old stuff. The donate pile grew, but I didn’t take the time to organize it. Nor did I spend much time trying to sell things on eBay. My wife’s had some bad experiences with returns on eBay, so selling things there is discouraging.

✅ Take two vacation trips. They didn’t happen until later in the year, but I did get my two trips in.

✅ Stay employed and do great work. This seemed harder than it should have been, but things improved as the year went on. By the end of the year, though, I was wondering if there better opportunities with companies more worthy of my efforts.

Six goals met, six goals not met. Is it too ambitious setting so many goals? Perhaps. At least it’s a good target to shoot for.

Write 4 short stories. I’ll keep this as a goal until I accomplish it. I just feel that once I start writing, it could be the beginning of something big.

Write 24 blog posts. Not only that, but I’m also relaunching my blog with a change in technology. Medium was good, but I hoped that being on Medium would attract readers because of their curated content. Instead, Medium has focused on blogs behind its paywall. I don’t feel people should be obliged to pay money just to read my silly little blog posts.

Make new friends. This will be tricky as my new job involves a lot of travel. But maybe I’ll find a way.

Complete 4 online courses in new technology. Whether it’s blockchain or Rails or Python or something else, in my field, you have to keep learning, and I will definitely do that.

Catch up on periodicals. One of my bad habits in the past couple of years has been not keeping up with the periodicals I subscribe to. This year I’ll catch up on them and cut back on the less interesting ones.

Develop some kind of exercise habit and lose more weight. Actually, it’s not just about the weight; I’ve lost a few pounds just through changes in diet. But to avoid future issues with my back, I want to strengthen my core some.

Gain 15% on my portfolio. As I write this, the market is entering a bearish phase, so this could be a challenge.

Read 25 books. I’ll be spending a lot of time in the car because of my new job, but I will likely use that time on podcasts instead of audiobooks. So reading will be the traditional way – with an iPad.

Sell or donate more old stuff. There’s still boxes of stuff that I need to go through. After that, I should probably sort through older possessions and trim down on those as well.

Take two vacation trips. This will likely be later in the year as I just started a new job. Plus, there is the whole virus thing going on right now.

So those are my 10 personal goals for 2020. Not included in this list are business goals, as those are separate and unique to my company, and less interesting for a blog. In January of next year, I’ll review these and see how I did. Hopefully, I’ll do better this year.