Dear Idiotic Developer

Dear Idiotic Developer:

OPC is our internal slang for Other Peoples Code.  I’ve talked about this before but just in case you’ve never been here before, OPC projects are always the most dangerous kind of projects to work on.  They can quickly become a rats nest and cause no end of grief mainly because you have to figure out what the original programmer (or programmers) was thinking.  Because it’s a Friday afternoon and I’ve been up to my elbows in digging through your OPC project all week here is my list of complaints:

  • Poor variable names:  Variables such at ‘tmpd’ and ”bDbDl” don’t tell me anything.  Long variable names aren’t going to kill you and using Real Studio’s autocomplete will (usually) make this a non-issue.
  • Three Letter Acronym (TLA) Variable names:  Stop being lazy and use some real words.  Obviously you didn’t expect someone else to read your code in five years.  If I ever find you I promise I will mock you.  I hope you are doing a better job of naming variables in your new job than your last one!
  • Poor method names:  Methods named “SelAcc” and “DoWork” don’t give me any type of clue on what it does – especially when you have no comments in your code.
  • Nested If-Then Blocks from Death:  There are times you need to do this but it’s been my experience if you’ve got more than 2 or 3 at any given time your method is too long and should be broken up into smaller methods.  Keep it simple.  Complexity kills.
  • Multiple nested loops from death:  See nested if-then blocks from death above.
  • Long methods:  This kinds of goes with the previous two.  If your methods scroll and scroll and scroll you have a problem.  If you had a problem in that method (i.e. it throws an exception) good luck finding the problem.  Break it up into smaller chunks of code.  Perhaps you can take the 100 lines of code you have the first part of your IF statement and break that out?  Just sayin’.
  • Controls using the default names:  Really, you expect me to figure out the difference between TextField1 and TextField11 by making me look at the UI?  Next time, please use a name that will mean something to you in code.
  • Controls using generic names:  On the flip side you used a name different than the default one.  Good for you.  Perhaps next time you can use something other than ‘s’ for its name because it took me a while to figure out it was damn text field rather than just a plain string.
  • Constant names versus property names:  Quite ingenious the way you used the same constant name as a property name so that the IDE doesn’t help me in autocomplete.  Thanks.  That’s ones special.
  • Stop trying to be fancy:  I get it.  You went to whiz bang college and learned some cool programming tricks and techniques and you’re pretty smart.  Remember, you’re writing for your boss/client/person who signs your paycheck so don’t forget that you’ll eventually move on/get fired/hit by a bus.  Be nice to the poor bastard that has to learn your code after you.  Assume they do not have your skill set.
  • No comments/documentation.  Of course given all the previous bullet points this one isn’t surprising.  Would it have killed you to put a sentence – ONE SINGLE &*^!@% SENTENCE – describing what a method does?  If you hadn’t done all of the above items too that’s all it would have taken but instead you have ZERO comments in 10,000+ lines of code.

But, I must say thanks for reminding me why I don’t like working on OPC projects.  You’ve taught me that just saying “no” in future projects will make my life easier and less complicated.  My wife, kids, and dog will like me better if I don’t take another OPC project.

I think if I had any advice for programmers just starting out.  Spend six months fixing Other Peoples Code (OPC) and see what drives you absolutely bonkers.  Then, and only then, can you start writing your own code.  You’ll hate it but it will give you some very valuable experience early in your career, on the things not to do.  Being kind to the developers that come after you is just as important and by doing this you’ll know.

Ultimately I’m a lazy programmer.  Not that I don’t do the work I just don’t want to work that hard at figuring out old code.  If you name your variables and methods properly and consistently, keep your methods short, and if you write minimal comments it’s not that hard to figure it all out later.  Having to guess at someone else intent makes my head hurt.



So dear readers what OPC foibles drive you crazy?

20 thoughts on “Dear Idiotic Developer

  1. I think you hit all my pain points.
    I hate having to research my own code later on much less someone else’ code.
    Spending 6 mos doing nothing but maintenance at the outset of any new role is not bad.
    You have to learn the code base in order to figure out how to fix any bugs.
    And you learn whatever style is/is not in use and you also learn what things TO do and what things NOT to do.

  2. Subclassing from death: Only poor design can require a developer to sublass five times from HTTPSocket->InformationSender->UniqueSender->GlobalClass->ControlSend-> to FrameFiller. Or a useless “exercise of style”?

  3. Don’t forget people who repeat code. Have very similar methods in different parts of the app. Or build a form with 50 textfields instead of using control arrays or containers. And a big pain: Workarounds without comments on them. Because years later the bugs are fixed and the workaround makes big trouble. And don’t forget missing error checking. Stuff like having no exception handler in your code and a “return true” in the app.UnhandledException event.

  4. I feel the same way every time I go through my own code from a while ago. It’s always getting better, but sometimes I want to invent a time machine, go back, and punch myself in the face for coding something the way I did. FASTER ISN’T ALWAYS BETTER, IDIOT SELF! 🙂

  5. @Bill
    I can relate
    I’ve looked at some of my old code and just cringe at the bad habits they demonstrate

    The first company I worked at I eventually left and about 10 years later went back to on a contract to fix & update for Y2K – you guessed it – my own code from long ago.
    That was a somewhat humbling experience to see all the crap I’d written way back then.
    Fortunately I had few changes to make for Y2K itself but lots to make because I’d learned how to do things better since then. Oh, and I added a lot more comments & doc about what the heck the code was doing.

    Coder – read thy own code years later 😛

  6. Code written by someone new to programming, or without any experience in OOP, with no classes as such, just a couple of windows with a gazillion methods.

  7. I forgot another one:

    Using recordset.idxField all the time even when queries have more than two or three return fields. Add in the fact that the methods are freaking huge and you spend a lot of time doing nothing but scrolling to the query and counting fields.

    Sure, idxField *might* be marginally faster but it’s not worth the hassle of constantly having to lookup what field index 2, 7, 11 and 15 are. Readability is worth the small hit in speed.

  8. I had a project that was to migrate a VB.NET app to Real Studio. When I got the code and opened it in VS, I only found a few objects in the Project List. I opened what was the main window and it took VS over a minute to display the window.

    The entire application had all its code in this one window! Thousands and thousands of lines of code. Methods were hundreds of lines long or longer. Everything was stored in global variables and code was copy/pasted all over the place with no code re-use.

    I told the client that if I were to take the project, I would not migrate one line of his code. It was too bad and that everything would be re-written in Real Studio based on how the app worked, not its original code. He agreed, although I’ve still had to go back and refer to the original code a few times.

  9. @Paul Lefebvre
    That’s a good one, Paul. I’ve looked a few projects where every variable was a global variable. The guy had NO local variables in any method and he wondered why he was getting odd behavior when multiple windows were open.

  10. @jjb
    A very fond wish that most likely you won’t get.

    Forgot a good one: Having the same information twice in local and global variables and working with both type of variables. It took me some weeks of getting this out of the complete application. Since then I know why globals should be prefixed.

  11. Beatrix Willius :


    Forgot a good one: Having the same information twice in local and global variables and working with both type of variables. It took me some weeks of getting this out of the complete application. Since then I know why globals should be prefixed.


  12. @Bob Keeney

    i disagree, i don’t think developper comfort should be more valuable than application efficiency. what matters is what the user see/feel. don’t care how many sweat for it.
    rewritting for speed tuning is good too, meaning less readable code, but faster one.

  13. @dazz
    I disagree with you. 😛

    Seriously, it truly depends upon the client and project. Me, as consultant who is turning code over to a client, I want clean, self documenting code that works. Most clients want it so their $$ is turned into working code and for the most part (there are exceptions of course) speed does NOT matter to them. A lot of clients actually intend to update the code on their own after we’re done.

    There is nothing inherently wrong with writing for speed but unless the 10-15% is critical to the application the extra time in development isn’t worth the extra cost to most of my clients. Frankly I’ve never had a client say, “I want this as fast as possible.” because a lot of applications don’t really need that sort of speed.

  14. y true that, speed is overrated in most cases 😉

    but speed is more a question of thinking, that’s why i use idxfield because it seems obvious to me that referring with integer is faster than with naming who will have to be converted.
    but i put a comment on each lines referring the real name field, so i got both worlds 🙂

    numbers are cool, they are cool to be visualized too. i could say sometimes i hate code with toolongnamingsystem. not visually browsable.

  15. My best friend likes to tell a story of when he was doing y2K work for his company. Along the way, he came upon some stuff that was done in assembly. This was a big “WTF” to him. There was no reason that it had to be done in assembly. The original programmer, it would seem, was just showing off.

Comments are closed.