Let's say you are struggling on a programming project. Your code is growing exponentially and becoming more convoluted by the day, and it is clearly out of control. You're getting run-time errors, compile-time errors, wrong output, no output, endless loops, your machine is overheating, and perhaps you are starting to feel like you might be a little over your head. Maybe this is the first time you are using a particular programming tool or language, or it's the first time you've worked with a particular database, or maybe it's your first complicated project overall in any technology and you're getting hopelessly lost.
So, it's come to this: it's time to swallow your pride,
and ask for help.
Maybe you decide to visit a programming forum online, or maybe you have coworkers or colleagues or an old college professor that you can contact for help. Either way, it is time to get to the bottom of this. You have deadlines that you are getting dangerously close to missing. People are starting to doubt your abilities; heck, you are even starting to question them yourself.
However, you are not a "clueless newbee". You know how to break down the problem and explain the specifics in detail, so that makes it much easier for others to help you. You have specific questions that you need answered, not just general "how to write a query?" questions. Asking for help may not be ideal, but if you can get the right person to assist you, it should produce results and really get you back on track.
So, you post your question. You've explained it well, and two pieces of advice come back.
Advice #1:
"Ah, a challenge! Here's a pretty hacky idea that should work; cut and paste and try it. It's about 85 lines long and you'll need to create 4 auxiliary temp tables, and you'll have to manually handle a few other situations that I didn't account for but this should serve as a guideline that you can expand upon. It will probably be slow and inefficient and maybe a little buggy, but overall, it should fix the error you are getting and give you the result you need, at least in the short term."
Advice #2:
"You have a poor design that is really making what should be really simple nearly impossible. Just break out these two columns into a new table to normalize your design, use the correct data types, do the formatting at the presentation layer, and all you need is this one simple, single line of code which will do exactly what you want."
What would you do when presented with these options? How would you respond?
The Common Response
Let's look at the most common reaction to this scenario.
First, you consider advice #1. You've looked at his code and it is
ingenious -- at first glance you can't understand a single line! It take about 2 hours to really process what he is doing, and a lot of it still is way over your head, but some of the hacks and tricks look pretty darn cool. It isn't perfect, but it should do the trick. A little tweaking and maybe some cutting and pasting to handle a few other cases you didn't specify and you should be back in business in no time. As for efficiency, that is not a factor here -- you just need the darn thing to work! You can always optimize later.
As for advice #2 -- WTF? "Normalize?" What a bunch of crap -- theory is great, but you have a project to complete. Who does this guy think he is preaching to you like that? The first response was helpful and solved your problem -- this one is just a waste of time, someone trying to stroke his ego online and demonstrate how smart he is. And he is really trivializing your problem! To suggest that you have a "poor design" and that a single line of code that anyone could write will solve the issues you've been struggling with for weeks is an insult to you as a programmer. Thanks, but no thanks, jerk!
A "Radical" Alternative
Let's take a look at an alternate way to respond to the two pieces of advice offered.
Regarding advice #1: Yikes ... if that's what it takes to solve this issue, there must be a better way... This approach may work, I suppose, but now my already impossibly messy code will get even worse and this will be a nightmare to maintain. I must be doing something wrong if this is the best solution anyone can offer.
As for advice #2: Wait a minute -- there's an easier way to do this? This is the best news I've heard all week! "Normalizing" -- I've heard of that, I should look that up to make sure I get it. And using the right data type instead of strings everywhere -- kind of new to me, I never thought of the importance of it, but if it helps and I can solve this thing in only one line of code, it is probably something I should learn about and try. It would be really sweet if I could simplify this whole system by simply making some changes to the design -- which I know is a mess. It might be a bit of work, but it should be much less work in the long run if I can learn a few things about database/application design, and eliminate most of this crappy code I've been working on for weeks and replace it all with boring, simple, easy to read and maintain code! I knew there
had to be an easier way!
Which Approach Do You Take?
So, how do you respond when someone suggests that you learn a new technique? Do you listen and consider the advice, or do you immediately reject it? If someone recommends a "best practice" for you to follow, do you immediately assume that you are being preached to and spoken to condescendingly, or do you research the idea to see if it will help you? If someone comments that you've made poor design decisions and recommends an alternative, do you get defensive and refuse to even ponder the possibility?
If I personally am struggling with anything, and someone offers to teach me an "easier way" -- well, for some crazy reason, and unlike
a lot of people -- I listen! And I listen with an open mind and really try to consider the approach described to me. It may not ultimately be any better than what I am doing now, and in fact it may be very poor advice, but I at least listen to it and consider it. The news that there is a "better way" to some people is an insult and upsetting; to me that's the best possible news I could hope to receive!
I think there's an odd mentality that programmers have when asking for help: "Even though I am asking you for help, I am still smarter than you!" I find the opposite approach works better: Assume you have something to learn from
everybody, whether it is programmers on an online forum or people you meet face to face at a cocktail party. You might be surprised at what you can learn if you have an open mind.
At my very first job years ago as a dishwasher, there was a sign hanging in the restaurant's kitchen that read: "Why is there never enough time to do a job right, but always enough time to do it over?" And it's true in programming much as it is in the food service industry. You might argue that altering a key design decision this late in the game is not possible. Well, in some cases, it may not be -- you've got to get it done and live with your decisions. However, it is
always worth 5-10 minutes to at least consider a new approach to your problem, and maybe even give it a try. In fact, you might even learn a little something if you listen to advice that aims to improve your knowledge and skills as a programmer with a nice side effect of also simplifying your code, instead of complicating it.
In short, if you are struggling with your code, there usually
is an easier way. The hardest part is often simply acknowledging it.
see also: