Skip to main content

Breaking Changes? Don't!

Sometimes other developers give me a funny look when I spend extra time decoupling code, or adding some extra configuration.  I explain to them that it allows for future changes to be easier, and they agree, but sometimes I get push-back and it just doesn't seem worth it to them.  So here's some perspective.

I have a confession to make: I hate python.  I can't stand it.  I haven't always been this way about it though, particularly, the things I hear about it on XKCD consistently make me take another look at it time and again.  The problem is, every time I go to look up some basic tutorials, I plug them into the interpreter and they break.  Even Hello World!

Why?  Because the makers of Python accepted a major breaking change into their code base after the language started to get popular.  In my personal opinion, if you make changes to your language that break a hello world tutorial, then your language can't be trusted long enough for me to spend time learning it.

That's not to say that all breaking changes are bad. Eric Lippert discussed a breaking change in C# 5 that's coming that is perfectly reasonable, and it will affect a large amount of code, as it involves the extremely useful foreach loop.  Yet the breaking change was behind the scenes, inside of a black box to most coders.  The only people that will notice it, are the ones who've been working with the language so long, and so deeply, that they're watching for these things anyway.

Python did it wrong.  The change they made is on the surface.  It's visible to every user every day.  It breaks almost every application written.  It's big, and ugly, and they either didn't consider the consequences, or they were too eager to get the language out there to prepare for this sort of thing ahead of time.

Look, I'm not perfect.  I don't write code that will never have to encounter a breaking change.  I try to keep from having to have breaking changes with good practices, but no one solution is perfect.  When we encounter a change, there's a reason we have change committees, and red tape and paperwork.  It's to ensure we keep things working as expected.  If the change is breaking, spend some extra time to do research.  How much of the code base does it affect?  How often is the broken code used?  How many old programs is it likely to affect?  If we don't consider these options, then who knows what you might run into, and that's why you plan ahead.


Popular posts from this blog

How to identify a skilled programmer during an interview

How does one identify a skilled programmer?  No company that has interviewed me could tell the difference between myself and other programmers they'd interview.  The interview process is truly a game of luck in this industry--on both sides.  Both the programmer and the company are basing their actions entirely on luck.

Companies have come up with numerous methods to attempt to discern a good programmer from a bad one.  The best tricks they have include a series of math problems, algorithms, problem solving technique tests, and even obscure programming questions, some without definitive answers.  As an example: Is there an authoritative source of information on the core principles that define object oriented programming?  I've heard everywhere from 3 to 7.  In a field of research about a synthetic concept, an authoritative answer is almost impossible to obtain.

Programmers were then forced to study to the interview.  Careercup is one of my favorite sites for this.  This almost …

Dependency Injection - You're doing it wrong!

So I have worked at a lot of places and seen a lot of different styles of programming.  Early on in my career, I became acquainted with the concept of dependency injection.  It was a hard topic to grasp, but I have learned understand it deeply.  Now, when I step into a new application that uses it, I can very quickly see the flaws in the implementation, and there's a common one I want to talk about today: global singletons.  But we'll get to that in a minute.

What is Dependency Injection?
Dependency Injection is exactly what it sounds like.  You use it to inject your dependencies. The unique part about Dependency Injection though, is that you can do this at runtime.  Now this sounds fancier than it is.  By inject we don't mean they're downloaded for you.  You still have to have all of the parts installed where you want to run your app.

Dependency Injection is somewhat of a complicated topic to a newbie.  Let's start with defining the word dependency here.  Specific…

Managing Programmers

Working with other programmers is tricky.  That said, it's nothing compared to the job of managing programmers.  One of my favorite quotes about Perl is that (paraphrased) "a Perl developer is like a rockstar.  Now imaging having a bunch of rockstars in one room together and you will understand why you don't want an entire team of Perl developers."  It's not about Perl here though. What's important to understand is that any developer worth his salt is going to be like a rockstar.  And yes, there are a lot of professional developers out there who aren't worth their salt, but that's for another post another day.  Rockstar may not be the right term here, but think of it this way.  These guys are smart.  They may not be geniuses, but there's going to be things that they know that you don't and probably never will.

I've seen it more than once and it's not going to make some Product Managers happy, but I'm going to state a fact, an eleph…