Saturday, October 12, 2019

Why Your Code Will be Bad

So... you just got your computer science degree, or you graduated from lambdaschool, or you did codecademy long enough that you think you're ready to get your first job.  You're so excited to get into industry and write beautiful code that won't have any bugs, that will be perfectly unit tested, and will probably be so good you'll get promoted to director-level within the first 6 months.  Then you get that job.

Reality

The truth is, you are, or will be, getting paid to write this code.  Why??  Because theoretically it brings your company money or the ability to make more money.  However, the longer you take to write this code, the more money they have to pay YOU before they can start making money from the code.
So, when you get into industry, you'll find very fast that you code in reality.  As Owl City says, "reality is a lovely place but I wouldn't want to live there."  The existing code bases may be nearly impossible to understand.  There may not be automated processes to deploy code.  There may not be unit testing frameworks in place.  Some services may spontaneously combust once a week to where you have to go restart the server but don't get the time to actually fix the problem.  With all of these problems, you simply won't have the time to write perfect code.  To write perfect unit tests, there needs to be a framework in place.  But product doesn't have time to wait for you to put the framework in place.  You'll just have to write correct, performant code with the realities you face.

Existing Code Bases

Coding performed in reality yields real code bases.  Real code bases can be messy.  They often have bugs, warts, and weird code that exists only because the code didn't just come into being like the universe.  Code bases evolve and in some cases get uglier.  Dealing with code bases, you should remember one rule -- it is the same rule you should remember when you go camping: "leave it as you found it or better."

Life

Sure, developers get paid well.  Sure, you won't have to do any physical labor except get up to get another free fountain drink.  But this is life.  There will still be hard days and hard problems to solve.  Somedays you'll feel like quitting programming forever and starting a goat farm.  Your code might occasionally even be BAD, especially when you're starting out.  It could be really bad.  Such is software development life.