Pounding A Nail: Old Shoe or Glass Bottle?

"A client has asked me to build and install a custom shelving system. I'm at the point where I need to nail it, but I'm not sure what to use to pound the nails in. Should I use an old shoe or a glass bottle?

How would you answer the question?

a) It depends. If you are looking to pound a small (20lb) nail in something like drywall, you'll find it much easier to use the bottle, especially if the shoe is dirty. However, if you are trying to drive a heavy nail into some wood, go with the shoe: the bottle with shatter in your hand.

b) There is something fundamentally wrong with the way you are building; you need to use real tools. Yes, it may involve a trip to the toolbox (or even to the hardware store), but doing it the right way is going to save a lot of time, money, and aggravation through the lifecycle of your product. You need to stop building things for money until you understand the basics of construction.

I would hope that just about any sane person would choose something close to (b). Sure, it may seem a bit harsh, but think about it from the customer prospective: how would you feel if your carpenter asked such a question?

I find it a bit disturbing, however, that this attitude is not prevalent in software development. In fact, from what I can tell, it seems to be discouraged. 

I've been participating in Usenet/forums/lists for a decade now, asking programming questions and helping out others who have questions of their own. If some one asks a question that demonstrates the complete absurdity of their design, I'll generally reply with my (quite candid) opinion on their design. To give you an idea what I'm talking about, here's something I remember seeing a while back (from memory).

Subject: Aggregates Help
I have a table that stores test results for milling machines. Each test consists of N-runs conducted by a measurer going M-trials each. I have this information represented in a varchar column in the following format: "44:1,5,4;23:2,4,9;14:1,4,3".  When the column is read into the class, it is converted into a jagged array: ( (44,(1,5,4)), (23,(2,4,9)), (14,(1,4,3)) ) of runs (3 of them) and measurers(Ids of 44,23,14) and trials (1,5,4 and 2,4,9 and 1,4,3).

One of the reports I have is a deficiency report, which predicts which machines may fail. To run this, I have a report class that loads up the appropriate tests and processes the information. However, this is taking longer and longer to run. I'm thinking that running it in a stored procedure will be quicker.

I can figure out how to get an "array" in SQL with a table variable, but how do I make a jagged array? Any ideas?

Some of the folks on in the list took it as a fun challenge, going back and forth with how deficiencies are calculated, and providing some incredibly brilliant ways of solving this problem.

Not I, though. My response was something to the effect of …

This is quite possibly the worst way you could store this data in a database. No, seriously. They had better ways of doing this over thirty years ago. You have created a horrible problem that is only starting to rear its ugly head. It will only continue to get horribly worse, costing your company more and more money to maintain.

You need to drop everything your doing right now and take a trip to your bookstore to get a database book. I recommend INTRODUCTION TO DATABASE SYSTEMS by DATE, but at this point anything should do. For the sake of everyone who will maintain your future code, don't touch a database until you understand how big of a mess you've created.

How do you think you would have responded to that post? Would you have taken the challenge to think about how to solve the problem or just take the opportunity to school the poster?

If you say the former, then you probably think I'm a grumpy curmudgeon (more likely, less family-friendly words though). My appeal to you is to think back to the carpenter. How is this any different? How fair is this to person paying him to develop software, or, more importantly, the poor sap that will have to come in and not only understand the mess, but maintain it. That poor sap could be you one day!

If you say you'd go with the latter, harsher reply, then I ask, why aren't you out there participating in the newsgroups/forums/lists? We need more people like you out there: there are too many of the people who tell people exactly how to apply the duct tape without giving the poster a firm scolding. 

But I think the problem is worse than not having enough grumpy curmudgeons: in my experience, forum moderators actively delete critical posts that don't solve the problem, keeping only the hacks that solve the hacks. When new users come to read the posts in the future, they may actually think, "hey, I could use this to solve my problem."

Am I on the wrong side in this? Should we actively be encouraging new programmers to use their horrific techniques? Or am I just looking at this the totally wrong way?

24 Comments

  • I totally agree with you. We miss the real problem in a pursuit to get it to work. There is a very good saying about leadership and managers. "A good Manager will take you through the forest, no mater what. A Leader will take time to climb on a Tree and say 'This is the wrong forest'"

  • Good news: you are more than 100% right (your opinion about what "we" would need to do with these questions)



    Bad news: you are more than 100% right (your guess about the world around us opposing this truth either because the current way seems to work better short term or because people just do not think/care at all)



    I'm tired of trying to actually be a grumpy curmudgeon in public (i.e. in newsgroups, forums, whatever) because of the overwhelming David v.s. Goliath feeling it gives me. So I just keep doing this on the project I happen to work in myself and be done with it.



    Even though you are (also) more than 100% right in stating that I might be "that poor sap" somewhere down the line. At the moment I'm just to numbed down and desillusioned to really care.



    [No, please don't worry; I'm not suicidal. Dilbert keeps me laughing and thus quite sane.. ;-)]

  • That is a terrific analogy. Did you write that? I think I will have to quote you in the future :)



    OTOH, giving credit will be tough because of your last name. Maybe I'll just give credit to the owner of thedailywtf.com =P

  • > That is a terrific analogy.

    > Did you write that?



    Sadly, I experienced it first hand in a bout of sheer laziness. I was upstairs, needing to pound a nail to hang a picture ... and the hammer was *all* the way in the basement.



    I ended up using an CD-ROM drive I had siting in a drawer. It worked surprisingly well, although I think I would have had a net time savings had I just gone down and grabbed the tool.

  • Heh, You are 100% right to set them straight. It would tick me off to see my post removed as being a "flame" tho.



    I'm at the point in my life where I have almost given up on telling people why they need to do it differently.



    The answer is invariably the same, "There's no time to do it right."



    Of course, when it breaks, there always seems to be time to do it over.



    I've discovered that mostly it comes down to Business people not understanding why "its bad and should be cleaned up/done right the first time"

    and

    Technical folks like us being incapable of presenting our reasons in a way that makes sense to the Business people.



    Keep up the good fight while you still can!!!

  • This is nice, Alex. I agree with you 101%.



    Is this the inspiration behind thedailywtf.com?

  • >Is this the inspiration behind thedailywtf.com?



    If only I were that insightful ...



    More, TDWTF provided inspiration for this attitude and post :-)



    The inspiration behind TDWTF was merely complaining about incompetence at my work.

  • So it was the other way around huh?



    I guess it's the attitude TDWTF regulars get after reading enough WTFs --- they suddenly become conscious that carelessness in programming and design will lead to catastrophic (if not rather amusing) WTFs that will not only be laughed at by people but scorned by future maintenance developers (solutionologists? :p).



    Makes you at least go back to the "hardware store" and look up on what you really need to acquire.

  • Alex:



    Yes, I agree with you 100%. And I have been known to be that person out there, especially in the ASP.Net SQL Database forums, asking people why they are trying to fit a squre peg in a round hole when the issue is their db design. And the first thing I thought when I read the example you used was: What kind of f-in' design is that???



    That said, one thing I have learned from the various newsgroups and forums is that questions are posted by relatively inexperienced developers working on systmes that are not of their own design. More than once, I have responded with a typical "What the f--- were you thinking" (and, yes, I tend ot be a good deal more diplomatic), only to have the original poster sheepishly reply "Well, it isn;t my desing, it's a system I inherited, and I'm new here, and my boss needs this report by 5..." (or something to that effect).



    So I agree: educate, educate, educate, but be willing to jump in and help people drive that nail in with a glass bottle if absolutely necessary, as well...

  • give 'em hell. how else will developers (junior or otherwise) be sharp if they are allowed to be coddled and continue with insane practices?



    we should be held to a high standard and pushed to be better- thats what makes us valued professionals, right?!



    the question asked will determine the type of answer i give. if this is a "i have no clue what i am doing, please help me" question, i have no problem giving a full attitude and politely directing the asker to RTFM.



    if they did RTFM, ask relevant questions, try, try, and keep trying- then i'll help out however i can....

  • > If you say the former, then you probably think I'm a grumpy curmudgeon



    Don't you mean 'latter', not 'former'? Or does my brain have an off by one error?



    As for taking advice - the advice is good, but no normal human being is going to be happy to be talked to in that tone of voice, no matter how wrong they are. A slightly more tactful tone will give better results.

  • I do some Qbasic programming for a hobby.

    Nothing fancy.



    The other day, I was working on a program to create a graph from any function. Then I got a problem. It got worse and worse.



    Eventually, I went to a forum for help. Instead of solving my problem, they told me I was doing something fundamentally wrong, or at least unnecessarily difficult.



    They suggested me to use a different notation for the functions, so the computer can handle it better (RPN). To do that, I had to start all over again.



    I was angry at first. Who the hell are they, anyway? I didn't ask that! I don't want your opinion on my program! ...



    But I did it.

    And I'm forever thankful.

  • I would have given some technical indication as to just what was wrong with their design, but otherwise, yeah, they needed that response.

  • I have been writing code now for over 20 years and I have to agree with you Alex.

    However, the thing that gets me the most, is people who interrupt what you are doing to ask for your opinion, you take the time to give it to them, nicely, and professionally, only to find that they have ignored you, and knock on your door later to resolve the issues they caused by ignoring you in the first place.

    I am afraid, like the other reader, I am too long in the tooth now to be tolerant with these tire kickers. S’pose I am just a grumpy old trelbeldo!

  • Great story! Just remember: when pounding a nail with a glass bottle, wear eye protection!

  • Fun party trick: You can actually pound a big fat nail into a two-by-four (or the side of your buddy's house) with a beer bottle, PROVIDED you leave the cap on.

    Water (or beer) is inconpressible. Glass can't break without being distorted. You can beat the hell out of a nail and cause your friends to dive for cover, but the bottle won't break. Just don't open it for a while afterwards!

  • Jason, have you tried it? I think not. Maybe beer is not compressible, but it IS flowing, so you can still distort glass and it will break. So no, your solution isn't valid. You will end with even more mess than with empty bottle. Beer will also be under pressure from shaking and bottle will literally explode.

  • In life, sometimes the correct answer is something close to choice A for stuff that doesn't matter that much. Databases though, are completely different then hammering a tack into your wall. As one of the sad-sack people who needs to maintain an application that stored and coded data like this, I 100% agree with your comments. People need to be edumcated about the basics so anything you can say or do to help them not create idiocy like described above is a good effort in my book.

  • I agree that people on completely the wrong track should be shown the light, but to start your reply by saying the solution they have come up with is the worst possible idea ever and they are the source of all that is evil in the programming world is a terrible way to try and teach someone.

  • Apparently, the basic human need to be cruel to those with less expertise draws sycophants at an alarming rate. Allow me to humbly disagree.

    Replying to a well-intentioned yet somewhat misguided hacker "This is quite possibly the worst way you could store this data in a database", and "you need to go buy an introductory book on databases" (jesus... anonymity makes people smug...) is NEITHER a) helping him brainstorm new ways of doing the wrong thing NOR b) pointing out what the right thing is to do. It's abuse. You didn't tell him to go get a hammer, you told him that he's a disgrace to drywall. Something that actually resembled your second example would be like this: "you have organized your data back-asswards, and it will be unmaintainable. You need to know these basic things about database design: ..."

    Until you can tell the difference between contributing to a discussion and being abusive, you probably shouldn't be giving "advice" to newbies... regardless of how much you enjoy it or how many people kiss your ass.

  • Re:
    " Replying to a well-intentioned yet somewhat misguided hacker "This is quite possibly the worst way you could store this data in a database", and "you need to go buy an introductory book on databases" (jesus... anonymity makes people smug...) is NEITHER a) helping him brainstorm new ways of doing the wrong thing NOR b) pointing out what the right thing is to do. It's abuse. You didn't tell him to go get a hammer, you told him that he's a disgrace to drywall. Something that actually resembled your second example would be like this: "you have organized your data back-asswards, and it will be unmaintainable. You need to know these basic things about database design: ..."

    I wouldn't call it abuse, I'd call it discipline. Answering questions in detail without a reference to the total lack of expertise of the person asking the question -- which is the actual problem -- tends to encourage an attitude of starting without proper preparation. It only creates more questions and trouble in the end. Reading that book could answer a 100 questions that the novice/newbie was otherwise going to post somewhere down the same thread. It will save everyone time, especially the person who posted the question.

  • Forgive me for taking your question far too literally.

    Pounding A Nail: Old Shoe or Glass Bottle?

    Allow me to quote James Newton:

    James Newton replies: "Before I answer that question, let me just say that the hammer is the best tool. No other tool is better, no matter the application, than the hammer. In every case, where I need a tool, I reach for the hammer. Loosen a bolt? Hammer. Cut wood? Hammer. Milling complex shapes out of metal? Hammer.
    ...
    When the time comes to insert the IC into the socket? Be sure to use a hammer."

  • I've been spreading this story around a bit, whenever the opportunity has risen. I heard just now that one of my friends has actually gone out and bought the hammer after reading this.

    Mission accomplished. :)

  • While I agree with you that a lot of these querents need someone to grab them by the shoulders, give them a good shake and shout "WHAT'S WRONG WITH YOU?" for their design stupidities, I have also found that if you do that too vigorously, they tend to set the bozo bit and ignore the hell out of you.

    I prefer to start off with a bit less heavy hand: "Why are you trying to represent a monetary value which you need to be able to add and subtract to as an array of 80 characters? Was there any specific reason why this format was needed? If that's the format you're reading or storing it in, why aren't you converting it to something more convenient once you have it? Would an alternative such as float or a fix-point math class be a suitable alternative?" (this isn't verbatim, and I don't recall the explanation other than that it was a bad one, but that's pretty much a true story).

    Half the time, this means trying to tease out what it is they are actually trying to do, e.g., "What is this bizarre collection of arrays and loose variables which obviously should be some sort of data structure supposed to represent?" or "Why do you have these variables named shoe1, shoe2, shoe3, etc. separate instead of in an array?" (I can't count the number of times I've seen this, and maybe half the time it's an artifact of the development non-process rather than something that should be an actual array, even though the naming would imply otherwise).

    This is a lot of work, and just seeing that you need to do it rather than just give a simple answer takes more critical thinking than most coders are looking to apply to a simple question. I've answered questions at times only to realize later that the question was the problem, and I'm usually *looking* for that sort of thing.

    OTOH, every good programming forum needs someone who is willing to put the smack-down on time sinks, help vampires and idiots. More than one or two such people can make the forum into a battlefield, but without *some*one like that, the emperor will keep walking around naked, oblivious to why he's always feeling a draft.

Comments have been disabled for this content.