Posts tagged Programming

Tech Debt is Anything But

Recently I’ve been involved in a lot of discussions regarding Technical Debt. A lot of the discussions boil down to “we have a mountain of tech debt, how can we pay it off?”. To me this is fundamentally the incorrect way of looking at the problem and the terminology is partly to blame. When we think of debt it’s something that you can pay off and if you don’t go into debt again you never have to worry about it. But there isn’t a system out there that doesn’t have some Technical Debt.

debtThe most pristinely architected, well written, accurately commented, OOP, SOLID, unit tested code now, will in the future be some form of tech debt, either because the code was written with incorrect assumptions, wasn’t maintained, or the knowledge about it was lost and people became afraid to touch it.

Technical Debt is the wrong term, we should be talking and thinking about Preventative Code Maintenance.

If you think about it the products your company is creating is somewhat similar to National Infrastructure. The ‘sexy and sizzle’ parts of both Infrastructure and Code is the creation of new: new features, new products, etc. What doesn’t generate sizzle? Routine maintenance.

Take a look at this video from John Oliver’s Last Week Tonight about Infrastructure (somewhat NSFW).

The issue is you can’t take an “all or nothing” approach to Preventative Code Maintenance. For example you can’t just do one off, large projects to fix issues “the Technical Debt style” nor can you do all small incremental updates, a “Scout Coding approach”.

Preventative Code Maintenance can help catch and correct issues before they get too big. But teams need to be empowered to tackle these issues when they are small, and manageable. Far too often an issue is just tagged as a ‘Tech Debt’ item and pushed to the backlog, where it is constantly push down and deprioritized until the issue is so large the business is unwilling or unable to take the issue on, until that is the issue starts impacting the business.

But before an issue ever starts impacting production there is a time when it can be mitigated. But at the time the issue could be deemed too small or too unimportant to take care of.

Preventative Code Maintenance “PCM” should be the #3 priority permanently on your board

Why #3? Well we do need features and enhancements, it’s important to our customers and to sales. There usually is an important bug or other non-preventative issue that needs taken care of. But always plan and prioritize taking care of preventative issues when they are small, unassuming and seemingly unimportant is far more cost effective then waiting till they are costing you business. In your scheme you should block enough weight for the Preventative Code Maintenance task as well. Use Tee-shirt sizes? PCM is always an L, Fibonacci? Put it at the higher end of your scale, (5 for the places I’ve worked). Doing 2 week sprints and just use days? Give it 2 days.

At first you may only be able to get one PCM done or maybe partially done. But as time goes on you will be able to get more and more done in that time frame. Given time and effort it will end up being truly preventative. You can obviously do more Code Maintenance then just the ones you can fit into the one item, but the goal is to always be working on some PCM.

Don’t delay maintenance until it’s costing you business or customers and reached the point where it most likely is expensive and painful to tackle. Be proactive and tackle the issues when they are small, cheap and easy to fix.

If you’re a First Responder or know one check out Resgrid which is a SaaS product utilizing Microsoft Azure, providing logistics, management and communication tools to first responder organizations like volunteer fire departments, career fire departments, EMS, search and rescue, CERT, public safety, disaster relief organizations.

The Programming Career Path

I just read ITWorld’s quick blog titled “Is Programming a Lucrative Profession” which focus on salary, benefits and stability. All of which are incredibly valuable and important to cover. But to me lucrative can mean different things. As a person who loves learning, challenging intellectual work and a laid back professional environment professional programming fits the bill for me, it’s another part of the overall package.

Can you make money being a programmer? Absolutely. Can you make a good living being a programmer? Again yes. Will you become a millionaire? Probably not, at least not working for someone else or taking risks on compensation like stock options in startup companies. But I’m going to focus on someone who wants to program and live in an existing corporate structure, the bread and butter of the programming legion. In that context is programming a lucrative career? No.

To me, having a career and a job are two completely different things. When you have a career you have a path for promotions and bigger and better things, or upward mobility. The pinnacle of upward mobility is an executive level (CxO) position at a large company, this is where you can make millions without having to do it yourself or taking risky jobs at startup companies.

I started out my technology career repairing computers and got a job working at a help desk of a credit union. After a year on the job I realized that the end of my career path was, at best, an IT manager and more likely just a Help Desk Supervisor, plus the money wasn’t good at all. So I moved to working on Servers and Networks and became an Administrator. The money was better but the career path didn’t look a whole lot better. Being a Administrator I had an easier path to become an IT manager, but not a whole lot So I switched to development work, it was a passion of mine, and the immediate benefits were better. But was it the best career move?

My current view is that without a healthy understanding of business moving into an executive level position is almost impossible. They are more likely to promote an MBA who has upgraded his RAM at home once to a CTO then a hardcore programmer because it’s a business position more then a technology position, should that be the case, no, but it’s reality.

Development can be a lucrative profession and a lucrative job, but it’s not a lucrative career when compared to other professions. Doctors, lawyers and accountants all lucrative jobs and careers. But having good business knowledge and communication skills are as vital to some of those as well (i.e. Accountants) but never paired with technology professionals, were still trying to shed the past of poorly dressed, groomed, eccentric and unsociable technologists of days yonder. Being an accountant is inherently “business’ie” but technology isn’t and as such we have a handicap that needs to be overcome.

Technological skill and business knowhow are a potent combination to career success. Your professional goals may never to be an executive, but neglecting the business side of technology can hurt your chances to progress in your career and become an Software Architect, or Development Manager as well. Programming can be a very lucrative career when coupled with solid business knowledge and good communication skills, but programming by itself isn’t.

The Dangers of Copy/Paste Coding

One of my blogging hero’s Jeff Atwood blogged about this a few months ago, but it never really hit home for me until recently. I’m a “Don’t reinvent the wheel” kind of guy, I much rather spend time building direct business value then working on plumbing. So being the blatant rip off artist that I am I use Google for answers to things I think are common.

I stumbled upon BouncyCastle a little while ago when trying to find a way to move away from Chilkat’s encryption library to one that would allow me to compile my assembly with the “Any CPU” flag. But to my dismay they have a very limited amount, bordering on none, of the samples and documentation I needed to use their library. So I turned to my old friend Google for some answers.

What Google returned for me was a post by Havard Stranden on his blog, someone who I’ve read before and even used his Copyable software before. Havard had exactly what I was looking for, and some code examples, I was so happy. So I begun the art of copy and paste and was on my way.

I’ve started to use Unit Tests a little more then in the past. I’m not part of the religion by any means, more of an observer waiting and watching for the spiked punch to be rolled out and the show to begin. I usually use Unit Tests to fix problems or reaffirm my knowledge, because I still didn’t have a lot of information on BouncyCastle I wrapped Unit Tests around my RSA encryption and started testing.

Well some of my Unit Tests failed and some others threw exceptions. I blamed everything but the code I copied and pasted from the Internet. I changed my encoding at least 5 times, I changed my wrapping and conversion functions another 5 or so times, and so on. I wasted about a week trying to figure out what was wrong, why could I correctly encryption and decrypt a small block of test, but not a larger one.

Finally I stepped into the code, line by line and observed what was occurring, and I finally found the issue. This was the inner loop of my encryption and decryption methods, which basically chunk through and array and encrypt and decrypt each chunk. Can you guess where the problem was?


What I found out was chunkSize was going negative, or to zero, a lot. If what I was encryption was less then the blockSize, which is how many parts of the array the RSA encryption function can handle at a time, the I was good. But if it was a larger amount of data it would completely bomb out.

What I ended up with was more then I think one line can handle, but I could be wrong. Basically there were three cases I saw, and I put some if statements in to handle them.


I don’t know why I didn’t dawn on me to check my copy/paste programming first, but I’m so used to finding code that just works I rarely check to to ensure it does. The code probably was a quick sampling or a mock up and not his actually production code. I have no idea where it came from but assuming it was ‘live’ code was the wrong thing to do. When I started having problems that’s probably the first thing I should have looked at, as it was the only thing I didn’t completely understand or write myself.

So word to the wise all you Copy/Paste programmers, check from time to time to ensure the code works properly, else you could burn many hours tracking down issues.

P.S. Sorry Havard, but I don’t know the Alt code for that special A.

Go to Top