Slashdot Mirror


Ask Slashdot: How To React To Coworker Who Says My Code Is Bad?

A week ago, you read the other side of the same question. Now, an anonymous reader writes "I have been with my company for 10+ years and have seen many development cycles on our projects. We have a developer intern who has not been on the team for very long. On day one he started ripping into my code on how terrible it is. We have a code base of roughly 50,000 lines of code. When he comes to me with a complaint about the code it is simply because he does not have the experience with it to actually understand what the code is doing. He is a smart guy with lots of promise, he is asking good questions, but how do I get him to look past his own self perceived greatness enough to slow down and learn what we are doing and how we have pulled it off?"

507 comments

  1. Tell him to write goddamn login page himself? by crazyjj · · Score: 5, Funny

    After all, he's fresh from a CS program where they taught him everything.

    --
    What political party do you join when you don't like Bible-thumpers *or* hippies?
    1. Re:Tell him to write goddamn login page himself? by Anonymous Coward · · Score: 5, Funny

      Code Monkey get up get coffee / Code Monkey go to job / Code monkey have boring meeting, with boring manager Rob / Rob say Code Monkey very diligent / But his output stink / His code not functional or elegant / What do Code Monkey think? / Code Monkey think maybe manager ought to write god damn login page himself....

    2. Re:Tell him to write goddamn login page himself? by cod3r_ · · Score: 5, Informative

      Exactly. Don't hold the guy's hand. Tell him to waste all his time rewriting everything and see what the company does with him.. In the end the boss man doesn't give a shit about how clean the code is.. he give a shit about how fast the code was written and if it does everything it's supposed to and more. New guys gota learn the game too or they will have a hard life in the world of software development.

    3. Re:Tell him to write goddamn login page himself? by Jiro · · Score: 2, Insightful

      The boss is interested in the long term effects of having code that doesn't suck, such as lower maintenance time. If the boss wouldn't care when directly told this, that just shows he has bad management skills.

      In other words, you're basically saying "take advantage of the boss's bad management skills to get the employee fired for doing something that would actually benefit the company".

    4. Re:Tell him to write goddamn login page himself? by Anonymous Coward · · Score: 5, Funny

      Code Monkey not say it out loud. Code Monkey not crazy, just proud

    5. Re:Tell him to write goddamn login page himself? by Anrego · · Score: 5, Insightful

      As programmers its an easy trap to fall into thinking that better code always translates into those dollars and cents management seems so hung up on. Sometimes it does, sometimes it doesn't. Yes, some bad managers are too short term focused, but being able to do the math and figure out if the cost of cleaning up some code is going to be justified in the long run is part of a managers role.

      Telling management you want to re-write everything is a programmers perogative. Accepting it when the manager comes back and says "what we have now works, our customers arn't complaining, the thing is end of life in 2 years, and even if this made future maintenance free it wouldn't be worth it" is a reality.

    6. Re:Tell him to write goddamn login page himself? by Anonymous Coward · · Score: 0

      I agree, just tell him to rewrite everything. These little bastards can be found everywhere, and usually they talk more than they code.

    7. Re:Tell him to write goddamn login page himself? by Anonymous Coward · · Score: 5, Funny

      Code Monkey regret his lousy placement / Code Monkey recall his mama's basement / Code Monkey's chest still swell with pride / Recalling Natalie Portman statue, naked, petrified.

    8. Re:Tell him to write goddamn login page himself? by Anonymous Coward · · Score: 0

      Turns out his CS program just taught him the theory, but not the actual languages. So he's excellent at pointing out how code doesn't meet Dr. Dipshit's Principles of Quality Code or properly adhere to the latest agile development techniques. But he can't actually WRITE code, you see, or stoop to anything as low as actually doing anything other than run his fucking mouth criticizing everyone else's work.

    9. Re:Tell him to write goddamn login page himself? by Anrego · · Score: 4, Interesting

      Forgot to add, this guy put it way better than me a while ago (yes, I bookmark slashdot comments that are particularily helpful.. it comes in useful surprisingly often):

      http://ask.slashdot.org/comments.pl?sid=1932550&cid=34743614

    10. Re:Tell him to write goddamn login page himself? by Nethemas+the+Great · · Score: 1

      Good code pays dividends when you have to maintain it. Bad code can be cheaper if it is for a fire and forget project (think code-monkey sweat shop) and writing it in a crappy manner takes less time and no one will care that it is crappy. Your millage may vary when trying to communicate and align this reality with management and team members. In every case the key is to understand when "good enough" is "good enough" with respect to all stake holders for both the short and long-term.

      --
      Two of my imaginary friends reproduced once ... with negative results.
    11. Re:Tell him to write goddamn login page himself? by cod3r_ · · Score: 1

      i agree, but it's a new guy intern's opinion. Not necessarily a fact. Also I assume that the code functions well and performs well which would lead me to believe it's decent code just maybe not the prettiest implementation. Bottom line you can read about all the agile programming and other methods and it's about moving quickly because most companies need things developed fast while being understaffed and still having time for unit tests and QA. There is always time later to refactor or whatever needs to be done to clean up the code so that it can be more easily maintained, but that does not equate to money now. Which is what the boss man cares about.

    12. Re:Tell him to write goddamn login page himself? by Anonymous Coward · · Score: 0

      Just letting him re-write the code will absolutely introduce new bugs. Very likely many of the bugs will be in regions of the code that users rely on and expect to be stable, thus his new bugs will cause a lot of client pain. It can also cause pain to the rest of the team when they have to get up at 1 in the morning to put out the fires he caused.

      Sure, maybe it will get him fired, but it does far too much harm to the clients and the business and everyone else on the team. Even if getting him fired was the goal (which it is not), this would be a bad way to do it.

      If he is not going to work well with the team, then he should be replaced. But if he can be made to understand how the team does things, and adapt to it, then keeping him would be better. Good programmers are hard to find, and if he really likes programming then he can be made into a good programmer, which will be worth the effort in the long run.

    13. Re:Tell him to write goddamn login page himself? by cod3r_ · · Score: 2

      Or maybe it would be a great first job for him to put him towards refactoring code. He's just an intern after all.

    14. Re:Tell him to write goddamn login page himself? by SomePgmr · · Score: 1

      If this anon post is actually tied to the real case we're discussing, then the answer is simple, "Don't come to us unless you have a recommendation."

      If he can't program, can't demonstrate that your work is actually wrong, and can't come up with real justifications that include cost/benefit rationale, then he's useless and adding absolutely nothing to the process.

      Find a diplomatic way to say so. Criticism for criticisms sake isn't helpful... it's just some kid trying to prove to everyone that's he's a smart go-getter.

    15. Re:Tell him to write goddamn login page himself? by Anonymous Coward · · Score: 0

      most of the time odds are you'll be gone before it has to be seriously maintained, and/or next version will be a complete rewrite in technology dejour anyway

    16. Re:Tell him to write goddamn login page himself? by shaitand · · Score: 1

      The boss is interested in what his boss is interested in. He might be interested in this in the beginning but at the end of the day his bosses aren't going to appreciate it because it is going to look like his team outputs less.

    17. Re:Tell him to write goddamn login page himself? by marnues · · Score: 3, Insightful

      Given the GP's vitriol, I'm guessing he's one of those self-taught coders who has to deal with someone telling him his code is poor. My experience shows that self-taught coders do write a lot more code, but tend to write it without understanding how it's less maintainable. Us college learners try to write less code that does more, but often end up in the design phase longer than necessary.

    18. Re:Tell him to write goddamn login page himself? by Nemesisghost · · Score: 5, Insightful

      This is what a lot of idealistic programmers who are just out of school fail to realize. We should be able to remember that all the code we wrote in college had to be perfect, without any flaws. At the same time, most of these programs were fairly small(

      Another problem arises when you have an older developer who is forced to learn new tech where the best practices are drastically different from those he/she is familiar with. For example, if all you've ever done is procedural code(which is what most of my college classes did), and you are tossed into a situation where most of your coding is layered event driven the best practices between the two are so different that you are bound to make mistakes. What I've then see happen in situations like this is that a new developer comes along & sees where there are places that the best practices aren't being followed 100% of the time, and therefore assumes all the code must be crap. Instead, what should happen is the new developer should look at why something was done the way it was & work with the responsible party(not necessarily the original developer) and see if there's a good reason to "fix" the bad code.

      Currently I work with a great set of managers. They understand the cost of any project and are very good at prioritizing "fixes". They know that some of the early development doesn't work with the things we are now trying to do, and are will to let us go back & fix things. But they also know that we don't have the resources to fix everything, even things that might reduce the errors & crashes. I have a fellow developer that not fixing everything drives him crazy, and that was one of his first lessons. Nothing's perfect, nothing will be, and our job is do the best we can & worry about the problems only when we are told to.

    19. Re:Tell him to write goddamn login page himself? by Anonymous Coward · · Score: 0

      So sad I have no mod points to offer today.

    20. Re:Tell him to write goddamn login page himself? by shadowofwind · · Score: 2

      So where are all these bosses with "good management skills"? I haven't seen it since the early 90's. The long term effects of code that doesn't suck do not seem relevant to any manager's career goals, apparently.

    21. Re:Tell him to write goddamn login page himself? by show+me+altoids · · Score: 1

      It may be just me (I suspect not) but I don't believe I have never been on a project in my 25+ year career where there was any time given later to refactor the code as long as it worked as specified. There may have been one somewhere, but I don't remember it. That's not to say I haven't been on projects that were scrapped and restarted some time in the future.

      --
      I feel sorry for people that don't drink, because when they get up in the morning, that's as good as they're gonna feel
    22. Re:Tell him to write goddamn login page himself? by Synerg1y · · Score: 1

      To build on what you're saying... but better :) j/k

      Projects have as diverse requirements as there are projects out there, and what I've come across is projects that are meant for an expanding business, which basically means that the application needs to be future proofed (based on how much the client is willing to spend here) & the code written in a manner that can be appended to later, this really pays off if you land the support contract after writing the thing. The exact opposite of that is coming across projects where the business just wants to upgrade.. the web app works exactly how they want it to, they just have budget dollars and want to move from classic asp to asp.net & upgrade the "look & feel", and maybe add a dozen "wish" features people have asked for over the years.

      Me... I still critize predecessor's code sometimes, there are times I'm right and times I just didn't see the big picture, and I need to stop :) , but I've mostly inheritied applications, though I've done a number from scratch, and am more interested in code theory and best practices than in how many lines of code I write in a day. Oh, and I also value flexibility greatly (the biggest difference between now and college) if only for myself, and the fact that more code doesn't mean worse code, or slower code (don't believe me? learn how a compiler works, and realize that mvc would've never picked up if I'm not right on this).

    23. Re:Tell him to write goddamn login page himself? by Synerg1y · · Score: 4, Insightful

      Anybody who says tell the 1st year intern to rewrite the app cause he doesn't understand better... is pretty much a moron. That's not how you learn, and it's a huge waste of company resources, a lot of coders come out of college over-zealous and thinking they know best... it's the college mentality, you're invincible and on top of the world, doesn't mean you should set them up for failure, esp. w a decade in the biz. What we have is a poor approach and a conflict of interest, OP of ta is probably a dinosaur (10+ years at a company is not the industry trend) who just wants to go home at 5 and not do a single thing not asked of him... which is fine, and a college student who wants to learn anything and everything and probably hasn't been shown much of the humbling QC experience.

      I've had my code criticized before by people who I knew were in a lower league, and all I did was explain it to them proper and I consistently get back "oh, ok" and it's dropped, every once in a great while I may learn a minor thing or two even.

    24. Re:Tell him to write goddamn login page himself? by Synerg1y · · Score: 1

      Oh gawd, that's asking for an 80 hour work week tracking down the bugs & fixing them, you gotta understand the code first to re-factor it.

    25. Re:Tell him to write goddamn login page himself? by n7ytd · · Score: 5, Insightful

      The boss is interested in the long term effects of having code that doesn't suck, such as lower maintenance time. If the boss wouldn't care when directly told this, that just shows he has bad management skills.

      Rewriting is very often the last thing to do with working code. IChucking out working code and reproducing it usually involves relearning all of the reasons those last guys did it that horrible way.

    26. Re:Tell him to write goddamn login page himself? by Anonymous Coward · · Score: 1

      Interesting. Can you post a list of those comments here? Some might find it useful.

    27. Re:Tell him to write goddamn login page himself? by Anonymous Coward · · Score: 0

      Two words will solve everything you've mentioned, "You're Fired!"

    28. Re:Tell him to write goddamn login page himself? by benjfowler · · Score: 3, Informative

      Best Slashdot comment ever.

    29. Re:Tell him to write goddamn login page himself? by Junta · · Score: 2

      The rub being that in many of these circumstances, it's one developer's word against anothers in terms of what's more 'maintainable'. In one corner you have a software developer who is a veteran for your company, in another a likely recent college grad still brimming with less-than-practical ideals intact still yet.

      If you have a long term codebase that has been managed by people that have come and gone, no rewrite or refactoring should be embarked upon lightly. If the codebase isn't subjecting the business to constant churn and frustration, then no matter how ugly it looks, you don't touch it. Making the case that 'maintenance is expensive on code like what I see' rings hollow when the manager has tracked and knows that his developers haven't been devoting a lot of time to 'maintenance' at all. Just because code is ugly doesn't mean it is not doing the job correctly.

      On the other hand, if the codebase is truly a hopeless mess that does have high maintenance cost, then management certainly already feels it. The two parties should be able to recognize the climate and realize which side is in the wrong from a business standpoint. However even here, there is a whole lot of inertia. Even if complete crap that fails a lot and behaves sluggishly and inconsistently, frequently these projects are considered 'sacred cows'. Nothing short of a new project to replace the old would save some of them, and managers recoil in horror at that concept.

      --
      XML is like violence. If it doesn't solve the problem, use more.
    30. Re:Tell him to write goddamn login page himself? by Anonymous Coward · · Score: 0

      I am aware of environments where refactoring working code in certain areas was highly discouraged. This is actually somewhat rational.

      First, when refactoring in a code base of many millions of lines of code, there is always a risk of breaking something.

      However, more importantly, when you have thousands of enterprise customers you can end up supporting many versions of software including many "customer specific" fixes because some enterprise customers (including, for example, some banks) don't take new releases for a LONG time after they are released and are often running very old (years) software that you must support fully (a privilege the customer pays dearly for!). As a result, refactoring a module in release X prevents "safe" merges of fixes in X-1, X-2, etc and all variants of those forward OR backward.

      Not to say refactoring isn't allowed, but usually only when the module is being so substantially modified for new feature or serious bug fix that hope of easy merges is doomed anyway.

    31. Re:Tell him to write goddamn login page himself? by hey! · · Score: 2

      That was my thought. You'd be doing him a favor. He's an intern and that means he's there to learn. That'd teach him an important lesson to take into his professional life.

      I feel a development team has to constantly stretch. Somebody who comes in and challenges you to do better is in itself a good thing. But most coding these days is a collaborative effort and there's no place for prima donna behavior or theatrics. Those things are unprofessional, and wages of unprofessional behavior are dismissal.

      This is what the whole agile movement was about -- working together to continually improve code without chest thumping, egotistical posturing and the disruption that comes with it. In the real world you seldom have time to make something as good as you wanted to make it -- at least all in one go. You get the job done for the customer, then as you maintain the code you constantly improve it by refactoring, using the whole spectrum of agile tools like source control and unit testing to provide a safety net.

      --
      Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
    32. Re:Tell him to write goddamn login page himself? by Anonymous Coward · · Score: 0

      All of that is true.

      I would recommend a rewrite under 2 conditions:

      1. Refactoring the code would be a bigger hassle because it sucks so much shit.

      2. It was written in PHP, provided that the rewrite is in a decent language.

      Other than that, rewrites are a waste of time and money.

    33. Re:Tell him to write goddamn login page himself? by fliptout · · Score: 1

      Is this the birth of a new slashdot meme we can all love and cherish??

      --
      A witty saying proves you are wittier than the next guy.
    34. Re:Tell him to write goddamn login page himself? by AlphaWolf_HK · · Score: 4, Insightful

      There's also the matter of rewriting things introducing new bugs and getting the "so what good did it do to rewrite it when the new code doesn't work?" element. Worse is when the new bug is difficult to reproduce or troubleshoot.

      Sometimes it is just best to let sleeping dogs lie, and do something better with the next product.

      --
      Careful with names containing L slashdot.org/~AiphaWolf_HK slashdot.org/~AlphaWoif_HK slashdot.org/~AiphaWoif_HK
    35. Re:Tell him to write goddamn login page himself? by Anonymous Coward · · Score: 0

      Too good.

    36. Re:Tell him to write goddamn login page himself? by Anonymous Coward · · Score: 0

      There's also the matter of rewriting things introducing new bugs and getting the "so what good did it do to rewrite it when the new code doesn't work?" element.[..]

      Worse, there's ripping into the 'bad code' to make it 'good code' and finding that the effort required to reproduce the desired behavior with 'good code' would take so long that it's not worth it. The good coder then stops in the middle of the re-write and the maintenance programmer is left with a Frankenstein's monster that is impossible to maintain.

    37. Re:Tell him to write goddamn login page himself? by Anonymous Coward · · Score: 1

      Rewriting is very often the last thing to do with working code. IChucking out working code and reproducing it usually involves relearning all of the reasons those last guys did it that horrible way.

      Rewriting working code was the reason why each of the first several versions of Mac OS X functioned better and faster than its predecessor on the same hardware.

    38. Re:Tell him to write goddamn login page himself? by fractoid · · Score: 1

      Agreed. The issue here sounds more like "graduate is shocked to find that real world code isn't written according to what his lecturers told him was best practice" than "graduate points out real flaws in commercial code."
      Code style changes as you get more experience anyway... Well meaning newbies document the crap out of eeeeverything, for instance, and use stupidly long (but descriptive) filenames. With experience, hopefully they learn to only document interfaces and non-obvious code rather than every for-loop and if-statement, and use pithy (but still descriptive) names.

      --
      Rampant carbon sequestration destroyed the Dinosaurs' tropical paradise. I'm here to help repair the damage.
    39. Re:Tell him to write goddamn login page himself? by terec · · Score: 1

      Just because a junior programmer believes that the code would be improved by changing doesn't mean he is right.

    40. Re:Tell him to write goddamn login page himself? by HornWumpus · · Score: 1

      Not rewriting working code is the reason Mac OS used emulated 68K code for both its network stack and file system (back when it was far worse then Windows).

      --
      John McAfee 'It was like that time I hired that Bangkok prostitute; to do my taxes, while I fucked my accountant'
    41. Re:Tell him to write goddamn login page himself? by SolitaryMan · · Score: 1

      This. A thousand times this.

      --
      May Peace Prevail On Earth
    42. Re:Tell him to write goddamn login page himself? by StormUP · · Score: 2

      There are very few good programmers out there. I suspect there is a high likelihood that if you have hired one of the few as your intern that the code he is looking at is in fact bad. I've seen much more bad code than good code in my career. 50,000 lines is pretty small. If it really is bad, it shouldn't take long to fix so why not let him have a stab at it? He's an intern, part of what he's supposed to be doing is learning things. Something that size should be fixable in a month if the things surrounding it are any good whatsoever and they don't have to be thrown out as well. The last code I worked on that size that I claimed was bad and many longterm employees of the company where I worked at the time insisted was great ended up being about 1/3 of the original size at the end with significantly fewer bugs, additional new features, and had lower maintenance costs over the remainder of the years I worked there. Total investment...About 50% of my time for a month. If the intern achieves the same type of results, great, you've found a stellar programmer you should hire full time. If not, your intern wasted some time and you throw away what he produced and get a new intern.

    43. Re:Tell him to write goddamn login page himself? by mattack2 · · Score: 1

      there are places that the best practices aren't being followed 100% of the time

      In those cases, there *should* (I'm not saying there always is) be a comment explaining why it was done that way⦠e.g. maybe to work around a third party app bug if there's not another infrastructure way of doing it, or to work around a compiler bug, etc. (Both of those examples should have bugs to REMOVE the hackishness when the workarounds are no longer needed -- e.g. the third party app is no longer supported or the compiler bug is fixed.)

    44. Re:Tell him to write goddamn login page himself? by Immerman · · Score: 1

      I don't know, depends what you mean by documenting. Detailed essays certainly have very limited application (interfaces and clever bits, to my mind), but I find I've settled on an average of around one brief (usually 3-5 word) comment to every five or so lines of code. The comments then serve as both visual delimiters between conceptual blocks (I prefer a high contrast comment color) and a concise summary of the overall task being done. No detail, that's what the code is for, I'm just setting out the street signs so that I can skim through a function at high speed and immediately settle into whatever area I'm looking for.

      --
      --- Most topics have many sides worth arguing, allow me to take one opposite you.
    45. Re:Tell him to write goddamn login page himself? by Anonymous Coward · · Score: 0

      Weather you realize it or not, all coders are self taught. Allow me to illustrate this point. You say you went to college, and these days, who didn't? (at least for some semesters) If you were not paying attention in class or not completing you assignments you would not have as good a skills as the others. Further, if you went to class and slept through it you certainly would not have developed your skills. My point is that even though you have an instructor and assignments the real responsibility for learning is with you; you get what you put into it. Thus, to some degree you "teach yourself." Besides, I doubt many slaughterers think that coding can be taught by route learning.

      So don't stereotype "self-taught coders," because i assure you that you are one.

         

    46. Re:Tell him to write goddamn login page himself? by fractoid · · Score: 1

      Yeah, what you describe is about the level that I'd consider appropriate. Also you make a good point about the type of comments: They should be high level semantic information, not a low level description of the code itself. So where a newbie would say "loop through all of the X and add each one to the sumX variable", a more experienced coder would write "get the total number of X" or similar.

      --
      Rampant carbon sequestration destroyed the Dinosaurs' tropical paradise. I'm here to help repair the damage.
    47. Re:Tell him to write goddamn login page himself? by Anonymous Coward · · Score: 0

      All code written for a single purpose is like a rundown old mansion with bodies buried in the basement. If you renovate it, you have nice lovely mansion with bodies laying around in the parlor, on the front lawn, floating pool.

      Google: problem solving flow sheet

    48. Re:Tell him to write goddamn login page himself? by Skal+Tura · · Score: 1

      And code is written faster with clean code. Way faster.
      Code architecture, cleanliness is the key to make features faster and eliminate defects.

      Dirty code will lend itself to a set of various problems, messy code even further.

      Well architectured code base, with a clean writing style will make things happen faster, easier to maintain and every body understands a particular piece easier. On large systems tho, a great mind is required not to only comprehend but also understand the whole system with proper structure.

      The rules are very simple:
      * Every function should have at least short comment of what it does, preferrably a docblock style
      * every function and variable name should be unshortened, camelCased (my preference) or hyphened without abbreviations or shortening the words, for example instead of uSesAuthGenId type it open userSessionAuthenticationGenerateId you also see this is incorrectly structured it should be more like users->authentication->generateId
      * Insert a comment approximately every 10 lines on average
      * Do not type a huge list on intended recursive function calls on single line, ie. $example = array_walk( array_map( $$exampleMethod1, $data1, $conf1 ), $$exampleMethod2, $mode ); is a bad example of code, doubly so if the callbacks use references and change the original data :P That should be written more open and commented
      * a single method should preferrably not exceed 100 lines, if it does it's doing too much
      * You should never ever need intendation further that 4 levels, intendation comes from if clauses, for/while/foreach loops etc. for example: foreach($data AS $thisKey => $thisValue) { if ($thisValue['type'] == 'type') { switch($thisValue['mode']) { case 'thing': if ($something != $something2) { foreach($thisValue['someArray']) { .... Is bad
      * Abstract, but do not abstract too much. Abstract things which require more than say 10 lines, but if you are abstracting single line things via 8 different methods/functions you are doing something HORRIBLY WRONG (even Zend FW falls for this)
      * When you abstract, do not duplicate code, try to reuse code intelligently, do not copy & paste ... *EVER*
      * Separate, isolate certain types of code, for example: View, Business Logic, Flow control. MVC is not just a "fancy word" forcing you to "a nasty framework i need to work around". Infact MVC is a very old concept. Learn it, digest it, understand it. For example anyone saying Smarty is not MVC, or Smarty is MC+V or stupid things like that do *NOT* understand what MVC is and how to write structured code.
      * Above all: Reuse, Reuse, Reuse, Reuse. Don't do practically the same thing in 50 different ways, do the same thing 1 time but do it excellently and reuse it elsewhere. Goes for architecture & structure, for layer separation, and line level code. For example, each model method shouldn't have it's own handling of MySQL result set, they should ask another model for the results.

      And the most important lessons today are: Creating code is 7 times more reading than writing, it's 10 times better to spend 50 minutes planning/designing a particular feature then writing it in 5minutes rather than use 45 min writing it and 0 minutes planning it (First change arises you will know why).

      One can create a particular system using just ~25k lines of code instead of 200k lines of code if it's well structured and thought out.
      One can also spend creating that either half a year in man hours, or 5.
      It's all in *executed* high worth lines of code, not about quantity of written low worth lines of code.

      My basic benchmark for qualitive productive? If code style is properly adhered, how *few* lines of code and what's the ratio of comments vs. code.

    49. Re:Tell him to write goddamn login page himself? by rioki · · Score: 1

      The way I do it is simple, I budget time into the next feature to refactor the code along the lines where that feature will integrate. You will never go back and just refactor something, nobody will pay for it. So you say to the stake holder, to integrate this I need to do that, works all the time. The trick with agile teams is that they try to keep the technical debt small by integrating small refactoring into the daily workflow.

    50. Re:Tell him to write goddamn login page himself? by Anonymous Coward · · Score: 1

      This is probably a good answer. When you have legacy systems where lots of fast development occurred, maybe in older languages, you have to strike a balance on any development involving that code. Do you fix it or if it works, leave it alone? Every time anyone does any work in that code, is it a huge expensive hassle? if so, can it be improved on a planned basis rather than tacking it on to an immediate project? Too often the manager doesn't address these questions and the developer wants to improve it, but it might not be the right time for it. But again the developer might have worked there before and knows what he is up against.

      Regarding, 10+ years. If you have a get it out the door coding style that launched the company and allowed it to make money. What does it say about your coding style today? Are you still doing it? Does every piece of code you write still look like that stuff you wrote year after year? When you get a team of developers, you benefit from writing cleaner code on an ongoing basis. it's ok to get off the OK plateau..

      I work at a company where I came in (several decades of programming experience in small/medium/large corps). I find two programmers who have been here 10+ and 1.5+. They are writing code and developing architecture that is extremely hard to read, very wordy, follows about every bad practice you can list, and provides us with complex difficult to maintain systems. Their issues? They haven't worked on big teams where you get exposed to others just as smart as you. They learned one way and that was that. it works. Nuff said. Uh uh I said :0 We are a team now, you guys need to change so we can perform better. It's been a year and we have made plenty of progress in that area (at least the 10+ developer has). After the usual SNAFU on release, I would point things out and how we could have avoided it. I would point out that I pointed it out before releases. I built a reputation as having the experience and the foresight to be listened too.

      That's the thing with the intern, no experience. But he probably listened well in class and learned from good teachers. So question is.. are his points valid? From a generic standpoint? Even if he doesn't understand the business at this point, is he making good points? Or is it a case where he's not experienced enough to understand and make points? if so, I suggest you ask him to give it time. Tell him you want him to be patient and give it 3 or 6 months. Later, you guys can revisit what he is thinking at that time.

    51. Re:Tell him to write goddamn login page himself? by Anonymous Coward · · Score: 0

      Don't say it out loud. You not crazy, just proud.

    52. Re:Tell him to write goddamn login page himself? by Anonymous Coward · · Score: 0

      I agree. Last time I had to fix some bad code, I spent about 2 weeks of just reading the code to see how data moved around, then I conceptualized it into stages in a pipeline, then I started making changes.

      But yeah, about 2 weeks of:
      1) Read some code
      2) Visualize the code
      3) Browse the web for a bit to let the mind relax
      4) Go to 1

      It didn't look good for my productivity at first. You know, 2 weeks of absolutely nothing to show.

    53. Re:Tell him to write goddamn login page himself? by fseminario · · Score: 1

      good post! enjoyed it.

    54. Re:Tell him to write goddamn login page himself? by monkeykoder · · Score: 1

      Comments are for poorly written (possibly due to compiler restraints or legacy code) or highly optimized code. Without either of those it should already read easily without the comments.

    55. Re:Tell him to write goddamn login page himself? by toddestan · · Score: 1

      Rewriting code is why the first version of OS X was so slow and buggy to start with.

    56. Re:Tell him to write goddamn login page himself? by Anonymous Coward · · Score: 0

      Can't mention her without referencing the old slashdot standard, "Hot Grits"

    57. Re:Tell him to write goddamn login page himself? by Marxist+Hacker+42 · · Score: 1

      Yes, but you must acknowledge the original.
      http://www.youtube.com/watch?v=5W_wd9Qf0IE

      --
      SJW: a person who perceives an injustice, and while correcting it, commits a greater injustice.
    58. Re:Tell him to write goddamn login page himself? by Immerman · · Score: 1

      You go ahead and just read the code then - I can read five words a LOT faster than five lines of code, and the code only tells you *what* is being done, not *why*. A brief statement of intent can save you a lot of work reverse-engineering the code to extract it's purpose.

      Ugly code is still obviously where most of the comments live, precisely because you (err, I mean the *next* guy, obviously) probably will need help understanding *what* is being done. For the same reason those comments tend to be the least helpful over time unless everyone who modifies the code is really anal about updating the comments to reflect their code changes.

      --
      --- Most topics have many sides worth arguing, allow me to take one opposite you.
    59. Re:Tell him to write goddamn login page himself? by Anonymous Coward · · Score: 0

      You don't need to specify petrified for statues. They're already stone. You missed the grits anyway.

    60. Re:Tell him to write goddamn login page himself? by monkeykoder · · Score: 1

      You go ahead and just read the code then - I can read five words a LOT faster than five lines of code, and the code only tells you *what* is being done, not *why*. A brief statement of intent can save you a lot of work reverse-engineering the code to extract it's purpose.

      I find about 20-30 lines of code per function/method to be about right with descriptive naming you can gather the why from the context and the how from the code. It also allows you to skim the code for function names which if properly descriptive can be guessed at least approximately without prior knowledge. If your code goes above that 20-30 lines (for a good reason they do exist) then comments become more useful as delimiters. I am quite sure there are times my advice is not applicable but for most cases (50% + some epsilon > 0) refactoring would be the better option.

      Ugly code is still obviously where most of the comments live, precisely because you (err, I mean the *next* guy, obviously) probably will need help understanding *what* is being done. For the same reason those comments tend to be the least helpful over time unless everyone who modifies the code is really anal about updating the comments to reflect their code changes.

      Sad fact is that every time I've wanted to see a comment in code there wasn't one and almost every comment I've ever seen in code referred to code that was no longer there or was in fact wrong (Save data to database set isDirty flag to true WTF???).

    61. Re:Tell him to write goddamn login page himself? by Immerman · · Score: 1

      I tend to agree on function length - much more than that and I start considering breaking sections out into separate functions, or at least modularizing potentially resusable code a bit more so it's easy to do so in the future - I tend to not break out functions that will only be used in one place unless they significantly clarify the surrounding code (e.g. DoVerboseThingX in the middle of a complicated control loop, or perhaps break out the complicated control into a nicely encapsulated iterator if that makes more sense in the context). In fact that might be a good analogy for a lot of my comments - they're verbose psuedo-function names for what are, conceptually at least, discrete code blocks. When I do end up breaking up a function the breaks tend to be more-or-less at the comment lines.

      As for "Save data ... set...", that's an excellent example of what I could consider a bad comment, even if the code still agreed with it. If the saving process involves several lines then sure "Save data..." might make a good section header, but "set..." is going into exactly the wrong kind of detail - it's the sort of thing that's hopefully apparent from reading the code, is prone to change with the implementation details, and tells you absolutely nothing about *why* it is being marked dirty in the first place, which depending on context may be non-obvious information.

      --
      --- Most topics have many sides worth arguing, allow me to take one opposite you.
    62. Re:Tell him to write goddamn login page himself? by monkeykoder · · Score: 1

      As for "Save data ... set...", that's an excellent example of what I could consider a bad comment, even if the code still agreed with it. If the saving process involves several lines then sure "Save data..." might make a good section header, but "set..." is going into exactly the wrong kind of detail - it's the sort of thing that's hopefully apparent from reading the code, is prone to change with the implementation details, and tells you absolutely nothing about *why* it is being marked dirty in the first place, which depending on context may be non-obvious information.

      I might have a better impression of comments if I had ever seen a good one but the code base I work in now is clean enough that they're often unnecessary but conspicuously absent when needed.

    63. Re:Tell him to write goddamn login page himself? by smelch · · Score: 1

      Does it always take you 80 hours to rollback a change set?

      --
      If I can just reach out with my words and touch a butthole, just one, it will all be worth it.
  2. Old problem by Anonymous Coward · · Score: 5, Insightful

    This is an ancient problem, with 10 years experience I'm amazed you haven't run into this constantly throughout your entire career. New guys (even old guys) perceive everything they didn't write as shit.

    How you deal with it is dependent on a lot of things.

    First: is he right? Maybe your code does suck. Hell maybe you suck! At minimum. code that has been around for a while, has been written by multiple people over a long period of time, been adjusted and re-worked to meet changing requirements, and been done under a deadline usually does suck at least a little. Admitting this is hard.

    New guys want to re-write everything and don't understand the value of code maturity... most of the time a re-write isn't practical, and even the shittiest code usually attains remarkable stability by virtue of having all the bugs pounded out through years of use. Reminding him that this isn't a university project and a certain level of ugliness should be expected might help.

    If you don't think he's right, learn how to properly describe why you do things the way you did, and conversely expect him to explain why they are wrong. This is the biggest thing to learn when doing code reviews, and applies here. If you can't objectively describe what is wrong using with references to either standard or internal best practices or conventions, arguing code ugliness just becomes subjective. If you want to defend your code, learn how to describe how it doesn't suck.

    Having some company guidelines will really help, because it gives you something to point at in defending a decision. Ultimately what one guy considers good code may be considered bad by another. You are always going to have cases where someone thinks your code is too abstract, or not abstract enough, or sacrifices too much performance for maintainability, or too much maintainability for performance. At least with standards, the new devs will rail against the standards rather than personally attack you, and a standards document is a lot easier to defend (and yet still allows good changes without too much politics of hurt feelings).

    1. Re:Old problem by simcop2387 · · Score: 1

      Replying to undo fat fingers

    2. Re:Old problem by N0Man74 · · Score: 5, Insightful

      Good answer.

      Your keyword "deadline" didn't really get the emphasis it deserved. I know that I've been guilty of writing some pretty shitty code (and fully realizing it) because I simply did not have the luxury of the time to "do it right".

      Sometimes this is because I made a bad assumption early on. Sometimes there was a surprise change in the specs that didn't mesh well with the design. At times, it is because I'm working in unfamiliar territory and still learning about some aspect of the project. Sometimes it is because I am working with existing bad code someone else wrote (possibly because of one or more of the same previously given reasons), and I have to do my best to work within an existing bad implementation.

      In the real world, sometimes you have to make the choice of doing things right, or actually getting them done.

    3. Re:Old problem by znrt · · Score: 0

      If you can't objectively describe what is wrong using with references to either standard or internal best practices or conventions, arguing code ugliness just becomes subjective.

      are you implying that those criteria are objective?

      sorry for being picky but that's the effect of lately having to comply with lots of this kind of best practices and style guides written by folks who read much and code little. i sure can comply, but don't call that bullshit "objective" in front of me! that's unnecessary cruelty!

      (sheesh, now I'll have that nightmare again of decapitating joshua bloch with a swiss army knife)

    4. Re:Old problem by LordNimon · · Score: 4, Insightful

      New guys want to re-write everything and don't understand the value of code maturity

      I've been working in this industry for 20 years, and I've never experienced this. Instead, the "new guy" is intimidated by me because I'm constantly explaining things to him, and he quickly realizes that he doesn't know anything.

      --
      And the men who hold high places must be the ones who start
      To mold a new reality... closer to the heart
    5. Re:Old problem by Anonymous Coward · · Score: 1

      Instead of coding, that guy should get a lesson in work ethics first, and working with real people second. Just because he is "a smart guy with lots of promise " and "asking good questions", does not excuse that kind of behaviour. On Slashdot, and other online places, code nazis are fun to have around, even if it's your code, but in real life, where you're dealing with a real person and endangering his income. Personally, I never met people as bad as that, for which I consider myself lucky, but if it were me, I'd wait for him in parking lot and give him a little tough love. Finding a good job these days is hard, finding one you like, is harder, losing it, because of a guy like that, is worthy of a few punches.

    6. Re:Old problem by Anonymous Coward · · Score: 0

      Lovely answer. All that I would add is to take a look at a book called Working Effectively with Legacy Code by Michael Feathers. I'm an ardent proponent of devoting at least a portion of development resources towards refactoring codebases for the sake of readability and maintainability; it just needs to be done prudently with an explicit methodology. This book tries to put forth a such a method, while giving new programers advise for evaluating whether or not an aspect of code should be messed with or not. Assigning a new programmer to doing some of these steps is actually a really rather good way to get them to understand what code does what and why.

    7. Re:Old problem by gatesstillborg · · Score: 5, Interesting

      I disagree with this "perceiving everything they didn't write as shit" stance.

      I came into a new position, my first serious one (when I was in my forties, second career field, after a couple years of good community college studies). I have experienced in depth 3-6 (3 thorough exposure, 3 partial/peripheral exposure) different, substantial code bases. Two of them where horrendous ("devil spawn"), one was not exactly a work of art, but manageable, managing considerable (reporting and logging) complexity, and the other 3 were solid to the point of being elegant, and naturally readable. And mind you, this was my first serious in depth exposure, across a variety of development platforms, including both proprietary and open source.

      "Man is the measure of all things." -Protagoras

    8. Re:Old problem by Anonymous Coward · · Score: 0

      Kudos.

      I would also add that you should ask the new guys for some objective measure of how the code is bad.

      Regardless of right or wrong the other thing to expect is that sometimes the other guy will be able to better argue their position than you can defend yours.
      In that case you may find yourself "made redundant" by an ass hat.
      If that's the case chalk it up to experience and find a better place to work.
      Look for places with objective standards.

    9. Re:Old problem by Anonymous Coward · · Score: 0

      I totally agree, and would definitely say "deadline" is the cause of most bad code (and I too have been in the situation you describe.. almost perpetually really). I just wanted to avoid falling back to the cliche "I only had 4 weeks to write it" excuse and give some other reasons a little attention ;p

    10. Re:Old problem by fermion · · Score: 2
      This is good. I was in a situation with some legacy code a while back. It was crap because of the changes that had been made over time. This was when I had about 15 years of code experience, about 5 of it in a formal team situation. I sat down for a few weeks, tore out old stuff, reworked the stuff that was left, and came up with a new product. What I forgot to mention was that it fixed many complex and long standing bugs.

      So this the first thing I would add. It the problem with code that it is not pretty, or that it does not work. If the code is not pretty, suck it up. The world revolves around no individual person and narcism has not place at work. If the there is outstanding bugs that can be solved, then have this person work on that.

      But really without knowing language, application, style, funding, there is really no way to answer this question. If the code works, and is accesible to a experienced programmer, then it is good. If the code meets the standards set by the team, then it is good. Even if the new person is technically right it does not matter. What matter is if a person is willing to do the job under the prevailing conditions. In all cases where that is not the case, it is better to find someone who is.

      --
      "She's a scientist and a lesbian. She's not going to let it slide." Orphan Black
    11. Re:Old problem by cod3r_ · · Score: 2

      I feel like many do this. Which gave birth to all the development styles like XP or whatever the flavor of the office is. Get something functional down, get the unit tests done, get small pieces to QA as quickly as possible, refactor the code. Lots of companies skip lots of steps. I've been at one that skipped the QA step all together let alone the refactor part. Refactoring was a "when we stop being busy" type of job. Also a good one to let the new interns take a stab at in an alternate tree.

    12. Re:Old problem by AwesomeMcgee · · Score: 1

      Agreed. I find new guys appreciate me for my insights and skills. Maybe the OP's code sucks. Also could be due to my mentoring skills, perhaps the OP has zero skill in mentoring juniors in such a way that they learn positive perception towards code he previously thought poor. Unlikely though, my money's on the OP's code being poor quality, and him spending most his time defending it as the way it was done for good reason even though he can't articulate that reason because it was actually done poorly for no good reason.

    13. Re:Old problem by Anonymous Coward · · Score: 0

      This! I was much what the original article describes when I graduated from college. It took 1 software lead saying "this is how it is" to get me to understand I have a place, and I can grow from that place without destroying the rest of the garden.

    14. Re:Old problem by Yakasha · · Score: 1

      In the real world, sometimes you have to make the choice of doing things right, or actually getting them done.

      Where did I hear that before... Oh yes, Deepwater Horizon. No, no... CIA interrogation methods. No wait, space shuttle Challenger! Or was it the OJ Simpson investigators? Tim Geithner's taxes? California's energy deregulation?

      Not knocking the idea... just laughing.

    15. Re:Old problem by sneakyimp · · Score: 1

      Make him watch the movie "Colors" -- or at least this little bit: http://www.youtube.com/watch?v=IbUxePfsoWE

    16. Re:Old problem by RevSpaminator · · Score: 1

      I have to agree. In the 10 years I've been in my current job I'm still learn new stuff all the time. The most important thing to do is listen, patiently, and have the new guy explain why he thinks your code sucks. You may learn something about your code, but more likely you will learn where this guy is coming from and have a good basis for explaining to him why you aren't doing something the way he thinks it should be done. "Oh yeah, we tried that about 8 1/2 years ago, here is the wall we ran into with that method..." If that doesn't work take away his red stapler and make him come in on Saturdays to file TPS reports.

    17. Re:Old problem by jhol13 · · Score: 2

      Shittiest code does not attain stability because "all the bugs" have been removed. More often it attains stability because it cannot be changed, the odd undocumented bug-like "feature" can be the expected behaviour by some client which you really cannot change ('cause you'd end up in an avalanche).

      Then what I have noticed is that new code is usually bad: when you implement something, integrate and test you'll usually notice how to do it better. But then it might be too late to rewrite it.

      Old coding practices (from 80s or even 90s) are almost universally bad, even if nobody admits it. Back then the memory footprint etc. had hugely bigger effect than they have now. Today usually code which helps finding bugs (tracing, syslog, ...) is much more important than code which has optimal performance.

      I fully agree that you must be able to explain why your code supposedly does not suck and learn when he says why it does. Do not personal, it just a bunch of characters, after all!

      Company guidelines ... well, if they are really good they may help, but I doubt that very much.

    18. Re:Old problem by blackcoot · · Score: 1

      FWIW, I've found code reviews to be particularly effective in this situation as it forces everyone involved to explain themselves and argue on technical merits and helps frame the discussion in risk/benefit terms. It also shifts the tone so that there is an opportunity for a positive outcome for all: if the "kid" is right, you have an opportunity to learn and improve going forward. If the kid is wrong, he's going to get smacked down by the other engineers -- hopefully he's smart enough that he learns his lesson the first time.

    19. Re:Old problem by Anonymous Coward · · Score: 3, Insightful

      The fact that you explain things means you understand what you're doing. A lot of people who can't explain things don't really know what they're doing so they get defensive anytime anyone questions them.

    20. Re:Old problem by beelsebob · · Score: 3

      Regardless of right or wrong the other thing to expect is that sometimes the other guy will be able to better argue their position than you can defend yours.
      In that case you may find yourself "made redundant" by an ass hat.
      If that's the case chalk it up to experience and find a better place to work.

      Alternatively, if they have arguments that you can't answer, realise that you were in fact in the wrong, and fix your code. This applies to newbies, and old hats alike, you should be listening to other people's arguments and figuring out if they're actually right or not (based on whether you can actually find an answer for why they're wrong).

    21. Re:Old problem by Anonymous Coward · · Score: 0

      "learn how to properly describe why you do things the way you did"

      I can see it now:

      Junior manager: Your code sucks man!
      You: 'I wrote the code that way in 'C' because I'd rather code it in Java, this job sucks, my pay sucks, and I don't want to be here until 6pm optimizing my code. It works with 98% uptime, so get over it. Just fix the bugs."

      Coding at work is not to be graded it's just to get the job done. Open source projects are on a different level though.

    22. Re:Old problem by gatesstillborg · · Score: 1

      Though you didn't seem to intend to reply to me, I would support your point. I agree that it is valid to be aggressive if you truly believe in what you have to say, but should still maintain tact so communication is as effective as possible. It just seems that the tact must be missing for someone that junior and considering the OP seemed to suggest he did this coming right in the door, though not necessarily, so long as he has adequately reviewed the code.

      Additionally, though, as someone mentioned elsewhere, one must be wary of those who are better arguers than they are critics.

    23. Re:Old problem by 91degrees · · Score: 1

      I think the corollary is "sometimes you don't".

    24. Re:Old problem by Anonymous Coward · · Score: 0

      (I appologize if someone else said this, and I didn't see it)
      I agree with the above, and would add that his supervisor should discuss how to tactfully approach coworkers with this sort of issue. It's an important social skill that doesn't get taught in school. We've all have had to have difficult conversations with our coworkers, and how it's handled can either lead to better cooperation or a lot of bad blood. It's sounds like he's a smart kid that needs to learn how to navigate working in the business world.

    25. Re:Old problem by MozeeToby · · Score: 1

      Just a caveat, there are times when "this code just doesn't feel right" rather than "this code doesn't conform to standards X and Y" does have merit. There might not be anything obviously wrong it with it, but sometimes it just doesn't scan right in your mind. Usually this is because you know there is a better solution, but you just can't see it. If this is taken, by all parties, as an opportunity for discussion rather than a witch hunt, it can result is much cleaner code and provide lessons learned going forward. One key to making sure that it is perceived that way is to offer your own code up for the same discussion; we've all written code that we know isn't all it could be. Saying "this works, but I don't like how it works. Any ideas?" in your own code review can go a long way towards having a team that works together.

    26. Re:Old problem by Zero__Kelvin · · Score: 3, Insightful

      You sir, and people like you, are the reason why the software industry is comprised of mostly incompetents these days. If there isn't time to do it right, there isn't time to do it at all, and it was your job to make that clear to management. The industry is flooded with people who don't have time to do it right, but do it anyway, and wind up with Garbage. This is the reason why the Linux Kernel is far superior to Windows. In Linux kernel development, there is always time to do it right, because Linus knows what a moronic thing it is to do it any other way, and understands what a clusterfuck it would be if they started just hacking things together to get them "out the door."

      --
      Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
    27. Re:Old problem by DragonWriter · · Score: 3, Insightful

      In the real world, sometimes you have to make the choice of doing things right, or actually getting them done.

      In my experience, in the real world, the invocation of this phrase is usually used as justification for doing things in a manner that is so bad that what is actually done doesn't actually qualify in any meaningful way as doing the thing that was supposed to be done at all, although it often has enough of the superficial appearance of doing so that the people involved might reasonably hope that they will be out of the radius of accountability when it is realized that what was supposed to be done wasn't done.

      So when I hear it, I mentally translate it into "in the real world, sometimes you have the choice between admitting that things can't be done as requested with the resources alotted and pretending that they can and hoping not to be held accountable when the failure is revealed."

    28. Re:Old problem by japhmi · · Score: 2

      First: is he right? Maybe your code does suck.

      I'm thinking of a case I've been in. The code didn't necessary suck, but it was almost completely uncommented. Maybe Mr. "I have 10 years of experience!" should go back and comment his code so the new guys can understand what's going on.

      --
      "Giving money and power to government is like giving whiskey and car keys to teenage boys" P. J. O'Rourke
    29. Re:Old problem by Anonymous Coward · · Score: 0

      Look at the open source world. It's a long history of college students who would rather write their own than maintain some other guy's code.

    30. Re:Old problem by Anonymous Coward · · Score: 0

      Perfect is the enemy of 'good enough'.

      In the real world, we need 'good enough' not 'perfect'.

      (Written by one who was complimented many times on the quality of his code, including creating highly readable, non-trivial Perl programs)

    31. Re:Old problem by Anonymous Coward · · Score: 0

      Wow. So your solution to the guy that has "poor work ethics" is to beat the shit out of him in the parking lot? Ok then!

    32. Re:Old problem by Jaime2 · · Score: 1

      Wait, being a good arguer is a problem to be wary of? Often, the better arguer is the one who sees the problem the clearest. Also, the inability to defend a position can be a sign of cargo-cultism. I'm much more wary of someone who calls everything they do a "best practice" without ever being able to describe the benefits of said practice. That's how hungarian naming gets adopted.

    33. Re:Old problem by Anonymous Coward · · Score: 0

      the old problem is, "accountability". the software community by and large is not held accountable. some teams have coding standards, fewer have test standards, fewer have design and implementation standards, and even fewer have productization standards. combine that with the constant movement of software developers and management in places like Silicon Valley, and it gets to the point where most people would prefer not to maintain other peoples code. add on top of that the pressure to deliver in shorter cycles, with fewer resources. now combine that with the fact that the software industry has for the most part, really bad tools. many teams are still using tools and techniques from 20 years ago.

    34. Re:Old problem by Anonymous Coward · · Score: 0

      Linus won't fire you for being slow, in fact he can't pay you at all anyway. That's a pretty big difference.

      I would do what I do for no money, but I wouldn't do it on your schedule or with your constraints, or even necessarily your end goals. That's what distinguishes our jobs from our hobbies. The boss wants it now, you say it can't be done because you can't do it right, I'll say I can do it. You get fired, I get a raise.

      I'm not saying you shouldn't try to write good code TOO. I'm saying that the essence of work entails doing unpleasant things we don't want to do, to accommodate the end goals of the customer. Telling the customer he is wrong is frequently difficult to do and still get paid.

    35. Re:Old problem by Anonymous Coward · · Score: 0

      Woah dude keep that thing in your pants. No one needs to see that.

    36. Re:Old problem by Catskul · · Score: 4, Insightful

      While a virtual disregard for a deadline is a big part of the reason that Linux kernel is as good as it is, that does not mean that quality first is the only way to go, and even the Linux kernel has plenty warts that were compromises. A kernel requires a level of perfection that very few other types of software require. There is a vast range between that and, for example, a convenience shell script.

      It's mature developers who both, know how to create high quality software, and also recognize the value of trading perfection for many other goals at the right time who are the most valuable. And Linus Torvalds is one of them. RMS probably is not.

      I, and I'm sure many other highly skilled developers, find your assertion, that anyone who compromises quality as incompetent, insulting but more importantly, wrong.

      --

      Im not here now... Im out KILLING pepperoni
    37. Re:Old problem by Anonymous Coward · · Score: 0

      You sir, and people like you, obviously are the reason why incompetent individauls exist in our industry. There are cases when you get it done not get it right but the operating system is not one of those cases. That you can not identify that very simple but massively signifigant distinction is moronic.

    38. Re:Old problem by Anonymous Coward · · Score: 0

      Linux does things right because its code is constantly pounded daily by every monkey on the planet with a computer. Not because it ever did things right from the get go. It wasn't even supposed to run on all the systems it does today. Heck they even got linux super computers now.

    39. Re:Old problem by Anonymous Coward · · Score: 0

      So the alternative to not doing it right is not doing it at all? Where do you work which affords such luxuries?

      Also I didn't realise the Linux kernel had strict deadlines to meet. I thought it was always a "when it's ready" kinda thing.

    40. Re:Old problem by smellotron · · Score: 1

      objectively describe what is wrong using with references to either standard or internal best practices or conventions

      are you implying that those criteria are objective?

      I think the GP's "objectively" is referring to the analysis of code given references. Objectively describe which conventions have been violated, with the implication that the violations make the code bad.

      Regarding the "best practices or conventions", any such document really needs to have thorough rationale and examples. Many conventions are very subtle or specific at first glance (or pointless and badong, in the case of the poorer conventions used). Every developer who didn't write that document is going to have a mental argument with most of the bullet points on such a document, and hopefully the rationale and examples can win back some of those arguments. Just like in math class, the authors need to show their work to get credit.

    41. Re:Old problem by Anonymous Coward · · Score: 1

      You sir, and people like you, are the reason why the software industry is comprised of mostly incompetents these days. If there isn't time to do it right, there isn't time to do it at all, and it was your job to make that clear to management. The industry is flooded with people who don't have time to do it right, but do it anyway, and wind up with Garbage. This is the reason why the Linux Kernel is far superior to Windows. In Linux kernel development, there is always time to do it right, because Linus knows what a moronic thing it is to do it any other way, and understands what a clusterfuck it would be if they started just hacking things together to get them "out the door."

      Wow. Are you actually employed? I expected this to be modded as "funny" as opposed to "insightful". Deadlines, like it or not, are a very real thing. There is a vast difference between the best solution and a perfectly acceptable if not perfect solution.

      I am sure that the OP would fight the good fight of "doing it right" when it was absolutely crucial or would result in any issues further down the track (data loss, time critical systems, medical systems, financial systems etc).

      I have no idea why you felt the need to bring Linux / Windows in to your point other than what I perceive as trolling.

      I get the gist of what you are trying to say but your first sentence immediately turned me off your post as it is completely stupid to label OP as incompetent.

      I am aware that this is an anonymous coward post. I don't actually have a Slashdot log on. This is the first time I have ever posted here (despite reading Slashdot for the last 15 years) and is the first time where I have felt the need to comment on something.

    42. Re:Old problem by celtic_hackr · · Score: 1

      This is so very true. I remember when a company I worked for hired another company to come in and upgrade our code to make it y2k compliant.

      First they analysed the code and found the places it needed fixing. We spent time teaching them about parts of the code and they would frequently come and ask us about certain pieces of code. They then made the changes to the code. We knew we had a y2k issue, and where most of it was. A lot of the code they changed was very old, and not actively maintained, because of code maturity.

      Five years later we were still fixing bugs they introduced to the code in the process of updating it.

      Messing with stable and ugly or pretty code is a hornets nest. You might make it look better, and introduce new or even old bugs. I am guilty of that myself. I've even come back to my own code years later and said, "WTF? This is crap code". I would then "fix it", only to figure out, it was needed. Sometimes, you just need to add a hack in code to make it work. Sometimes you forget to comment that hack.

    43. Re:Old problem by celtic_hackr · · Score: 3, Interesting

      Actually the Space Shuttle Challenger was a design choice to save on the cost of shipping the tanks to Florida. The alternate one piece design didn't fit through one specific tunnel along the railroad from the plant to Florida, and would have required overland transit. It was well known within the industry. The other tank design was nearly identical to the design used by Russia. I was in an aerospace engineering class when this happened, and we studied the problem. I'm positive my professor already knew the answer, he was part of NASA's team.

    44. Re:Old problem by celtic_hackr · · Score: 1

      Well seomtimes the right way is more expensive than an almost as good way, and the cost-benefit ratio doesn't justify the right way. Perhaps, a b-tree algorithm is the best thing to do at a point in the code, but an already written sorted list will be nearly as good. Do you take the time to write a custom b-tree function, or link to the existing sorted-list, when you need to ship in two days? The sorted list is known to be bug free and working.

      Take that choice and multiply it by 500 and you get an idea of why code might look like crap, but be very stable and easy to maintain, and faster to implement.

      Consider the man-hours involved in building the Linux kernel, and then figure out what you'd have to charge per copy to pay all those people a decent wage.

      That is the difference between commercial software developed by for-profit companies, and open-source. I'd give odds the Linus kernel is incontrovertibly the most expensive working application ever written.

    45. Re:Old problem by Anonymous Coward · · Score: 0

      When I hear it I think, yes it does so happen that we made mistakes organizing the code. Mistakes in how the programs internal API's are organized. Places where the requirements came together to produce ugly ugly code. That quick hack to get things running which never was rewritten. No we don't have time to refactor is _again_, and wring out yet another set of bugs _again_. And oh while we are at it, add some new features, _again_.

    46. Re:Old problem by tubs · · Score: 1

      Just because you are a good arguer doesn't make you right, it just makes people think you are. Indeed, there are many ways to win an argument - and one of the most effective is to be the last person to put their case, or to have a quiet word in the ear of the decider ...

      --

      try to make ends meet, you're a slave to money, then you die

    47. Re:Old problem by Anonymous Coward · · Score: 0

      Also, sometimes "20 years of experience" means your skills are out of date.

      I had someone up my chain of command who kept specifying Java interfaces which returned both an array, and its length. Over and over, I told him that Java isn't C, and arrays know their own length, and he'd say "I've been programming for 20 years; it's always been the case that you specify the length of an array separately."

      Later I looked at one of the methods he'd written, after finally relenting on the separate length variable issue, I saw how he was slicing arrays in order to comply:


            String asString = new String(data);
            asString=asString.substring(foo,bar);
            return asString.getBytes();

      When I showed him System.arraycopy() he was all, "Oh, handy, never knew about that".

      It goes to show that long professional experience doesn't necessarily mean you know what you're doing; and that sometimes it can lead to a hubris in which you think you can use a language without reading up on the basics.

    48. Re:Old problem by Zero__Kelvin · · Score: 3, Insightful

      "I, and I'm sure many other highly skilled developers, find your assertion, that anyone who compromises quality as incompetent, insulting but more importantly, wrong."

      Most likely you don't understand the term quality. Might I recommend that you read Zen and the Art of Motorcycle Maintanence, or re-read it if you have already done so? Any developer who sacrifices quality is incompetent by definition; that holds doubly true for those who know they are doing it and do so anyway. .

      --
      Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
    49. Re:Old problem by Zero__Kelvin · · Score: 1

      Right. I'm incompetent because I don't get that sometimes doing it wrong is the right way to go. ROTFLMAO.

      --
      Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
    50. Re:Old problem by Zero__Kelvin · · Score: 1
      Your confusion comes from your perceived belief that I think that a b-tree algorithm that gets used infrequently should be optimized. The term right includes these kinds of pragmatic considerations. What I mean by wrong is, for example: Yes, it puts the wrong value in their sometimes, but we'll just compensate later by checking for that case in the client code.

      "The sorted list is known to be bug free and working."

      It seems like we are actually in complete agreement. ... until this:

      " I'd give odds the Linus kernel is incontrovertibly the most expensive working application ever written."

      Windows is far more expensive. The difference is that much of the cost is paid by the poor bastards who get stuck with it, rather than M$.

      --
      Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
    51. Re:Old problem by Anonymous Coward · · Score: 0

      Of course, sometimes no one is actually right. Blue is better than red. Sometimes coders just have strong opinions and it doesn't make them right, wrong, or helpful. Just because you can't prove that your existing way "red" is better than their new fangled way "blue" doesn't make "red" wrong.

    52. Re:Old problem by celtic_hackr · · Score: 1

      You misunderstand my comment. I mean only, if you look closely, you'll see that Linux would far more expensive to "write" and "sell commercially", than any other program. So more expensive in "development cost", only.

      As for Windows, it's actually been fairly stable for a long time.

      I much prefer the Linux kernel. Although, I've had to abadon both KDE and Gnome, due to the dystopic mindset of the developers. Which has been a bit of a step backwards in the use of Linux, making things harder for me on a regular basis. The same exact type of behavior that drove me away from Windows in the first place (that and the entire concept and mindset of Linux and FOSS).

      Windows is still too annoying, so it's still not an option for me [except that I need to use it for my clients who depend on it.]. On top of the licensing BS.

      I know at least one person who loves Windows 8. [sends shivers down my spine, and that feeling you get when you are completely grossed out.]

    53. Re:Old problem by Zero__Kelvin · · Score: 1
      You might want to take a look at KDE again. I was very worried when they announced the switch, and the transistion was very painful, however it is now awesome again, IMNSHO.

      "As for Windows, it's actually been fairly stable for a long time."

      Yes, but solid dog shit is still dog shit ;-) They still take the "Hey, that didn't work and if you want to know why go screw yourself approach to error handling, for example.

      --
      Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
    54. Re:Old problem by Catskul · · Score: 1

      I have read it. And I think you drew the wrong lesson from the story. A big part of the story was that guy going nuts because he didn't know how to find balance in his life and obsessed over the minutia of "quality". I understand that point of view. I've been there. It's not a healthy way to think.

      You can certainly define quality in a way that takes all concerns, including time, into account, but doing so defies the implication you made about the previous poster, that if he included getting something done by a deadline over other technical concerns, he was sacrificing "quality", and therefore was incompetent.

      > Any developer who sacrifices quality is incompetent by definition...

      What definition are you using? Again, unless using some contorted and specific definition of "quality" which you didn't even come close to explaining in your insult to the previous poster, I'll say it again: You're wrong.

      Criticism should always be balanced with a measure of humility. At least consider that people who might make different value judgments than you might not always be wrong. And then consider the "quality" of your sweepingly insulting comment, and consider that in this context, that's the quality that matters.

      --

      Im not here now... Im out KILLING pepperoni
    55. Re:Old problem by Zero__Kelvin · · Score: 1

      "I have read it. And I think you drew the wrong lesson from the story. A big part of the story was that guy going nuts because he didn't know how to find balance in his life and obsessed over the minutia of "quality"."

      So you are saying you've read it, but you didn't understand it. That is why I offered you the opportunity to read it now again. People who defend poor quality are people of poor quality. Quality is like pornography, I know it when I see it. When someone says that they have shipped poor quality code, I take them at their word, and consider their own assessment of themselves to be honest.

      "Criticism should always be balanced with a measure of humility."

      You are really throwing words around without understanding them today. Humility is not pretending to be something you are not so somebody will like you. That's called false humility. If I am the smartest guy in the room, and I know that, it does not mean for one second that I am not humble. If I recognize that I am not a more valuable human being because of it, then I am humble.

      "You can certainly define quality in a way that takes all concerns"

      Actually, you can't properly define it any other way. Again, when you throw out correctness, stability, and maintainability to meet a time constraint, you are by definition, not adhering to standards of high quality. When you do so without knowing it, you are incompetent. When you do so knowingly, you are doubly so.
      The fact that you think I insulted someone cuts to the core of your complete inability to understand what I wrote.

      --
      Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
    56. Re:Old problem by znrt · · Score: 0

      objectively describe what is wrong using with references to either standard or internal best practices or conventions

      are you implying that those criteria are objective?

      I think the GP's "objectively" is referring to the analysis of code given references. Objectively describe which conventions have been violated, with the implication that the violations make the code bad.

      I actually agree, it was this bit (that I failed to include in the quote) that made me probably overreact:

      "arguing code ugliness just becomes subjective"

      because standards, best practices, style guides and guidelines are completely subjective decisions, no matter how backed by thorough rationale or well explained they are.

      of course you can "objectively" compare code to a standard, but the result of this analysis just rates the code against that subjective set of rules, so in essence it's not different at all from "subjective arguing about code", it just dismisses the discussion by invoking higher authority. and that may even be okay and convenient in many situations but it's still far from objective.

      of course my concern is the sort of "fundamentalism" in blind standards compliance i happen to witness more and more in the sw business. it ends up just serving people to cover their asses ... and this produces poor code (in my very subjective opinion! xD).

    57. Re:Old problem by Progman3K · · Score: 1

      I also agree; at one place I worked, many developers were in agreement that the code that another programmer (who had since moved on) had written was above-par.

      I believe I can also appreciate concise, clear code from time to time, even when it comes from others.

      To be fair though, it's usually the reverse

      --
      I don't know the meaning of the word 'don't' - J
    58. Re:Old problem by Anonymous Coward · · Score: 0

      Yes, when I look back at some of my old code, I cringe over some of the ugliness of it.Then I tell myself that it is being used every day by over 3000+ users without error and smile at how it works.

    59. Re:Old problem by Yakasha · · Score: 1

      Actually the Space Shuttle Challenger was a design choice to save on the cost of shipping the tanks to Florida.

      Ya. So they chose "just get it done"

      The alternate one piece design didn't fit through one specific tunnel along the railroad from the plant to Florida, and would have required overland transit.

      Instead of the tougher, costlier, or more time consuming "get it done right."

      And then dealt with the consequences.

    60. Re:Old problem by gatesstillborg · · Score: 1

      Other people's styles definitely present a challenge, no matter how "good" it is. Problem with bad is definitely there. So many more ways to do it poorly than there are to do something well!

      I am fortunate to work at a place where very high standards of technical excellence are upheld. Pretty much all managers come from an accomplished technical background, and many continue to practice. Non-technical managers will defer to a considerable extent on technical matters.

    61. Re:Old problem by Anonymous Coward · · Score: 0

      Reading this thread, I really feel like an old-timer. I've been coding professionally since 1983, in a variety of languages. I have several comments on this.

      1. Over the years, I have learned is to comment out any code that I rewrite rather than delete it, and to include in the comments why I rewrote it. Whenever I am a team lead, then I make that a hard and fast rule.
      2. I have also learned to write a detailed comment on what the code is supposed to do, and in places where several approaches are available, why I have chosen the path I chose.
      3. There's an admittedly vague point one reaches (let's arbitrarily say, half a dozen fixes) in a block of code when it's become time to re-think it. Any single block of code that needs that many repairs has been misconceived.
      4. Whenever possible, I try to convince the project manager of the value of code-refactoring.
      5. Also whenever possible, I try to set the team up in pairs, agile-style.

      In this immediate case, I might try a couple of things:
      1. Give this junior any specific piece of code that she or he read and declared bad code, and challenge her or him to rewrite it. Then see what results you get. It's just possible, though perhaps unlikely, that she or he will actually improve it.
      2. Most of all, this kid needs a lesson in human relations. The way NOT to prevail in such a discussion is by calling the opponent's position bad. Far better the Socratic approach (i.e. asking questions rather than issuing pronouncements): "Have you considered using an array of arrays here? It might result in cleaner code and better performance."

      Arthur

      The most likely way for the world to be destroyed, most experts agree, is by accident. That's where we come in; we're computer professionals. We cause accidents.
      -Nathaniel Borenstein

    62. Re:Old problem by uninformedLuddite · · Score: 1

      I'd give odds the Linus kernel is incontrovertibly the most expensive working application ever written.

      Really?

      --
      The new right fascists are bilingual. They speak English and Bullshit.
    63. Re:Old problem by Anonymous Coward · · Score: 0

      Getting something done *on time* is a quality that is often worth $billions. Some opportunities for profit or success have hard deadlines, and it's either finish on time, or fail completely.

      Almost all non-trivial programs have some behaviors that can be called "bugs", or sub-optimal performance, or above-average difficulty to maintain or extend the code, or intrinsic limits on how well the program can scale to solve larger problems, etc. These are all independent qualities of the code. And, again, finishing the code by a hard deadline is yet another quality of the code, when regarded at the more important meta level.

      All projects have time pressure. Nobody wants to work on a project that they know will be totally irrelevant to everyone (e.g., due to a competing code base getting released in a more timely fashion, so that people can actually get stuff done *today* instead waiting months or years for an alternative that has no guarantee of ever materializing). So, even Linux has some time pressure, and some *sacrifices* must be made -- to avoid "great being the enemy of the good".

    64. Re:Old problem by Zero__Kelvin · · Score: 1

      "Getting something done *on time* is a quality that is often worth $billions." - Emphasis put where it belongs

      OK. Now read what the OP stated: "In the real world, sometimes you have to make the choice of doing things right, or actually getting them done."He did it wrong, and he knew it, but he falsely called it done and shipped it anyway. It was never actually done. I agree that getting something done on time is great. That is not what the OP is talking about.

      --
      Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
    65. Re:Old problem by Anonymous Coward · · Score: 0

      You're a prick who, given your presented persona, likely has very few friends or loved ones.

    66. Re:Old problem by Zero__Kelvin · · Score: 1

      As you may or may not be aware, you recently marked me as your "foe". You may also realize that I have marked you as my "friend" in response. For your personal edification I wanted to elaborate on why I did this. It is not, as you may suspect, that I checked the wrong radio button, nor is it because I consider you either a friend or a foe. In fact, you are just some other random Slashdot poster, with whom I neither care to be a friend or foe. I am, never the less, an extremely magnanimous (and humble) individual who believes in peace and good will to all, no matter how incompetent or unstable they may be. For this reason I have marked you as a "friend". The benefit of my action is that, whenever you see a post from me, you will see a green and red "pill", which I sincerely hope will remind you to take your medication. Have a great life, and don't let those bats get too close!

      --
      Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
    67. Re:Old problem by Anonymous Coward · · Score: 0

      Agreed, by abstracting the criticism from individuals you avoid a blame culture descending on the programming team which is totally counterproductive.
      Standards which are enforced through structured peer reviews should be the norm in companies with programming teams.

      Even when I was working in a team of two we used to look at each others code and pick positives and make suggestions. This was done in a mature and lighthearted fashion where no offense could be taken.

      I have enough experience to know that programmers who run around rubbishing others' work are a negative influence, they are normally insecure in their own abilities. With a calm peer review process they can gain the confidence required to concentrate on their own work instead of belittling others whilst accepting positive critique as a means of improvement rather than a personal attack.

      If they don't, they should be persuaded to leave before they cause 'collateral' damage.

  3. Very simply by houbou · · Score: 5, Insightful

    Critique is only as good as the suggestions for improvement. So, that's your answer. I feel that if someone has issues with my code, then show me better and prove me it is better. In the end, clarity, code reuse, design patterns, performance, all of these things come to play.

    1. Re:Very simply by Anonymous Coward · · Score: 4, Insightful

      It boils down to two questions:

      1) Does it work?
      2) Will I ever touch it again?

      If yes to the first question and no to the second, quality doesn't matter.

    2. Re:Very simply by Ravaldy · · Score: 4, Insightful

      You can never answer #2 with 100% confidence and if you are a seasoned coder, coding it properly won't be harder than hacking it together.

    3. Re:Very simply by sribe · · Score: 1

      I feel that if someone has issues with my code, then show me better and prove me it is better.

      Not necessarily a good idea; I did this to an old guy when I was straight out of college and from that day forward he would barely even speak to me. (Although in this particular case, that wasn't really a bad thing...)

    4. Re:Very simply by jhol13 · · Score: 1

      Prove?

      Oh fuck what an attitude!

    5. Re:Very simply by AwesomeMcgee · · Score: 3

      You're comment about seasoned programmers ignores the countless engineers who spent 10 years in industry only aware of the first rule. The poor sad sods.

    6. Re:Very simply by terec · · Score: 2

      If the probability is 10% that you will touch it again and you invest 100h on rewriting it, then, on average, you wasted 90h of programming time for no good reason. As long as the APIs are reasonable, there is no benefit to cleaning up code preemptively.

      Code needs to be cleaned up or rewritten only if it causes actual problems, and the person to do it is the person who actually needs it cleaned up.

      (There are some exceptions to this rule of thumb, like when people leaving the company are involved or when the code isn't merely messy but truly obscure, but that goes beyond merely "bad code".)

    7. Re:Very simply by Ravaldy · · Score: 1

      I got back to my previous statement. When you first write code, there's no reason to hack it if it's going to take just as much time to do it right. I didn't say anything about re-writting code. Bad code that was written is there.

      This mentality of 'IT WORKS, WHO CARE'. Do it right the first time. If you're seasoned, it doesn't take anymore time than hacking it!

    8. Re:Very simply by terec · · Score: 1

      Well, after a few decades of programming experience, I usually don't know how to get it right the first time. If you think you do, either the problems you are tackling are boring, or you are overestimating your abilities.

    9. Re:Very simply by Anonymous Coward · · Score: 0

      This. If you can't give decryptable notes, you suck as a manager.

      Ever work with an "outsource" vendor? Where you basically have to give them if-then-for-else flowcharts to get something made?

      If you can't tell someone exactly how to fix a problem, you're a PHB and *part* of the problem.

    10. Re:Very simply by Ravaldy · · Score: 1

      We don't usually get it right the first time. That is why there is a need to structure properly. If you do that, refactoring is just a small detail.

      On the other hand, if no pre-coding analysis was performed, failure in initial structure can be devastating but in that case no amount of refactoring will replace the need to recode it properly.

    11. Re:Very simply by Anonymous Coward · · Score: 0

      No amount of "proper structure" is going to let you write good code when you don't know what you're doing. People who solve novel and interesting problems don't know what they're doing.

      And you're absolutely right that if you want nice software when you don't do pre-coding analysis, you need to recode if you want something with a proper structure. However, most of the time, you can delay recoding the software until you actually need to maintain it.

  4. Fakitall by Anonymous Coward · · Score: 0

    Just say "FUCK IT ALL AND DO YOUR JOB!" and then turn back to your display :D

  5. Re:Possibly related? by Anonymous Coward · · Score: 0

    Did you even RTFS? They linked to it.

  6. Is he right? by AdamStarks · · Score: 5, Insightful

    Take a step back and seriously consider his criticism, as if he were one of your 10+ year coworkers. Whether or not he's right informs the right reaction.

    1. Re:Is he right? by Anonymous Coward · · Score: 5, Funny

      Maybe, but we know that he posts to Slashdot as well.

    2. Re:Is he right? by flatt · · Score: 5, Funny

      Whether he is right or not is immaterial. Now is the time to assert your dominance. Sucker punch him and urinate on him while he's down to put him back in check.

    3. Re:Is he right? by Jiro · · Score: 1

      That's really the ultimate answer. Legitimate complaints sound identical to illegitimate complaints when posted as Slashdot articles, but the answer depends on whether the complaints really are legitimate. This is something we are unable to determine, and there's no shortcut to you figuring it out.

    4. Re:Is he right? by tooyoung · · Score: 1

      Exactly. Maybe the author could point out a few examples so that we could better understand the issue. The only thing that we have to go off of is the fact that the author is right and the new guy is wrong.

      I've found in general that people have a tendency to get way too attached to their code. I love throwing out my code if I can replace it with a cleaner and less error-prone solution. Many people I have worked with have the attitude that "it works for the requirements that I was given, so I am not going to change it". The problem is, their code fits into a massive code base with many people working on it. The requirements may be expanded in the future, or the next person who touches the code may not be the author.

    5. Re:Is he right? by Anonymous Coward · · Score: 0

      Congrats. You read the first line of the summary!

    6. Re:Is he right? by AK+Marc · · Score: 3, Insightful

      I've never seen anyone right on this issue (the ones that are actually right quit and go someplace else, solving the issue, after all, would you want to work somewhere where all your coworkers were wrong all the time? I worked there once, and I quit and got a much better job elsewhere). It always boils down to "I would have solved this differently, so your way is wrong.

      It's a geek problem. There's often more than one right answer. You can't always get a single correct answer for every question. And that confuses and frustrates people new to some areas where it's true.

    7. Re:Is he right? by Anonymous Coward · · Score: 5, Funny

      This works and it's a good fundamental method, but it's not extremely efficient.

      I typically like to hire them in a groups. Initially, lay quiet and see who is the more uppity of the bunch. Let him have his moment in front of the new kids and really start to build an alpha status for himself.

      Shortly there after you really want to just casually stroll up to the fresh example and just stab him in the kidneys a few times. This will deal with the problem candidate and build your reputation as someone who gets things done. In fact, it is unlikely anyone will question your authority for some time.

    8. Re:Is he right? by rahvin112 · · Score: 4, Funny

      We are primates, the proper response is to throw poop at him.

    9. Re:Is he right? by dubbreak · · Score: 4, Informative

      Absolutely. Experience (as in year doing software) doesn't mean shit. I had a co-op student under me (who I hired when I started my own company) that could code circles around everyone at the company. He understood software, something some developers just never get. I'm not a bad developer by any means (people jump into my code, understand, modify etc no problem), but he'd usually come up with something more elegant and cleaner. It was give and take as I'd come up with some good suggestions for improvement or ways to solve a problems he hadn't considered (which was partially due to experience, partially due to having a different perspective).

      First step is to understand that young or old, lot's of experience or little, a person can have valuable contributions. For a good team you have to put ego aside. Sounds like there is ego on both sides of the equation in this particular issue. Listen carefully to what he thinks is wrong and he should listen back about the design decisions etc.

      My experience tends to make me think that there are serious issues with the codebase. Depending on language, 50K lines isn't much and could be rewritten by a couple smart people in a matter of months. Obviously the product works, but how long are bug fix turnarounds? How extensible is it? How quickly can you add new features? Do new features ever break other parts of the code (i.e. coupling issues)? You can be proud of what you achieved, but also be honest. I've written some code myself I wasn't proud of (I'm sure we all have). A good developer isn't the same coder as they were 6 months ago, because it's a continual learning process.

      If this jr has valid input, good ideas for restructuring (once you look at your code honestly, "Yeah, there was a better way to solve the issue..") then why not let him lead the dev for the next gen product? If you are honest about the code and he's just an egotistical little shit not willing to discuss things like an adult (some back and forth and actually listen to you and others).. get rid of him. Seriously. It's not going to help your team at all and he's going to cause problems anywhere he goes. If he's right and you're all wrong, then he's better off elsewhere anyhow (though if he's bullheaded and egotistical I doubt that's the case).

      --
      "If you are going through hell, keep going." - Winston Churchill
    10. Re:Is he right? by Anonymous Coward · · Score: 0

      Bonus points if you can name the Sopranos episode.

    11. Re:Is he right? by imsabbel · · Score: 1

      Yup.

      If you have been working for a decade with the same code, a certain blindness to issues will be inevitable. (In german, there is a word for it: Betriebsblindheit)

      He might be right simply because of the outside perspective.

      --
      HI O WISE PRINCE. WHT TOOK U SO DAM LONG?
    12. Re:Is he right? by Anonymous Coward · · Score: 0

      So what you are saying is throw your code at him?

    13. Re:Is he right? by Jeng · · Score: 2

      You just made me consider something I have never thought about before.

      Do wild monkeys throw poo?

      I would think that the ones in zoos throw poo because they can't actually get close enough to rub it in your face and then bite your face off.

      --
      Don't know something? Look it up. Still don't know? Then ask.
    14. Re:Is he right? by AwesomeMcgee · · Score: 1

      Less effective than advertised.

    15. Re:Is he right? by AwesomeMcgee · · Score: 1

      I work there now. Can I join you? PLEASE???

    16. Re:Is he right? by mcgrew · · Score: 1

      Nah, just laugh in his face. Far worse than a sucker punching and a pissing, 'cause when he gets up that young fellow is going to kick your fat old ass.

    17. Re:Is he right? by Gr8Apes · · Score: 1

      What's funny about that - I once ran into a single class that had more LOCs than that. And it was just one among many hundreds, possibly thousands. But this class stood out for many reasons, not least in that it had a cyclomatic complexity of over 200 after the first round of simplifying refactoring.

      --
      The cesspool just got a check and balance.
    18. Re:Is he right? by Anonymous Coward · · Score: 0

      Anecdotal, but, in my years writing code (a little over 20 years now, with the past 4 doing mostly technical direction/larger scale software architecture) I have found that a lot of developers have a real problem with other people's code. I suffered from it myself. It can be for many reasons, from bad code to personal aesthetics. What I learned over the years is that more mature code has many hidden gems. You can rewrite it, but you will likely end up stumbling over subtle details that were worked into a codebase over many years of bug fixing.

      Now I try to ease new developers into the codebase by giving them small pieces to own and get comfortable with. Non critical portions to begin with and then slowly letting them earn an understanding of why the code was designed a certain way. New developers often forget that software needs to work in a wide variety of environments. Enterprises are not a stable, static beast, things change, move, go away. New developers tend to think, "it works great on my machine" or perhaps, "it works great on this test VM". But real environments are not development machines or VMs. New developers hardly ever have an appreciation for defensive coding to handle crazy environments.

    19. Re:Is he right? by Darinbob · · Score: 2

      Then ask what the junior programmer's job really is. Is his job to critique all the other code, or is his job to get a particular set of bugs fixed and features implemented?

      One of the harder things to learn is how to give up idealism and replace with pragmatism. Ie, you have deadlines which means you get the code done even if it's not perfect; you code the feature that the customer wants even if you think the customer is wrong; you eventually start fighting the boss and do what you're told; etc.

    20. Re:Is he right? by Anonymous Coward · · Score: 0

      Except this isn't a real person. This is written by some snot-nosed developer getting his panties in a bunch because of the previous thread from the opposing point of view.

    21. Re:Is he right? by ninjagin · · Score: 1

      You got modded "informative" but I'd give you "insightful", had I the points (I don't comment much anymore). Thank you for making these observations.

      --
      .. pa-ra-bo-la, pa-ra-bo-la, 2 pi R, 2 pi R, where's your latus rectum, where's your latus rectum, 2 pi R
    22. Re:Is he right? by Anonymous Coward · · Score: 0

      stab him in the kidneys a few times. .

      Says a psycopath.

  7. Fire him by Anonymous Coward · · Score: 4, Funny

    Firing him might be the best lesson he ever learns...

  8. You Are Not Your Code by Anonymous Coward · · Score: 5, Informative

    You Are Not Your Code: http://sstephenson.us/posts/you-are-not-your-code

    1. Re:You Are Not Your Code by gabereiser · · Score: 0

      EXACTLY!!! MOD THIS UP! I SHOUT BECAUSE HE'S RIGHT! Maybe, just maybe, your married to your code and don't want to change because you have a good thing going. You write crap code that only you know how it works so that you have job security while the young buck right out of college who learned a thing or two on modular architecture, OOP, and the like wants something that won't take 3 weeks to add a feature to.

  9. Looks like that other guy figured out how by Anonymous Coward · · Score: 4, Funny
    1. Re:Looks like that other guy figured out how by SleazyRidr · · Score: 0

      +1 This is what I came here to say.

    2. Re:Looks like that other guy figured out how by SleazyRidr · · Score: 1

      Actually I take that back, as I just realised it was in the summary...

    3. Re:Looks like that other guy figured out how by Xtifr · · Score: 1

      More relevant (since the one you mentioned was covered in the summary) is this: Real World Code Sucks, from a few weeks ago.

      There are a lot of reasons why real-world code doesn't resemble the stuff you saw in school. Some are good reasons, some are not. The problem domains in the real world are usually a lot more complex than the ones you encounter in school, which is a good reason. Deadlines and the pressure to make it work, rather than make it right are bad (but unavoidable) ones.

      Writing maintainable code is great in theory, but the problem with it is that people maintain it, and the result is usually less maintainable than the original. It's a paradox that should have a name. :)

      Anyway, what this definitely has in common with the previous article (the "How can I explain..." one) is that we don't have enough information to judge who's right. Chances are high that both sides have valid points, but it's impossible to be sure from the outside.

    4. Re:Looks like that other guy figured out how by Anonymous Coward · · Score: 0

      Read the summary you fucking moron.

    5. Re:Looks like that other guy figured out how by Tyler+Durden · · Score: 1

      There are a lot of reasons why real-world code doesn't resemble the stuff you saw in school

      Not always. I remember a while ago looking at some of iD's code for Quake III and being shocked that it actually did look clean enough to be something I'd encounter in school. But they do have a lot more control over their deadlines than a lot of places.

      --
      Happy people make bad consumers.
    6. Re:Looks like that other guy figured out how by Anonymous Coward · · Score: 0

      Suck a fat cock, you pedant.

    7. Re:Looks like that other guy figured out how by Anonymous Coward · · Score: 0

      I'm not being pedant you stupid fuck. Stop projecting your homosexual desires on others.

  10. Get a third party by Anonymous Coward · · Score: 0

    If you have the time, try to find some impartial third party who has nothing to do with your company. Grab a snippet of some code (not enough to give away company secrets or whatever), and have him evaluate whether the new guy is just full of himself, or you are.

    I'd probably bet my next paycheque that the code itself falls somewhere right inbetween the two extremes, but both the new guy and the old guy are too stubborn or filled with illusions of grandeur to see it any other way than what's cemented firmly in their heads.

  11. Mod this up! by ganjadude · · Score: 5, Insightful

    Might as well close the forum down, this is gonna be the best answer concerning this issue. if only I had mod points

    --
    have you seen my sig? there are many others like it but none that are the same
    1. Re:Mod this up! by Anonymous Coward · · Score: 2, Funny

      Mod points are rare these days.

    2. Re:Mod this up! by hardwarejunkie9 · · Score: 1

      Seriously. I think I just heard a choir of angels. This is a beautiful summary. Also, at least the new guy cares enough to take it up, now it's time to get him to do something useful about it

      --
      I like losing arguments, it just means that I can take your point and make it my own.
    3. Re:Mod this up! by del_diablo · · Score: 5, Informative

      No. You only say that until you are almost permanently awarded with mod points.

    4. Re:Mod this up! by Zero__Kelvin · · Score: 1

      Well, it wouldn't matter if they gave them to you anyway, since you post hundreds of times in every thread.

      --
      Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
    5. Re:Mod this up! by splutty · · Score: 1

      Yes...

      For a while now I get a lot of congratulations accompanied by 15 modpoints I have no idea what to do with.

      Not sure when that started, but I seem to have 15 modpoints about 50% of the time I'm even on Slashdot :)

      --
      Coz eternity my friend, is a long *ing time.
    6. Re:Mod this up! by Anonymous Coward · · Score: 0

      Mod points are rare these days.

      If you're an AC like we are, they're practically nonexistent!

    7. Re:Mod this up! by Anonymous Coward · · Score: 0

      I almost hate it because I need to post anonymously. I've looked over many of my posts and they're rarely voted up, but not often voted down either. Some times I also get a random 5 or 10 points assigned also.

  12. timothy is apparently easily trolled by MickyTheIdiot · · Score: 1, Insightful

    Give me a freaking break...

    1. Re:timothy is apparently easily trolled by tippe · · Score: 1

      No kidding... that's the first thing I thought when I saw the title.

      Next on Ask Slashdot: "How can I tell my Slashdot editor that they're an idiot?"

    2. Re:timothy is apparently easily trolled by gigne · · Score: 5, Funny

      yep.

      What next? "I am some code. How do I tell my new maintainers they suck?"

      --
      Signature v3.0, now with 42% less memory usage.
    3. Re:timothy is apparently easily trolled by pixelpusher220 · · Score: 1

      Followed by: "How can I tell the users I'm really just a monkey?"

      --
      People in cars cause accidents....accidents in cars cause people :-D
    4. Re:timothy is apparently easily trolled by Anonymous Coward · · Score: 0

      Troll post was my first thought too. Doesn't make it a bad question though.

    5. Re:timothy is apparently easily trolled by Anonymous Coward · · Score: 4, Funny

      That's easy.

      Perform a Core Dump.

    6. Re:timothy is apparently easily trolled by ifiwereasculptor · · Score: 4, Funny

      "How can I stop my employees from fighting over who's the best coder?

      I don't care about code one way or another. I own a bakery, all I care about is selling bread. I just hired this CS college dropout because he was my cousin's nephew and I owed him a favor, and the kid turned out to be a good employee. Even suggested we bought a computer for keeping our budget electronically, and that worked out well. So, as I was satisfied with this somewhat bright kid, when I had to replace our janitor, I hired a second CS dropout. The problem is they started disagreeing right away about the most irrelevant things you can imagine and now they bicker all the time, have heated, uncivlized arguments about who is the better coder, what sort of software license works best, their choice of cellphone and whatnot. It's really disturbing the workflow around here. Nothing works properly anymore. For example, I never know whether my computer will have LibreOffice or MS Office installed, which means that at any given day I can open only about half my files properly. My customers are also placing complaints and I'm fed up with the food fights they cause. Can someone tell me how to make them stop or, at least, how to properly discern compatible nerds in the future?"

    7. Re:timothy is apparently easily trolled by Tablizer · · Score: 1

      What next? "I am some code. How do I tell my new maintainers they suck?"

      Corporations are people, guns are people, and now code is people too? Holy Humanity!

    8. Re:timothy is apparently easily trolled by DrVxD · · Score: 1

      Joshua - is that you? Would you like to play a game?

      --
      Not everything that can be measured matters; Not everything that matters can be measured.
    9. Re:timothy is apparently easily trolled by Anonymous Coward · · Score: 0

      No: I am a programmer. How can I tell my new code that it sucks?

    10. Re:timothy is apparently easily trolled by wildstoo · · Score: 1

      ...they bicker all the time, have heated, uncivlized arguments about who is the better coder, what sort of software license works best, their choice of cellphone and whatnot.

      If one of them has an Android phone and the other has an iPhone, then you fire the one with the iPhone. No real nerd would put up with Apple's walled garden.

      If one of them has a Windows phone, you take him out the back and shoot him before he has a chance to breed. Not that it's likely.

    11. Re:timothy is apparently easily trolled by Anonymous Coward · · Score: 0

      Fire the second dropout, and ask your cousin's nephew to add janitor work to his current list of responsibilities?

    12. Re:timothy is apparently easily trolled by Anonymous Coward · · Score: 0

      in the coffee maker!

  13. Become Jonathan Coulton v2.0 ? by Qubit · · Score: 2

    < insert witty song about geeky stuff here >

    --

    coding is life /* the rest is */
    1. Re:Become Jonathan Coulton v2.0 ? by rwise2112 · · Score: 1

      At Pascal, well, I'm number 1
      Do vector calculus just for fun
      I ain't got a gat but I got a soldering gun
      "Happy Days" is my favourite theme song
      I can sure kick your butt in a game of ping pong
      I'll ace any trivia quiz you bring on
      I'm fluent in JavaScript as well as Klingon

      --

      "For every expert, there is an equal and opposite expert"
  14. What to do by Anonymous Coward · · Score: 1

    - Have a real code review in your group and get everyone to contribute to better solutions
    - Use all static analysis tools and styling tools available.
    - Remove dead code
    - Refactor redundant code
    - Add unit tests

    Consider that both you and the intern need to ditch your attitudes, and make improvements for the betterment of the product.

    1. Re:What to do by Desler · · Score: 2

      And then reality strikes when management says "NO" to these suggestions.

    2. Re:What to do by gamanimatron · · Score: 2

      Management won't say "no". They'll say, "That sounds good. Do it, but don't change the date for our next release." And everyone will hate the new guy forever.

      --
      cogito ergo dubito
    3. Re:What to do by Anonymous Coward · · Score: 0

      Persuading management that these ideas are worth funding is part of the fun.

    4. Re:What to do by dcollins · · Score: 1

      Oh so much this.

      --
      We know where leadership by an anti-intellectual "strongman" who scapegoats minorities and likes boisterous rallies goes
  15. Re:Possibly related? by Desler · · Score: 1

    Wow could you not even be bothered to even read the first sentence of the summary?

    A week ago, you read the other side of the same question.

    Guess what? Yes, that was the question you linked.

  16. 4 o' clock by Anonymous Coward · · Score: 4, Funny

    outside, at the gate.

  17. bad code offsets by themusicgod1 · · Score: 3, Interesting

    And ask him what you can do to improve yourself? Do so in a way that gives him work to do in correcting you. But either way...offer to buy bad code offsets

    You can always learn, and the world can always stand to benefit from more people offsetting their Bad Code.

    --
    GENERATION 26: The first time you see this, copy it into your sig on any forum and add 1 to the generation.
    1. Re:bad code offsets by Anonymous Coward · · Score: 0

      Or just kick him in the balls and laugh at his newly-found sterility.

  18. Do you always let interns tell you what to think? by jeffmeden · · Score: 4, Insightful

    And a follow up question: do you have any internship openings?

    Seriously, if he was hired as an intern I take it he has little/no real experience, and may not have even finished his formal education. He thinks your code is bad because it doesn't look like the code of whatever professor he most admired in school, or it violates some rule of some particular coding sect that he subscribes to. Tell him to write his objections down in a safe place, and come back to them after a year of working "for Real" and you will gladly sit down and listen to what he has to say then.

  19. It depends on how he goes about it. by ByOhTek · · Score: 4, Insightful

    I would be as blunt, harsh and straightforward back to him, as he is was me, were I in your shoes. I might add a few nails to the coffin of the argument.

    Him: "Your code sucks."
    Me: "Back it up. What suck why."
    Him: *explanation*
    Me: "Well, I can understand you not realizing X, Y, and Z, being new and ignorant, but give it a few years."

    Him: "Why'd do you do [pattern X, Y, Z]? Isn't it better to do [pattern A, B, C]?"
    Me: "In certain circumstances, sure, but in [insert current circumstances and logic for X, Y, Z], this methodology works better."

    Put him in his place if he needs it, otherwise, just educate. Also, listen - just because he's less experienced than you doesn't mean he hasn't picked up something useful. I know a lot of people who think they don't have anything to learn from the new guy, when the new guy had a few tricks up his sleeve. I've been one of those people who's learned from the new guy he didn't suspect. I've also been the new guy with unsuspected tricks.

    --
    Self proclaimed typo king, and inventor of the bear destroying coffee table (patent not pending).
    1. Re:It depends on how he goes about it. by ByOhTek · · Score: 2, Informative

      You should also try to avoid my typos and grammatical errors. Those will not help your case.

      --
      Self proclaimed typo king, and inventor of the bear destroying coffee table (patent not pending).
    2. Re:It depends on how he goes about it. by Anonymous Coward · · Score: 0

      Unless it's totally obvious why you choose a particular methodology over another, then it's arguably your fault that someone else asks you why — not their fault — because your code should include comments explaining your rationale. This is especially true if you tried one approach first and then found a better approach later. Always document choices like that.

    3. Re:It depends on how he goes about it. by caywen · · Score: 2

      Templated examples. I like it, we should do more template meta posting.

    4. Re:It depends on how he goes about it. by LordLimecat · · Score: 2

      I definitely try not to make typos when having a verbal conversation. You're right-- it does help.

    5. Re:It depends on how he goes about it. by neurovish · · Score: 2

      I think the "what suck why" phrasing goes an extra step into emphasizing the dismissive attitude. His objections are so far beneath you that he does not even deserve the time it takes to create a properly formatted sentence with all of those useless articles.

    6. Re:It depends on how he goes about it. by SourceFrog · · Score: 1

      The problem is not the code, the problem is a human one, the young coder has an ego, has no clue how coding works in the real world (where you're usually pressed to pull off miracles on extremely short deadlines), and has already decided the older coders suck. You cannot change his mind, because there is no way to express on him the conditions under which the code was developed. It's something he has to learn through years of experience, and because of his ego, by the time he has learned it, he won't care to even reconsider his poor opinion of the older code, it will be something long-forgotten.

      I've met coders like this and they are actually a problem because they tend to do their own thing, even when told to do X, they go and do Y because they "know better", and end up incurring extra costs and making a mess, and you'll be cleaning it up. Your best bet is that he decides he's too good for your team and leaves of his own will.

      Listening and learning from one another is something that professional coders do. The fact that he is ripping into a coder 10 years his senior suggests an extreme lack of professionalism that you just can't fix, and probably can't work with in the manner you describe - he is behaving more like a primate guided by primitive instincts to dominate as some sort of alpha male, than as a professional coder ready to either learn or teach in an environment of mutual respect.

      --
      My other UID is three digits.
    7. Re:It depends on how he goes about it. by SourceFrog · · Score: 1

      Just to add to the above, a coder behaving like a primate trying to assert an alpha position, this is also normally a huge 'red flag' in other areas - the intellectual dishonesty and the lack of respect will manifest in other ways. I predict he will do other 'ugly' things, like take credit for the work of others, fail to give credit to others when its due, and engage in backstabbing and manipulative office politics.

      --
      My other UID is three digits.
    8. Re:It depends on how he goes about it. by Darinbob · · Score: 1

      "Because we needed to ship the code and we've got too much to do now to go back and rewrite it all."

  20. I thought... by SternisheFan · · Score: 4, Funny
    I thought if you were supposed to call in sick if you had a bad code. :-)

    *ducks*

    1. Re:I thought... by Anonymous Coward · · Score: 3, Funny

      I thought if you were supposed to call in sick if you had a bad code. :-)

      *ducks*

      I got debug bad.

    2. Re:I thought... by LordKronos · · Score: 1

      I thought if you were supposed to call in sick if you had a bad code. :-)

      *ducks*

      I've tried that, but every time I call in, they make me return to work anyway.

    3. Re:I thought... by PRMan · · Score: 1

      That's why you e-mail in and then stop answering phone calls and e-mails...

      --
      Peter predicted that you would "deliberately forget" creation 2000 years ago...
    4. Re:I thought... by omnichad · · Score: 1

      But if you don't answer your phone, you're not home sick. You have to prove you're not taking a trip somewhere. At least that's how it is if you live in an at-will employment state and you have a bad employer.

    5. Re:I thought... by sconeu · · Score: 1

      I tried using ducks to cure a bad code too... It didn't work for me either.

      --
      General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
    6. Re:I thought... by Anonymous Coward · · Score: 0

      whoosh

    7. Re:I thought... by Anonymous Coward · · Score: 0

      And I want fock on the table and shit on the bed.

    8. Re:I thought... by Anonymous Coward · · Score: 0

      Godda sore node?

  21. Is Your Code Designed to Build Walls or Bridges? by VoidEngineer · · Score: 5, Insightful

    Recently went through this myself. Despite having used a kanban board, used version control, commented code, written unit tests, etc, some junior devs thought the code sucked. My takeaway was that there were still too many barriers to entry. Too many passwords, not enough installation instructions, etc.

    Somewhere in the process of learning to write production ready code, it occurred to me that it was necessary to work the process backwards. Begin a project by setting up your hosting or distribution environment before starting to code. Write unit tests before starting to code. And so forth.

    Getting other people to contribute to your project requires the same kind of thinking. Set up a project page before you start to code. Write a vision statement before you start to code. Write installation instructions, coding style guidelines, and operations support instructions before you start to code. That way, as you proceed in the project, you have clearly build up the documentation that other people are going to need to join your project. These things shouldn't be started after the fact.

    If you can't point a new dev to a website and say 'download the source and instructions' here, it's probably too complicated and will meet resistance.

  22. 50,000? by Anonymous Coward · · Score: 0

    Only fifty thousand lines? Is this really possible?

    1. Re:50,000? by obarel · · Score: 1

      You'd be amazed what APL can do in a single line.
      I wouldn't like to read 50,000 lines of it, though.

    2. Re:50,000? by DrVxD · · Score: 1

      You can do ANYTHING in three lines of APL.
      Unfortunately, each of those lines is known to only one of the three remaining APL programmers.
      And they don't play nicely together.

      --
      Not everything that can be measured matters; Not everything that matters can be measured.
  23. A good opportunity by Anonymous Coward · · Score: 5, Interesting

    From your description, the guy isn't mean spirited. He's likely never had to deal with multiple revision code bases before.

    On the other hand, if this is code that has been through multiple revisions and re-purposes, admit to yourself -- it probably is bad. I'm the lead engineer and dir. engineering at a company I've been at for 10+ years, and I'll be the first to tell you that the code-base I am most proud of (30-50k lines of embedded/DSP code, mostly mine) is TERRIBLE! I wouldn't wish that code-base on my worst enemy. But its also been bread and butter for the company for the last decade and is stretched to its limit.

    We've had at least two hotshots come onto the project in that time who have been terrified seeing that code-base and declaimed it as schizophrenic at best, and they are right. It is bad code, poor coding practices, and everything else bread out of necessity to keep the project(s) going and alive.

    Your mission -- accept that whatever reasons are out there for the code being the way that it is, it probably is poorly structured and could use a rewrite. SO - this is a good chance for him to learn that not every bit of code that should be rewritten can be. Its called business reasons and experience. Whatever the reasons, you probably, as a company, don't have the time or resources to rewrite from scratch (we surely don't!), but a fresh out of school developer probably has not experienced these -non-engineering- reasons for bad code, and certainly was not there for the blood, sweat, and tears that went into them. He won't know about those all nighters that "saved the company" that you and the rest of the team probably went through en-route to this codebase.

    1. Re:A good opportunity by Dodgy+G33za · · Score: 1

      "not every bit of code that should be rewritten can be"

      To right. I worked with a guy who took it upon himself to completely restructure a core product when implementing a fairly small new feature. What should have taken a month ended up taking 6 months and a massive regression testing effort because he broke the code so bad it kept failing. We ended up shipping six months late. The guy should have been fired, especially as he had previously asked to do a rewrite and was told not to. The worst part about it was that even after this experience he was still happy with his decision because he had better code.

      What many, if not most, programmers do not get is that there are costs to rewriting outside of their own little worlds. Non-fuctional changes require testing, and may require the users of the software to do their own re-testing. You may also need to retune your operational monitoring rules to cope with any changed usage patterns of memory, disk or IO. In addition functional changes may need supporting documentation, help files, marketing material etc updated.

  24. any problem here? by Anonymous Coward · · Score: 0

    What is the problem with his criticism? Encourage him to write a patch for improvement. If it's better than what there was before, he was right all along and you have learned something new; otherwise he has learned something.

    Perhaps the problem is you just don't want to hear criticism of your work (a common problem). In this case you should consider working in a team where there is less back-and-forth. Like a one-person company.

  25. Don't be a dick by uepuejq · · Score: 4, Insightful

    Ask him how he would do it, and be genuinely interested in his response. Maybe he just wants to beat his chest a little, and maybe he'll even say something useful.

    1. Re:Don't be a dick by bmimatt · · Score: 1

      Yeah, and next time duke it out by the water cooler, or wherever the equivalent space it is your workplace has provided.

  26. How's your documentation? by dbc · · Score: 5, Insightful

    I'm sure if he re-reads your internal design specifications, coding standards, and comments in the code he will understand your design.

    1. Re:How's your documentation? by Jawnn · · Score: 4, Funny

      I'm sure if he re-reads your internal design specifications, coding standards, and comments in the code he will understand your design.

      What's the giant whooshing sound? It's as if thousands of blissfully ignorant "senior" coders suddenly missed your sarcasm, all at once. Well done, sir.

    2. Re:How's your documentation? by Anonymous Coward · · Score: 0

      Wrong, in this case. It's 50,000 LOC. That's minscule. Certainly not enough to have design, code standards, etc.

  27. Re:Do you always let interns tell you what to thin by ByOhTek · · Score: 4, Insightful

    It's also possible the younger coder learned a trick developed since the older coder got his skills fairly solidified, and the older coder never saw, or came up with in his own experiences.

    Just because the new guy is disagreeing and less experienced, doesn't make him wrong. Yes, 9 times out of 10, the new, less experienced guy will be wrong, but that 1 time out of 10, makes it worth giving the other 9 times a fair hearing as well.

    --
    Self proclaimed typo king, and inventor of the bear destroying coffee table (patent not pending).
  28. Those who are not satisfied with others . . . by PolygamousRanchKid+ · · Score: 4, Interesting

    . . . are really just not satisfied with themselves.

    Give him a copy of "The Psychology of Computer Programming", and tell him to read the bit about egoless programming . . .

    --
    Schroedinger's Brexit: The UK is both in and out of the EU at the same time!
    1. Re:Those who are not satisfied with others . . . by gstoddart · · Score: 5, Informative

      Give him a copy of "The Psychology of Computer Programming", and tell him to read the bit about egoless programming . . .

      This, a thousand times this -- but remember, it works both ways.

      The professor I worked with closely in university was a strong proponent of this. Sit down, go over the code, look at what can be made better and why, and what may need to stay crufty because it's arcane, and if someone doesn't understand something that's an excellent time to explain it. Walk through and review everything, and don't let your vanity get in the way of writing better code.

      He called it egoless programming back in the 90's (no idea how old your book is), and I've found it extremely handy -- objectively look at your stuff and see if he's right. If he's wrong, explain it to him. In the end, the better solution should win out (unless someone is being stubborn or the 'better' solution is technically feasible, which does happen).

      Get over the whole "I'm a code guru who knows everything", and be prepared to explain, justify, or even accept that you're wrong. In the end, you review your code to make sure it is as good as you can make it (within reason) and your junior guys get up to speed and understand things better. You get better code out of it, your junior guys get up to speed faster, and you might even learn something along the way.

      It's still how I work with co-workers, and it helps in a lot of ways -- instead of saying "here's the solution", you start with "here's a solution, what have I missed?"

      You won't agree about everything, but you can pick your battles and try to reach quorum -- the cats don't need to be herded when they're on-board in the first place.

      I've seen really awful, and really good ideas from junior coders -- part of the process is helping them understand which is which. In a year or so when he's got more real experience, and knows he can have the discussion, both you and he might actually be better coders for it.

      --
      Lost at C:>. Found at C.
    2. Re:Those who are not satisfied with others . . . by PolygamousRanchKid+ · · Score: 1

      He called it egoless programming back in the 90's (no idea how old your book is)

      The psychology of computer programming, Gerald M. Weinberg, Van Nostrand Reinhold, 1971

      The concept was first propounded by Jerry Weinberg in his seminal book, The Psychology of Computer Programming -- http://en.wikipedia.org/wiki/Egoless_programming

      I'll skip the lawn comments . . . :-)

      --
      Schroedinger's Brexit: The UK is both in and out of the EU at the same time!
    3. Re:Those who are not satisfied with others . . . by Anonymous Coward · · Score: 0

      ditto!

    4. Re:Those who are not satisfied with others . . . by Anonymous Coward · · Score: 0

      The Psychology of Computer Programming was originally published in 1971... which I bet predates the birth of 80% of the people who read Slashdot.

  29. Show him this page. by Anonymous Coward · · Score: 0

    You are very fair and polite in your description of the situation, so show him this page with all the responses.
    Give him time with that, and to get a more mature viewpoint through that experience.

  30. Put him in your shoes by kvnslash · · Score: 2

    Sounds like he wants to be a big boy. Put him in your shoes with an incredibly challenging and time-sensitive project (real or fake). Then start changing the project requirements every week/day at random. In my experience this is how shitty code gets made (other obvious way is person is inexperienced).. If his code works and looks great and is bug free, maybe you'll learn something, if not, maybe he will..

    1. Re:Put him in your shoes by Anonymous Coward · · Score: 0

      Well, in that case the code really is shitty, and the critisism is valid. Sometimes there are explainations why the code is as bad as is it, apart from the programmer not being very good. Of course, often code is bad because someone coded a solution without doing proper analysis or programming (i.e. not understanding the problem or not translating the understanding of the problem into a good solution for a computer).

      I have written subotimal code under time pressure. Not code I am proud of, of course. Being "out in time" is an explaination, but not an excuse. So I try better next time.

      Scope drift is usually the killer for quality. Plan to scrap th code base and design at some point.

  31. The most valuable lesson by pudknocker · · Score: 1

    If a co-worker can't present criticism in a constructive way, his road to success in a company is going to be long and steep.

    Anyone who's written any serious code knows that compromises are made too often because of schedule or resource limitations. If you haven't done that you work for an imaginary company or you are lying. Code/software architecture can almost always be improved, but if there is not a business case (and often, even if there is), it will still not be improved.

    The most valuable lesson this intern needs to learn is that you work with people and they are human. If you call my children ugly, then anything else you say is not going to be greeted warmly.

  32. To be 'sensitive' or not to be... by adosch · · Score: 1

    We've all been in situations where a new hot dog 'somebody' comes into the workplace, swings the dong around to show their intellect or to make their positional place in their new turf. Put your tenure and title away, along with his/her blunt explanation or criticism of your code for a second and I think what you have to consider is merely a few things:

    1) Did he/she make you think about something you didn't consider before or how to handle?

    2) Did he/she offer absolutely any real suggestions with proven code that will expand on what you did and make it better?

    If it's 'no' to both, then tell that person to piss off. Because it's nothing more than someone wanting to hear themselves speak.

    I have this happen to me all the time: People question what you, how do you, why you do, not because there's some sense to 'learn' from your experience, because they are just simpletons who try to be this all-knowing-intellect-goat and 'look good' in front of their peers.

    I think if you have a perfect, well-balanced, engineered, methodical and concrete explanation WHY you did something, then I would consider the person's commentary as a fart in the wind and certainly as nothing more than being a typical douche-bag trying to hand out solutions-looking-for-problems.

  33. comments are free by apcullen · · Score: 1

    It sounds as if your code is lacking. Specifically, you need to add some comments to explain WTF you are doing and/or why TF you did it that way. There is no excuse for anyone looking at your source code to not understand it.
     
      Did you have to use a funky data structure because jerry's an idiot and his functions couldn't handle your original one? There's a way to explain that:
     
    /* changing to this funky data structure because jerry's an idiot */
     
    /*funky data structure description follows:... */

      An old mentor of mine once told me "I try to comment my code as if, a year from now, an idiot may be looking at it and trying to figure out what I was thinking, because I may have to look at this code a year from now". That stuck with me. Even if you can remember all the reasons why you did things yourself, if your code doesn't have comments explaining these kinds of things clearly, be prepared to defend it over and over again every time someone looks at it.

    1. Re:comments are free by Desler · · Score: 2

      There is no excuse for anyone looking at your source code to not understand it.

      That's a ridiculous statement and standard. Lack of experience or knowledge of the problem domain is often a reason why people won't understand code. Now the code might genuinely be poorly-written, but just because newbie hot shot doesn't understand it doesn't mean it's bad.

    2. Re:comments are free by Dixie_Flatline · · Score: 1

      If there are good comments in the code, people will at least understand the process if not the details.

      If you're writing code that Snafucates something (and we all know how difficult properly snafucating an arbitrary thing is), an outline of the algorithm in the method comments will save everyone some time. Not everyone that comes and looks at your code needs to understand it intimately--sometimes they just need an overview to understand how various systems fit together.

      If someone coming into the code DOES need to understand it intimately, the comments let them get a good idea of what's coming. They start to form a mental picture of how the code will go about the task of snafucating things.

      I've come into heavily mathematical code more than once and had very little trouble understanding it because of the good comments and description of the solution. That domain is not what I'd consider my primary strength, and the code is usually very terse for performance reasons. Good comments solve a lot of problems--assuming both the code and comments are correct.

  34. Different philosophies by scorp1us · · Score: 2

    Well I am back at the place where I was 10 years ago. I thought the code was great then, I think it is shit now.

    But what I've learned in the intervening time, and having been a software development manager myself, is that code is optimized on a few axis:
    - Brevity (get er done!)
    - Clarity (I'll be able to read this again in 5 years and understand it)
    - Structure (Object models)
    - Formatting
    - Efficiency

    All of them factor into a meta category, which I call "Maintainability", where you want high clarity and structure. Maintainability is by far the most important aspect to an organization. Your n00b developer won't have your company's maintainability desire in mind. Efficiency is the dead last because increased computing power is cheaper than the development time to make it efficient, save some scenarios.

    So my recommendation is to have him rate his code on those axis and your code on those axis. Hopefully he'll learn there's more than one way to code. It is very likely he's just out of school and his head is filled with registers and asymptotic running times. Those are important, but not as important as shipping maintainable code on time.

    --
    Slashdot's rate-of-post filter: Preventing you from posting too many great ideas at once.
    1. Re:Different philosophies by PRMan · · Score: 5, Insightful

      I've said this at several workplaces:

      What the Business values:
      1. Correctness
      2. Reliability
      3. Maintainability
      4. Speed
      5. Coolness

      What the Developer values:
      1. Coolness
      2. Speed
      3. Correctness
      4. Maintainability
      5. Reliability

      Don't believe me? Look at practically ANY open source project. Most are unreliable and impossible to contribute to. They are often incorrect, but they are usually fast and the programmer always thinks what he's doing is mega-cool.

      Developers need to adjust their mindset to be valuable to the business, but sadly most business code looks more like the second list than the first.

      --
      Peter predicted that you would "deliberately forget" creation 2000 years ago...
    2. Re:Different philosophies by Dodgy+G33za · · Score: 1

      I get your point but there is no way you can universally say that all businesses want the same thing. Or coders for that matter.

      Air traffic control systems vs a game for example. The most important thing to the business selling the latter might be hitting a date. Or having it look nice enough to sell.

      Similarly maintainability only applies if you intend to maintain your product.

    3. Re:Different philosophies by hagrin · · Score: 1

      I find it telling that Security isn't listed on either list and thus the proliferation of insecure software.

  35. Both Stories Start From A Bad Place by ios+and+web+coder · · Score: 1

    Each one immediately assumes that they are in the right.

    As I've said before, negative feedback improves the product. Positive feedback improves my ego, but little else.

    I don't like the standard "Don't complain unless you have a solution!" response. Often, the "solution" sucks, so we use that as a way to beat up the "whiner." Or, it is just used as an excuse to shut them down.

    I get really, really pithy feedback on some of the stuff I write. That's because of its audience. Folks that are used to beating their problems into greasy stains on the sidewalk.

    Saying "F**k Off!" is not an option.

    It's my job to research the feedback. Sometimes, they are right, sometimes, they are wrong.

    My first software job was working on 100,000+ lines of 1970s-vintage FORTRAN IV code, through 300-Baud modems. The code sucked. This was everyone's (including the original author's) opinion.

    Still, it was our product, and we had to keep it going. Bug fixes often were most effective when done after circling the cubicle 3 times widdershins, and sacrificing a can of Jolt. You poked, and hoped that it fixed the bug.

    After that, all code smells like Chanel No 5 to me...

    --

    "For every complex problem there is an answer that is clear, simple, and wrong."

    -H. L. Mencken

  36. Re:Is Your Code Designed to Build Walls or Bridges by phantomfive · · Score: 3, Interesting

    Yeap. If you have 50,000 lines of code, and it isn't clear how to enter it and begin to understand it, then the code sucks. It might be good in other ways, but in at least one crucial way it's bad.

    --
    "First they came for the slanderers and i said nothing."
  37. Bring in your team lead by mykepredko · · Score: 1

    Interesting question and one I've thought about for a bit since the original question, from the other side came out.

    I would say, bring in the team lead as an arbitrator. It's their job to direct the work and (hopefully) develop team members - this guy sounds like he needs a bit of development and level setting.

    myke

  38. Hilarious! by chris200x9 · · Score: 1

    About a month ago there was a "How do I tell my co-worker he writes bad code?" and now this!

    1. Re:Hilarious! by Derekloffin · · Score: 1

      Even more hilarious, it says that right in the summary. This one seems to be a good test for people actually reading the summary.

    2. Re:Hilarious! by Desler · · Score: 1

      It's even the first sentence!

    3. Re:Hilarious! by chris200x9 · · Score: 1

      Wrong it was in the safe to ignore slashdot crap, sorry for only reading the summary...

  39. Clarity & Maintainability by Anonymous Coward · · Score: 0

    Clarity and maintainability are characteristics of good code as well. Not just the smallest, tightest, most accurate, fault tolerant or most abstract design/implementation possible.

  40. It's the circle of life... by Anonymous Coward · · Score: 0

    Everyone, and I mean everyone thinks the code they're working with is shit and they can do better. In reality all code settles down to the least common denominator.
      The problem that the "new guy" has that the seasoned people don't have is facing the reality that deadlines, design mistakes, inter-operation with different teams, maintaining an old code base, changes in coding style between developers, maturity of the company, maturity and stamina of the active coders all factor into a project. Not to mention simply setting the right standards and scope to get the project done. If you have never seen someone make horrible desperate compromises to meet a deadline, you haven't worked long enough.

  41. Stop writing shit code. by Anonymous Coward · · Score: 0

    Problem then solves itself.

    1. Re:Stop writing shit code. by zarmanto · · Score: 1

      Incorrect; the only way to solve the "problem" of ten years of legacy code -- bad or not -- would be to refactor all of it. New Guy is obviously full of idealism and wants to do exactly that, while the OP just wants New Guy to go back to his desk and get some real work done.

      Obligatory personal anecdote: On my current project, my supervisor (who is also a developer) has specifically stated that refactoring is not our priority until the deadline is met. Of course, everyone knows perfectly well that the next deadline will almost certainly be just as much of a pressure cooker as the current one -- which means that refactoring very rarely gets done at all, unless the old code is so bad that it hinders further progress. (I just finished refactoring some of our code for that very reason.)

      Moral: If it ain't broke, don't fix it. If it is broke, don't hesitate to acknowledge it, and do something about it.

    2. Re:Stop writing shit code. by zarmanto · · Score: 1

      Oh... and the ultimate irony in all of this is that my current project is, by definition, an entire refactoring of a legacy project, which is no longer maintainable going forward. Life as a developer...

  42. As time goes on... by CFBMoo1 · · Score: 1

    I've come to realize that the code I wrote years ago could have been done better. There might be some truth to his words but he might not realize yet that as time goes on you get new deadlines, projects, etc that can keep you from going back and changing things. This is especially true if those things are working fine the way they are so why fix what isn't broken?

    Note: This isn't saying that you never have to go back and fix things, just that the time isn't always there when you'd like it to be. One of many reasons why that person is at your desk since they got fewer deadlines and more time so to speak as the new guy.

    --
    ~~ Behold the flying cow with a rail gun! ~~
    1. Re:As time goes on... by CFBMoo1 · · Score: 1

      Not to intentionally reply to my own post but one other thing I thought of.

      Code I've looked back on and asked why they did it that way was sometimes greeted with the response of, "Because they didn't have the fancy new way of doing it back then in the development tools." As time wears on better options show up, I especially notied this when my work place finally upgraded the database to one that supported regular expressions.

      --
      ~~ Behold the flying cow with a rail gun! ~~
  43. Re:Possibly related? by magarity · · Score: 5, Funny

    This questioner says he's been at the company 10 years and the new kid is hassling him. That prior question says the guy he's hassling has been at the company longer than the hassler has been alive. If they've hired a 9 year old as a coder then they deserve all the atttitude they get.

  44. Give it time by Anonymous Coward · · Score: 0

    Every new guy coming onto a project thinks the existing code is crap. They will want to rip it all out and do it over from scratch. And, if they did, they would quickly run into all of the bugs and problems which caused the code to take on the form it does. New out of school coders are terrible for this as production code rarely looks like textbook code.

    My suggestion would be to explain why you do things your way. Then ask him how he would improve the design. if he has good ideas then that is great. if his approach has obvious flaws, point them out to him. One of you (hopefully both) will learn valuable lessons from the exchange.

  45. WYSIWYG by Anonymous Coward · · Score: 0

    Stay in the agreeing side with him. Let it be, we can all have opinions. Now, ask him do this:
    * Go out in the wild and find code-dissecting and style- or flaw-checking software tools (snavigator and its spinoffs).
    * Ask him produce all sort of reports with these tools, especially the call graphs, inheritance if there is such etc.
    By the time he finishes, he will know the code inside/out, have asked the interesting questions and even have started contributing back.
    If he can't follow that, he's probably not ready for the team aspect.

  46. Admit he's right by bakedbread · · Score: 1

    All real world code sucks. Seriously. Mine, too. It's all a matter of priorities. Writing good code is hard. Writing good code that is constantly changing is almost impossible. Considering the value of the resources (your time) it would be stupid to not except trade-offs. When someone joins the project it gives valuable information where the parts are that are difficult to understand. Improve them by making them clearer and everyone profits.

  47. He's probably correct! by Anonymous Coward · · Score: 0

    When faced with spending an additional, relentless, unpaid and thankless 20 hours per week to fix the engineering mistakes and sloppy code, he'll fall in line soon enough. You can throw a "welcome to the world of the career programmer" party for him when he figures it out.

  48. Do your code actually suck? by Anonymous Coward · · Score: 0

    Before defending you, we need to know if your code actually suck or not. Post some example or something, then we will help if you deserve it.

  49. He has some growing up to do, Knuth by raymorris · · Score: 1

    it sounds like he has some growing up to do. with that fact out of the way, you are not Don Knuth. at least some of his points have merit. Put aside pride and work to understand his viewpoints. Only after you clearly understand what he's saying you can a agree or explain tight deadlines or explain why the existing approach is better. You can certainly make liberal use of terminology he's unlikely to understand to put him in his place. First, though, be sure you're really listening. Seek first to understand, then to be understood.

  50. Well, he's young, so you're a moron by mveloso · · Score: 2

    By definition your code sucks, because it's legacy code and you wrote it.

    So what? Does it work? Does anyone want to fuck with it? Is he willing to risk his job to change the code and break everything?

    New developers want to rewrite everything, and don't understand that new projects don't happen often - and when they do, they don't get to work on them unless they have skills. That doesn't mean they need to kiss ass, but it does mean that they have to write code that works.

    Maybe there -is- a better way to write it now. It'd be worth it to ask. Maybe he's right? Most likely he's has no context - it's written that way because it was written that way. Maybe he can rewrite it in his spare time and show everyone.

    NOTE: if he was able to read your code and said it sucks and should be refactored or something, that means the code doesn't suck as much as he said it does - because he could read and understand it. That means that it's maintainable. So that's a plus on your side.

  51. You have misdiagnosed the problem. by taustin · · Score: 1

    The problem isn't the intern who doesn't understand your code. The problem is the intern who doesn't undestand how to interact with grownups.

    Explain to him that if he ever wants to be an employee - there or anywhere else - instead of an intern, that he needs to learn to be more diplimatic.

  52. Maybe you code _is_ bad? by gweihir · · Score: 2

    The only way to deal with this professionally, is to look at his complaints in detail and either refute them or acknowledge them. Code quality is an area that cannot tolerate any power games. Have him actually explain in detail why he things some piece of code is bad and then explain to him why it is not, or why there are external circumstances that require it to have the form it has. Make that perhaps a repeated session, until one of you learns something about their coding skills. Go into this open and with a pure technical PoV. If he should happen to be right, then he is right. If not, you have to be able to explain why. That will also deal with the most common source of this behavior: The younger person feels under-appreciated and not respected.

    If that approach goes nowhere because he cannot admit limits in his skills or is unwilling to learn, escalate to management. But make very sure the problem is not on your side before you escalate. Typically, escalation will not be needed, but some junior engineers are so convinced of their own superiority, that they cannot see anything else and cannot learn. I had that twice. In one case it resulted in the termination of the lady in question. That one was so set in her ways, she was not even willing to implement an interface designed by somebody else, but could not explain why it was bad. (It was not. She was just not able to implement anything not of her own design.) Zero team-working skills and zero ability to learn. It happens and it is not your job as a developer to resolve it.

    --
    Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    1. Re:Maybe you code _is_ bad? by Anonymous Coward · · Score: 0

      I think everyone is giving the OP way too much credit... Technology and development are constantly changing. Someone who's been in the biz for 10+ years and hasn't kept up with the changes will, of course, generate crappy code.

    2. Re:Maybe you code _is_ bad? by gweihir · · Score: 1

      Actually, no. "Crappy code" is not dependent on the development of technology. "Crappy code" is generated due to lack of skills and insights. Not using the newest features has nothing to do with it.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
  53. Define "bad" by SirGarlon · · Score: 5, Insightful

    As an engineer, I've adopted the maxim that there is no good and bad, only fitness for a particular purpose. I prefer a discussion of trade-offs to statements of principle.

    I tend to ask "what requirements does this code fail to meet?" And very often, the reviewer has invented his own new requirement! Depending on your process, your response might be anything from "good point, let's add a test case for that" to "you should submit a Requirements Change Form for that. Make sure to get all the required signatures."

    And if the criticism is for something immeasurable like "readability" or "maintainability" you can let your critic make the case to the boss why fixing this code is worth the cost.

    --
    [Sir Garlon] is the marvellest knight that is now living, for he destroyeth many good knights, for he goeth invisible.
    1. Re:Define "bad" by Todd+Knarr · · Score: 1

      I always considered readability and maintainability to be implicit technical requirements for any project. Simply put, new people will have to read and understand the code, and you will have to maintain and enhance the code. The code therefore needs to be amenable to being read and maintained. If it isn't, you end up wasting time and resources fighting the code that could've been spent delivering new features.

      Case in point: a data-acquisition component I work on. When I started it supported 3 data sources, and supported only straight-TCP network sources using source-specific protocols over a socket. It had a lot of problems, a lot of places where code for a common task had to be duplicated in the implementation of all 3 data sources and a lot of places where code was intertwined that didn't really have any commonality, but with such a small number of data sources it was livable-with. We rarely added data sources, so there wasn't a lot of payoff for improving the code.

      But then after I started working on it, things changed. Instead of 1 new data source every 4-5 years, we got 3 new sources in one year. And a new type, based on HTTP POST rather than messages over a simple TCP socket. Worse, we were told that this kind of pace was going to continue, and that we were going to get more types of data sources like ones pulling from SOAP services (HTTP can still be thought of as text requests and responses, but SOAP ends up looking like actual objects and not simple text strings). It was taking too long to do simple things with the code, and we were spending too much time tracking down and fixing bugs caused by new changes breaking old code that we didn't realize was affected. So I pretty much twisted arms until I got the OK to rewrite it based on what I knew we were going to be asked to do.

      The payoff? Cut the time to add a new type of data source in half. Cut the time to add a new data source of an existing type by 80%. Virtually eliminated a class of recurring bugs where we'd fixed the code in one data source but not in others because we missed multiple instances of common code. Cut the number of bugs where new changes broke existing data sources by 90+%. Took a class of request of the "This neat new feature for data source X? Can you add it to all the others?" sort and turned it from a days-long exercise in locating and modifying multiple copies of code to a quick exercise in passing the correct arguments to common functions.

    2. Re:Define "bad" by sribe · · Score: 1

      As an engineer, I've adopted the maxim that there is no good and bad, only fitness for a particular purpose.

      There may often not be absolute "good" and "better", but there most certainly is "bad"!

    3. Re:Define "bad" by SirGarlon · · Score: 1

      But then after I started working on it, things changed. Instead of 1 new data source every 4-5 years, we got 3 new sources in one year.

      The way I'd describe your story is that your maintainability requirements changed and you realized that. (Maintainability requirements are often implicit but that doesn't make them less real!)

      Then in response to the requirements change, you updated the code to meet the new requirements.

      So, I didn't mean to be dismissive of maintainable code. I was just saying that making changes to improve maintainability should be driven by evidence of an actual payoff, which you definitely had when you did your refactoring.

      --
      [Sir Garlon] is the marvellest knight that is now living, for he destroyeth many good knights, for he goeth invisible.
    4. Re:Define "bad" by SirGarlon · · Score: 1

      but there most certainly is "bad"!

      Touchée!

      --
      [Sir Garlon] is the marvellest knight that is now living, for he destroyeth many good knights, for he goeth invisible.
    5. Re:Define "bad" by Anonymous Coward · · Score: 0

      I'm an EE, and yes, there is such a thing as bad. I agree good is relative, but bad really does exist. Sort of like beauty and ugly...

    6. Re:Define "bad" by Anonymous Coward · · Score: 0

      As an engineer, I've adopted the maxim that there is no good and bad, only fitness for a particular purpose. I prefer a discussion of trade-offs to statements of principle.[...]

      yes. yes. yes.

      Unfortunately, the people who say things like 'this code sucks' don't spend a lot of time thinking about fitness for purpose. In fact, they don't spend a lot of time thinking about any code's purpose. In fact, I suspect the real purpose of code for them is to show how smart they are.

    7. Re:Define "bad" by Jaime2 · · Score: 1

      I tend to ask "what requirements does this code fail to meet?" And very often, the reviewer has invented his own new requirement!

      Given the bad code I run into, my answer would usually be "when it fails, there is no way to figure out what went wrong". Just because the business requirements didn't specify error handling and logging doesn't mean it is superfluous.

      The bug I triaged today involved a UI where if you added a record to a table and pushed the save button twice, it would make two rows in the database. The underlying problem was that the original programmer sprinkled a bunch of status flags all over the place in a highly disorganized manner and he forgot to clear the "new" flag after saving. If I fix it by clearing the flag after save, it will still be bad code, even if it meets all of the requirements. Whether code is good/bad and whether it works/doesn't are two different questions.

      It could be that your organization has a high tolerance for bad code. If defects are unlikely to cause major problems and fixes are easy to apply, then bad code might be OK. But, it's still bad code. If all of your code has to be validated by an expensive third before deployment and defect cost lives or a lot of money, then you really should write good code.

    8. Re:Define "bad" by Jaime2 · · Score: 1

      I always considered readability and maintainability to be implicit technical requirements for any project.

      I look at it a bit differently. I consider readability and maintainability a core part of the craft of programming. I don't expect anyone to ask for them and I wouldn't compromise on them even if I were explicitly asked to do so. In my opinion, writing bad code is like being a doctor and taking shortcuts like not properly cleaning your instruments. Sure, you might be successful for a while. But, eventually it's going to cause problems.

  54. Re:Possibly related? by Desler · · Score: 1

    No, the other question just stated that the person had been programming longer than he had been alive. Not that he had been at the company for that entire length.

    Of course, being a very smart person who has been programming since before I was born makes him fairly impervious to criticism,

  55. "Knock yourself out" by AlienSexist · · Score: 1

    Devil's Advocate:
    Just because he's young and fresh doesn't mean he has nothing to contribute. He may very well have learned something valuable that he's trying to share. It is difficult for many engineers to withstand criticism and often instinctually become defensive ("ripping into my code"). Even if you've been there 10 yrs, as a technical professional, you should be making an effort to stay current on techniques.

    Reality:
    If there exists excellent unit & integration test coverage of the subject code area, then let him rework it if he cares that much about it. If he breaks the tests, he fails. Succeed or fail; he can then explain to the business why he spent expensive engineering labor reworking something not on the value-added todo list that was already functioning properly. I think a lot of professional engineers are a bit perfectionist which can interfere with making appropriate decisions in a business context. You know - academic v.s. practical.

    Why not?:
    In this case, for only 50k LOC, it shouldn't be too difficult to overhaul nearly everything towards more modern methodologies and techniques (not fads). This also makes it sound like a small project/firm where there should be greater agility and flexibility to change things. There should, however, be a compelling reason to do so. The effort and brainpower is better spent developing new revenue-generating features.

  56. Almost all new "smart" guys hide behind egos by Anonymous Coward · · Score: 0

    I recently had to put up with a new "smart" guy who only had a few years of experience and was hired for a position he was not even close to being qualified for because his lack of real-world experience, but he made up for it by being a friend of one of the bosses.

    Just like the poster's experience he had to start working with a huge codebase that had evolved over 10 years of constant changes. He was way over his head. He didn't have the first clue how to find his way through code he didn't write. That was understandable. I have decades of experience and I've been thrown into huge mature projects many times and I can quickly orient myself and become productive with code I've never seen before. I couldn't do that until I had many, many years of experience.

    But rather than admit he was over his head he did what all ego-driven individuals do -- he attacked the code, he attacked everyone who'd ever written the code, he demanded that he be allowed to rewrite it from scratch (because he knew he could rewrite 10 years worth of code in just 3 months because he was "that good").

    Although I had only worked on small parts of that code base from time-to-time whenever he got bogged down unable to find or fix something I'd come along and in a very short order find or fix it for him. In a few cases he'd describe a bug to me and I wouldn't even have to look at the code to tell him what likely is happening and what he should look for. Again, that's the difference between vast experience and purely ego-driven bravado.

    In time did this guy learn humility? No. He's messed up badly over time and lost credibility, but since one of the executives' credibility is on the line it is hidden as much as possible. The guy still brags, still is way behind schedule, still puffs up his chest with ego, but fortunately I no longer have to work much with him.

  57. Stacktrace or GTFO. by zarmanto · · Score: 1

    B-B-But...

    Stacktrace.
    Or.
    GTFO.

  58. Put him to fixing these supposed problems by flug · · Score: 1

    If the code is so bad, give him the assignment of fixing it. Allot say 8 hours, or maybe even a week if you want to get him out of your hair for that long, where is assignment is to find the worst problem area that will have the greatest possible positive effect on the project, that he can fix start-to-finish within that time span, re-write, test, go through your complete process whatever that is, get completely ready to commit. But it all has to be done/complete within the allotted time frame. At the end of the time, take his code, evaluate & review it with him & 2-3 others who are intimately familiar with that project. If it's fabulous code that really does meet all requirements and improve on the existing code, then hurrah! Commit it and you're a step ahead. If (as is more likely) is full of shit and has far more serious but possibly hidden problems than the code it's supposed to replace, then you explain the problems to your boy wonder, deep six the supposed improved code, and it's a learning experience for everyone.

    1. Re:Put him to fixing these supposed problems by flug · · Score: 1

      Oh, yeah--and don't forget to take him through the economics of the project as well. "See, you've refactored this 100 lines of code, which only took you 8 hours, costing the company $X."

      Now just do the math about how much it would cost to complete this little refactoring project on the entire codebase. It will be a fairly boggling amount and of course doesn't take into consideration that this simplistic estimation procedure will underestimate the cost and complexity of a full codebase refactoring by a few orders of magnitude.

      Still, I'm guessing even the simplistic method will cost enough to make your point.

  59. Re:Possibly related? by gabereiser · · Score: 0

    Incorrect, he said the guy he's hassling has been "programming" since before he was born, not at that company per se. RTFA.

  60. Personally, I would... by tomzyk · · Score: 2

    stare him directly in the eyes and, in an outrageous French accent, curtly state "MIND YOUR OWN BUSINESS!"

    --
    Karma: NaN
    1. Re:Personally, I would... by Anonymous Coward · · Score: 0

      stare him directly in the eyes and, in an outrageous French accent, curtly state "MIND YOUR OWN BUSINESS!"

      Why a French accents?

      Do Gands speak French or what?

      (The above link is the original source of "MYOB".)

    2. Re:Personally, I would... by Anonymous Coward · · Score: 0

      The _Foul_ and most _Foreign_ FRENCH!!!!!!!!!!!!!!

  61. This intern may be me... by Anonymous Coward · · Score: 0

    I just started someplace as an intern working under some positively brilliant and highly accomplished people and, unfortunately, have been complaining a bit about code quality. Hendrik, if you're the OP, then I apologize!

    Even if this post isn't targeted at me, here's what could be happening:

    The codebase off of which I'm working is highly efficient, effective, and successful from an algorithmic/functional standpoint, but at great sacrifice to software engineering practices. Huge chunks of little-related and deprecated code are all in the same file, global variables are used for almost everything to avoid passing them around, variables are unintuitively-named (e.g. "limg" and "rimg" are "layered image" and "raw image", rather than left and right), and there a slew of objects that have similar purposes, but aren't related from a object-hierarchical standpoint, making it difficult to pull the necessary data from them for processing.

    I completely admit that I don't understand most of the codebase is doing, but that doesn't make the code [i]itself[/i] bad, but rather the organization. We're in a research division so the code is extremely advanced (everyone who's working on it has a PhD, while I'm an undergrad), but if it were partitioned into well-named methods and commented more, I'd at least have a much better sense for what's happening with the code, even though I don't understand what's going on with the code itself.

    TL;DR: I'm in an identical situation as the intern; OP's code may have poor readability for fresh/inexperienced eyes, resulting in loss and confusion on the intern's part. Better commenting and code organization would help reduce those negative onboarding experiences significantly.

    1. Re:This intern may be me... by autocannon · · Score: 1

      (everyone who's working on it has a PhD, while I'm an undergrad

      There's your problem. PhD's don't necessarily know how to write good code. They spent all their time learning and not applying.

      They can certainly take very advanced concepts and make a program that does it. It just won't be very pretty or maintainable.

    2. Re:This intern may be me... by Anonymous Coward · · Score: 0

      You need to read this book before you are worthy of having an opinion:
      http://www.amazon.com/Code-Complete-Practical-Handbook-Construction/dp/0735619670/ref=sr_1_1?ie=UTF8&qid=1357850750&sr=8-1&keywords=code+complete

    3. Re:This intern may be me... by sribe · · Score: 1

      ...everyone who's working on it has a PhD, while I'm an undergrad...

      Oh. Dude. You're so screwed. No matter how over-inflated their egos, you'll always be "the one with the ego problem"!

    4. Re:This intern may be me... by Anonymous Coward · · Score: 0

      Well, when you're an intern who's only with them for three months, it makes it difficult to contribute when you have to spend half your time figuring out what the code's even doing.

    5. Re:This intern may be me... by Anonymous Coward · · Score: 0

      You mean the one I read (along with Pragmatic Programmer) in the first year of my undergrad?

    6. Re:This intern may be me... by Anonymous Coward · · Score: 0

      Their egos aren't an issue at all; they're all excellent, modest, friendly people.

  62. Re:Step One by zarmanto · · Score: 1

    There are no coders or technically literate people here.

    Incorrect.

  63. Klingon Programmers by AlienSexist · · Score: 5, Funny

    "You dare insult my code!? I'll kill you where you stand!"

    1. Re:Klingon Programmers by H0p313ss · · Score: 2

      An oldie but a goodie:
      http://gradha.sdf-eu.org/textos/klingon_programmer.en.html

      Top 20 things likely to be overheard if you had a Klingon Programmer:

      • Defensive programming? Never! Klingon programs are always on the offense. Yes, offensive programming is what we do best.
      • Specifications are for the weak and timid!
      • This machine is GAGH! I need dual Pentium processors if I am to do battle with this code!
      • You cannot really appreciate Dilbert unless you've read it in the original Klingon.
      • Indentation?! - I will show you how to indent when I indent your skull!
      • What is this talk of 'release'? Klingons do not make software 'releases'. Our software 'escapes' leaving a bloody trail of designers and quality assurance people in its wake.
      • Klingon function calls do not have 'parameters' - they have 'arguments' -- and they ALWAYS WIN THEM.
      • Debugging? Klingons do not debug. Our software does not coddle the weak. Bugs are good for building character in the user.
      • I have challenged the entire ISO-9000 quality assurance team to a Bat-Leth contest on the holodeck. They will not concern us again.
      • A TRUE Klingon Warrior does not comment his code!
      • By filing this bug report you have challenged the honor of my family. Prepare to die!
      • You question the worthiness of my code? I should kill you where you stand!
      • Our users will know fear and cower before our software! Ship it! Ship it and let them flee like the dogs they are!
      • Our competitors are without honor!
      • Python? That is for children. A Klingon Warrior uses only machine code, keyed in on the front panel switches in raw binary.
      • Klingon programs don't do accountancy. For that, you need a Ferengi.
      • Klingon multitasking systems do not support "time-sharing". When a Klingon program wants to run, it challenges the scheduler in hand-to-hand combat and owns the machine.
      • Perhaps it IS a good day to die! I say we ship it!
      • My program has just dumped Stova Core!
      • Behold, the keyboard of Kalis! The greatest Klingon code warrior that ever lived!
      --
      XML is a known as a key material required to create SMD: Software of Mass Destruction
    2. Re:Klingon Programmers by Anonymous Coward · · Score: 0

      That's not quite correct. After the first sentence is where an actual Klingon programmer would begin killing. There is no need to say "I'll kill you where you stand!" when you've buried your knife into the other programmer's chest. They already know you intend to kill them and they would find your redundancy to be insulting, irritating, and unnecessary.

  64. These things should be handled delicately... by Anonymous Coward · · Score: 0

    Might I suggest you give him a poem?

    Roses are red,
    Violets are blue,
    All of my code is bug-free,
    Perhaps it's time you got a clue.

  65. Future Dot..... by __aacvzh55 · · Score: 2

    How to react to the coworker who complains to you that a coworker thinks that his coding is bad.

  66. Thing one... by Heebie · · Score: 1

    listen to his concerns, and explain why they aren't valid, or take them on-board if they are. He's trying to make his mark on the team, and assert his position, and may want to be the "alpha" of the group. It might not hurt to remind him he's a junior memeber of the team, but doing so without belittling him could be difficult. You could also just tell him you inherited a lousy code base from previous developers or something like that.

  67. First talk about it by thetoadwarrior · · Score: 1

    If he's complaining then he needs to explain why it's bad. Who knows, maybe he's onto something but if he's just some "straight out of uni" brogrammer, then put him in his place.

  68. easy by Anonymous Coward · · Score: 0

    Just tell it "Well, if you think it's that bad, go ahead and improve it. You'll get fully responsible for it though."

  69. He's probably correct by slashmydots · · Score: 1

    In college I learned .NET languages right after they had been released. It's been my experience that anyone about 5+ years out of college has no idea how to code properly with them. They write the code like it's VB6 instead of VB.NET and I'm sure it makes sense to them but it's so far from MS's best practices or any remotely modern coding practice, it's almost impossible to read. It's so roundabout and needlessly complex without using any of the new features and there are legacy commands galore that should have been removed from the language that I've never seen before because superior modern ones exist and that's what we learned.
    So in summary, your code likely is less than ideal. As a general rule, the closer someone is chronologically to having finished college, the more correct and prettier their syntax is and the older programmers simply refuse proper retraining or learning in general really.

    1. Re:He's probably correct by Anonymous Coward · · Score: 0

      In reality, all us old farts own the world. See that Android source code? it's old farts. and not written like you snot nosed kids want it.

      Get used to it.

    2. Re:He's probably correct by Anonymous Coward · · Score: 0

      I've seen that many times... blah blah blah... use the features! Well in fact "the new features" run slower, produce more code(oh that's right you are just a high level programmer you don't understand that yet), are in fact buggier, cost more to maintain, and are pieces of shit, that's why the new code needs new processors to run. It doesn't get anything more worthwhile done, but I'm glad you bought into the nonsense of upgrading because someone told you to. Don't get me wrong VB always sucked and still does, that is why you are on the wrong path/the wrong line of thinking. But I'm glad you are so "superior" and "modern". Another douchebag who doesn't care what's going on in the machine, just that his code looks pretty(twinkle). You're a newbie even with your experience. You never took the time to write something better. Always trust the company! Hint: they don't always know best.

    3. Re:He's probably correct by autocannon · · Score: 1

      As a general rule, the closer someone is chronologically to having finished college, the more correct and prettier their syntax is and the older programmers simply refuse proper retraining or learning in general really.

      This statement is all sorts of wrong. Newer kids write "more correct" code? Or have prettier syntax? If that were true, then every programmer would be out of work by age 35. The truth is that it takes about 5 years of good professional experience to become a decent programmer. Schools just cannot possibly prepare a kid for dealing with a program with a code base of over a million lines of code. Sure they might write some pretty webpage, or some basic database shit, but you're seriously deluded if you think a 24 year old who isn't some type of coding genius is a better programmer than a 10 year professional.

    4. Re:He's probably correct by slashmydots · · Score: 1

      Shortly after (2 year) college, I took the Tek Systems programming assessment for .NET and VB. I beat 81% of their programmers and they have about 50,000 and are the #1 largest IT staffer in the US. Almost all their programmers have 4 years degrees and many have masters degrees. I was 23 at the time. I learned VB.NET from the ground up and know exactly how it works, what every part of the framework does, etc. But God forbid some 40 year old read a book for 20 hours or take a night class and learn the same thing. What's the result? Select case loops that are 50 lines instead of 5 lines because they're writing it VB6 style.

  70. The first problem by SirGarlon · · Score: 2

    The first problem is that you regard the code as "yours" rather than "the project's" or "the company's." Engineering discussions should not be personal, and getting emotionally attached to the code is unlikely to help you evaluate it objectively.

    --
    [Sir Garlon] is the marvellest knight that is now living, for he destroyeth many good knights, for he goeth invisible.
  71. Solution to an intern saying your code is bad by dragmar · · Score: 0

    You stop writing shitty code

  72. Considering he is an intern and his... by gatesstillborg · · Score: 1

    ...longevity should be limited, I would (severe, though probably merited by his superior (for an underling) attitude) tend to reduce the priority of his learning experience. If he was under evaluation for a permanent position, I would think this confidence/arrogance should buy him an earlier than usual trial-by-fire of a somewhat substantial project, or at least a portion of one he can lead the development on. Hopefully, he would do well, though probably still find himself a bit more isolated than he might otherwise have been, which should be helpfully chastening.

  73. So fix it then. by whitelabrat · · Score: 1

    Ok. If he thinks it sucks then invite him to make it better. Cause you're awesome like that and have so much free time.

  74. Technical Debt by Anonymous Coward · · Score: 5, Interesting

    We always see bad code as technical debt and treat it as debt. When we have cycles we pay it off, when we don't we get some more.

    Having been doing this for 12+ years, I have come to realise I have never liked anyone's code and figured out its more of a style or personality than bad or good. Yes there is bad code, but there is no good code per say. Or put another way, if done right its good and you and I still may not like it.

    Its just the nature of the beast, its kind of like driving a car, all other drivers seem bad.

    1. Re:Technical Debt by Anonymous Coward · · Score: 0

      Honestly I believe this is a clear sign of a VERY self centered view of the world - for most drivers, I don't believe they see ALL other drives as bad, or even most. They are just other people trying to get to where they need to go, want to go - all with their own priorities and lives. Some may be bad drivers, but by and large they are just plain ordinary drivers - no better or worse than you.

      Code is mostly like this, it's plain and ordinary - neither bad or good. There IS really amazing code out there, and then there's bad code, both exist.

    2. Re:Technical Debt by Anonymous Coward · · Score: 2, Insightful

      Disagree (respectfully), there is such a thing as good code.
      Good code is readable, maintainable, and performs the required function ... (great code is also extensible and/or flexible).
      Bad code is anything else.

      Variations of design, style, elegance or efficiency are the art of coding and being the
      subjective part of the equation determines whether or not a particular person* will like it or not.
      Just because someone doesn't like a particular piece of code or would have implemented it differently doesn't make it bad.

      *yes programmers are people too, no matter how hotly debated that "fact" might be.

    3. Re:Technical Debt by Anonymous Coward · · Score: 3, Informative

      Bingo, it's bad code in the eyes of the beholder if the code currently fulfills the user case(s). what is good code: What is good code? Readable? Efficient? Academically written? following standard? ingenious? a hack? All depends on the use case... remember those things?

      If you're coding for a career, coding is about filling a use case, to make money. It's not a mental exercise--which is left to college students. That's why I see CS prima donnas and Business AppDevs fight so much on code.

      If it does the job and fills the use case, it's good code regardless, if you're speaking british, english or latin.

      I always found writing good code is easy, reading [someone else's] code is where the money's (and respect's) at.

    4. Re:Technical Debt by dannys42 · · Score: 1

      I think programming languages are similar to written language in this case. No two people will really have the same style of writing, but most people can agree whether someone's writing is "good english" or "bad english." Grammar is part of that determination but also comprehension.

    5. Re:Technical Debt by MozeeToby · · Score: 5, Insightful

      Sometimes I don't even like my own code if I'm coming back to it a year later. It's just the nature of the game. What looks 'good' and 'right' to you changes based on what you know about coding, what problems you've encountered, what you know about the project, what you know about the budget, etc, etc.

    6. Re:Technical Debt by Dastardly · · Score: 2

      I absolutely agree. I wrote a large portions of some code alone that now several other people are advancing and maintaining. There are some good things and some not so good things in there. Some of the worst were caused by attempts to be overly clever.

    7. Re:Technical Debt by mattack2 · · Score: 0

      Yours is bad English, because English should be capitalized.

      (I'm a grammar Nazi, but this is intended to be humorous.)

    8. Re:Technical Debt by rtb61 · · Score: 1

      Of course pretty code is still pretty and is easier to maintain. So is it worth paying an intern to pretty the code and keep main coder busy producing new code. Three benefits here, you main coders are producing more code, your code now ends up pretty and easy to maintain and you have trained a new coder in how your company codes.

      --
      Chaos - everything, everywhere, everywhen
    9. Re:Technical Debt by L4t3r4lu5 · · Score: 1

      Disclaimer: IANASD. I get the impression, though, that there is an optimal way to perform certain tasks; A particular sorting algorithm has a "most efficient" structure, and all others are slower. It may be only a couple of cycles, but it's still "worse" than the most optimal way. I also get the impression, however, that achieving the "best" way means writing in Assembly almost constantly, and that doing it from a high-level language is next to impossible without knowing exactly how the compiler will translate your code into instructions.

      TL;DR: I'm fairly certain that there is only one "right" way to do something, but the various ways that many devs of the same caliber achieve the same goal is "close enough" that none can be see worse than the other.

      --
      Finally had enough. Come see us over at https://soylentnews.org/
    10. Re:Technical Debt by Sigg3.net · · Score: 1

      You are saying it is more like literature.

      Not knowing the grammar (+culture) is bad programming.

      When you actually know how to write, style of execution is individual.

    11. Re:Technical Debt by rioki · · Score: 1

      There are many things that people feel very strongly about that have no right answer. For example naming conventions or brace placement and spacing. It is important to have one consistent convention, but which is relevant. Nevertheless many developers feel very strongly if it should be called pWidgetMananger, widget_manager, widgetManager, widgetmananger or WidgetMananger.

    12. Re:Technical Debt by coinreturn · · Score: 1

      Sometimes I don't even like my own code if I'm coming back to it a year later. It's just the nature of the game. What looks 'good' and 'right' to you changes based on what you know about coding, what problems you've encountered, what you know about the project, what you know about the budget, etc, etc.

      I sometimes have the opposite experience. I've looked at some of my old code and thought, "Wow, that is so freaking elegant and insightful. I must have been a genius back then."

  75. You can learn from him, if only indirectly by Anonymous Coward · · Score: 0

    If you DON'T think the code you wrote any more than six months ago sucks then you're probably stagnating.

    I'm being a bit facetious there of course, but the point is that a good developer is always evolving and learning and you should see the flaws in your own existing code as time goes on because they're ALWAYS there. Often-times it takes a fresh set of eyes to see them.

    That's not to say the guy isn't an obnoxious jerk who thinks more highly of himself than he should. If it was me, I'd turn it around on him: "Ok, could you please rewrite the code as you think it should be, and then we'll do a code review of your solution?" You have to do this with an open mind of course because in some ways his solution may well be better, but chances are in other important ways it won't be: it'll probably be more complex (because inexperienced developers ALWAYS think more complex than they need to), it'll probably be less maintainable (probably commented like shit for example) and probably more "flexible" than it needs to be (new developers always think 10 levels of abstraction makes things more "flexible" because they don't understand the realities of day-to-day development and maintenance).

    Bottom line: you can probably learn something from him, especially given you think he's got promise, but he most definitely can learn from you... and the first time he realizes that I bet he backs off and treats you with the respect your experience should entitle you to.

  76. How is this even a question? by Anonymous Coward · · Score: 0

    Seriously, how do you have 10+ years of coding on this code base, and still have no clue how to respond to this kid? "Dear Slashdot, a bully pushed me down today on the playground, and said my face looked like a butt. How should I react?"

    There are some very easy options here:
    1) Is he right? If so, ask him for some pointers, and try to learn why it's bad, and how you can improve.
    2) Is he wrong? If so, explain to him why he's wrong.

    In both instances, realize that "your code sucks" is not an objective statement, but a subjective statement. He's saying, "I'd write it differently." So, without acknowledging the personal critique one way or another, ask him to rewrite some pieces on a separate branch in version control, and talk about the differences when he's done - why he did it one way, and you did it another. He might have some good ideas, and some bad ideas, mixed together. You might learn a few things, and he might learn a few things.

    But really. I can't believe that a grown fucking man (or woman!) needs to ask this question. I'm tempted to believe that the new hire is *right,* simply because you seem dimwitted enough to have to ask this question as an - ostensibly - experienced professional.

  77. I'm pretty sure everything I write is crud... by gestalt_n_pepper · · Score: 1

    so I never have trouble with the critique. Most of the people who criticize my code however, allow that my software is usually more reliable then theirs (fewer errors and crashes) and has the best interfaces in the office (i.e. easiest to understand and navigate). So, what to make of this? They keep asking me to write stuff, even though I barely use classes except to extend and manipulate arrays (I use a lot of arrays). Empirically, this tells me that good form isn't everything, and that while it's nice to know about callbacks, virtual void functions, etc. for most everyday little apps, it doesn't seem to matter much.

    --
    Please do not read this sig. Thank you.
  78. "How to react....." by inerlogic · · Score: 1

    say "I'm rubber, you're glue...... etc"
    then give him an atomic wedgie and/or a swirly....

    OSHA sandards call for at least a 2 man lift for swirlies BTW.... safety first!

  79. Is he an asshole? by GoogleShill · · Score: 1

    https://vernonryoung.wordpress.com/2010/01/11/banning-assholes/

    My current team is very good about providing positive criticism and admitting when our code sucks. We are all in it for the same reason, to produce a great product and make money, but last year was a different story. We had a guy who would never, ever take responsibility for bugs in his code and would openly criticize others because it wasn't done the way he would do it. No matter what your reasoning was, you were wrong, he was right. Period. He could have been a good developer had he actually taken input from the team.

    These guys HAVE to go! They will bring down the morale and productivity of the entire team.

    Knowing that your work will be negatively criticized obstructs the creative flow needed to produce quality code efficiently. I've personally lost hours either being upset or second-guessing my work because of unfair criticisms. Just replacing that one guy has made a world of difference. We are now very direct with each other, accept that we make mistakes, and can even jokingly say "What the fuck were you thinking on FooBar.java:152!" and no one will take offense.

    Explain to him why his behavior is unacceptable, and if it doesn't change, let him go.

    1. Re:Is he an asshole? by autocannon · · Score: 1

      Totally agree. I'd just add if I were in charge, I'd explain why his behavior got him fired and not another chance. Guess that's one reason why I'm not in management!

  80. School ruined him by Chaseshaw · · Score: 1

    In class he was graded on things like code efficiency and punished for NOT following certain guidelines by getting a bad grade. In the corporate world, you get paid based on your code working, and doing everything it's supposed to do. No one in management cares if a module is 1500 lines vs 1200. Welcome to the real world.

  81. Re:Possibly related? by tompaulco · · Score: 1

    Submitted by the same guy even. Either the submitter got put in his place when he tried to tell the more experienced guy how to do how job or the submitter is just schizophrenic and is talking about himself.

    --
    If you are not allowed to question your government then the government has answered your question.
  82. He Might Be Better Than You In The Long Run by Anonymous Coward · · Score: 0

    The odds are really high your code does suck. I've reviewed a lot of code, and guess what, most of it sucks big time. Few programmers actually write good code.

  83. Re:Do you always let interns tell you what to thin by dubbreak · · Score: 2

    Just because the new guy is disagreeing and less experienced, doesn't make him wrong. Yes, 9 times out of 10, the new, less experienced guy will be wrong, but that 1 time out of 10, makes it worth giving the other 9 times a fair hearing as well.

    I honestly don't think "experience" has anything to do with it. How long you've sat in front of a computer monitor doesn't directly translate to your understanding of software development. I've worked with a few guys with 15+ years experience. One created more work than he produced over 6 months (we were cleaning up shit from him a year after he was canned), another whom I bitched about in the last question really had no fucking clue how to structure code. He'd write stuff that "worked", but basically misused every concept in computer science. No one could follow his code and there was no clean way to cut it out. I also know plenty of CSc and S.Eng. student that never learned how to code in school. I mean, yeah, they passed assignments that required coding but never really got a grasp on writing software.

    On the flipside I've worked with people straight out of school that were as good as experts with plenty of years behind them. The big thing I've seen is there tends to be two groups: people who understand software development and those that don't. People who don't understand can write working code and even create big projects.. but they are hell to maintain and even hell for that person to write. For people that understand, it's a lot more fluid. We all start at the ignorant stage and some get beyond it quicker than others, some never make it out.

    I honestly didn't learn to code (as in really code) until late in my degree, but I buckled down and got over the learning curve.. then it all became a lot easier and way more fun. More practice and the fog cleared even more. I think I still have quite a ways to go (as I'm able to recognize those that are much clearer than I), but that's ok as long as I'm dedicated to moving forward and can recognize others are more cognizant and clear and lean on them when I can. Some areas I might be better than others and if they are good they lean on me for that. It feels great to work in an environment like that. Life is hell when you're trying to fix some clueless code.

    One other observation I've had is that people that understand tend to code throughout their career. Those that don't quickly move onto non-coding positions (analyst, management etc) and drop coding as quickly as possible.

    --
    "If you are going through hell, keep going." - Winston Churchill
  84. Stop being a pussy for starters by Anonymous Coward · · Score: 0

    If you have to get on the internet and whine everytime someone critcizes you then just give up now. Maybe you should consider that perhaps he is right and your code sucks. Thats whats wrong with a lot of people, they cant accept the fact they arent right all the time and do everything wonderfully.

    Grow some balls and either talk to him about like a mature adult or ignore him or maybe sit and look at your work and consider the possibility it does suck.

    But if you get butt hurt everytime someone doesnt like something dont run to the internet hoping for some people to rally behind you to feel better about yourself and justify your work. Be a man for gods sake and grow up.

  85. Knowing everything vs. nothing by johnwbyrd · · Score: 1

    It's extremely common for bright young inexperienced programmers to take this attitude toward existing projects or code, so much so that I'm surprised that this is the only situation in which you've encountered this behavior.

    A manager's job is to take this arrogant kid and groom him so that he can be used productively in a team environment. If he's already talking about how much your code sucks then he's got a bit to learn about presenting contrary opinions in a respectful way. All the same, you need to keep your ego in check so that his good ideas (if he has any) can be applied productively to solving the company's problems.

    You start with him the way you do all new guys: assign him a small piece of the code and limit his job to refactoring or rewriting a portion of it. Make sure everything's marked in source control before you let him loose. And have him give a general presentation at the end (at the source code as well as the project level) as to why his changes have improved things. Reward him for playing nice with others and chastise him for being arrogant or a lone gun. And give him bigger jobs as he proves he can handle them.

    My basic rule is to listen for as long as possible before overruling a junior programmer's opinion. Make sure that he has his chance to give his say. But after hearing it, take the counsel of your own 10 years over his if your opinions diverge. Experience does matter and there's really any substitute for it.

  86. Take a deep breath and self-evaluate by GodfatherofSoul · · Score: 1

    Maybe your code really does suck? I've had several instances of dismissing criticisms as a younger programmer only to understand more clearly why I was wrong later in my career.

    --
    I swear to God...I swear to God! That is NOT how you treat your human!
  87. Years ago by Anonymous Coward · · Score: 4, Funny

    Years ago I worked with a senior guy who was very good but very critical of everyone else's code, often for poor reasons. One day I showed him some code and asked his opinion. He starts ripping on it and asks me why I did it that way. I reply "You tell me, this is your stuff from a couple years ago.".

    1. Re:Years ago by neminem · · Score: 2

      Oh, to have some mod points right now... You'll have to accept this virtual "+1 Funny" instead.

  88. Pretty simple by kilodelta · · Score: 1

    Give him a sandbox to build his own code that does the same thing. Then be objective about evaluating his code.

  89. Re:Is Your Code Designed to Build Walls or Bridges by dubbreak · · Score: 1

    This. 50K lines code in a modern language is a pretty small project. If that's 50K including lines of test code, it's tiny.

    --
    "If you are going through hell, keep going." - Winston Churchill
  90. let him try a rewrite! by pieterbos · · Score: 1

    If he thinks the code is bad, ask him why the code is bad. Ask what his problem is with the code, and what he wants to improve and why. Ask him to be very specific, with examples of what could be improved, why, and how.

    If you still disagree about the code and how it works, you can decide to actually let him rewrite a bit. Make sure you both agree on a relatively isolated/small part. Set a time constraint on the task. Then, when he's done, check. If he made better code - great! You might learn something and you have better code. He may not be so bad after all. If he made things worse, or broke them, or even if there it's just a matter of taste- great! He might learn something!

    Also what you can do is get another person to look at the code, who you know writes clean code. Ask him what he thinks, and see if it matches the criticism of the intern.

  91. Get rid of him by autocannon · · Score: 2

    He's an arrogant douche. Get rid of him. Any new kid who has the balls to call existing code terrible to your face is going to be nothing but far more trouble down the line. He already knows everything, and nothing you can say is going to get through to him. It's just not.

    Get rid of him if possible, stick him in a little box otherwise. Don't let him work on the good stuff and hopefully he'll leave on his own because he's "awesome". Your bigger fear should be that he won't ever leave...

    We have a few of those types in my office, and sadly we don't get rid of them because they have value just being present. It's depressing watching them bounce from project to project because they can't do anything right, and yet think they are god's gift to programming and that we're all just idiots.

    Don't take the time to explain jack shit to him. It's been tried here, and they didn't change. People may say I'm too harsh and that everyone deserves a chance. My response is that they don't. People that act like dicks to others like that don't deserve another chance. Their next chance is at another job.

    1. Re:Get rid of him by Anonymous Coward · · Score: 0

      We had a fellow like that in our shop last year as a consultant who only had a couple years experience. Management let him (and another) "enhance" some website code without staff oversight for a couple months. In that time, he was given the task of adding validation to this extremely large form.

      In that time he managed to introduced not one but TWO Javascript frameworks, one only partially hooked up, with a completely unnecessary O(N^3) loop over the entire document DOM wrapped around the call to the other framework. The form became barely usable and crashed on older browsers and OSes.

      I was not disappointed to see him ushered out the door, both because his code was crap and because he was an arrogant twat.

  92. Can't run systems by rules by Anonymous Coward · · Score: 0

    "coding standards" == a set of rules.

    You can't run a world of open, evolving, complex systems by rules, that is what coding is, and we know the problems that exist in even our very controlled as-near-mechanism-as-possible environments.

    If your 'coding standards' are 'coding guidelines' (they have to be), then both of you will have to think. Which is what guidelines are for.

    More thinking, even thinking based on guidelines --> better code.

  93. The two rules of programming by TimTucker · · Score: 2

    Quite a while back I came across the following two rules for development:

    1. The code written by the guy who came before is junk.
    2. Eventually you will be "the guy who came before".

    Rule #1 tends to work because it's rare to be unable to find some way to improve code when you come back to it again with more experience or a fresh perspective.

    Rule #2 helps keep you humble.

  94. Re:Do you always let interns tell you what to thin by jeffmeden · · Score: 1

    It's also possible the younger coder learned a trick developed since the older coder got his skills fairly solidified, and the older coder never saw, or came up with in his own experiences.

    Just because the new guy is disagreeing and less experienced, doesn't make him wrong. Yes, 9 times out of 10, the new, less experienced guy will be wrong, but that 1 time out of 10, makes it worth giving the other 9 times a fair hearing as well.

    But the thing is that, unless the code has a testable bug in it then it can only be "right" or "wrong" in the opinion of the person looking at it. All in all, I would quickly trust someone with 10 years of experience to determine what is "wrong" sooner than I would an intern. Sure he might have a good idea, but until that idea is adopted by others and proves itself, it is only "right" in his opinion.

  95. argghhh by Anonymous Coward · · Score: 0

    I hate people that think everything they do is perfect and everything else is inferior.

    I hate it moreso when I secretly check out their code that no one else ever looks at and see spaghetti code. Don't laugh, I did this recently and the guy is loved by managment. I guess the code gets the job done but if he ever quits, we are screwed. His stuff is totally unmaintainable.

  96. What's "bad"? by istartedi · · Score: 1

    What's "bad". Some things are objectively bad: Memory leaks. Crashes. Slow algorithms.

    Other things are SUBJECTIVE. K and R bracing vs. Whitesmiths. Tabs vs. Spaces.

    Some things straddle the border between subjective and objective. The first example that comes to mind is "descriptive variable names". Everybody agrees they should be descriptive, but not everybody agrees on how long they should be to accomplish that, whether CamelCase is better_than_underscores, etc.

    You're "engineers". Break this problem down. There can't just be "your code is bad". There have to be several or even many things you don't like, or think is "bad". Address each one, starting with what you think is most important. Carve the "bad code" problem into little pieces until it goes away, just like you carve the specification into little modules and functions until it's met.

    --
    For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
  97. Sell him using Apple's techniques by Anonymous Coward · · Score: 0

    Specifically the feel/felt/found method (with an added 'f'.)

    "Sure, I can see how you'd feel the code is [inelegant, not perfect, a festering piece of crap.]

    When I was an [intern,student,temp employee,one-who-hath-not-earned-right-to-criticize], I felt that way about some of the code I reviewed.

    What I found, though, was that there are almost always reasons why the code was structured the way it is. And before I, as [an intern, student, new hire, FNG-who-shoulda-known-better-than-open-my-trap] was allowed to criticize it, I had to first understand why it was that way and whether it is actually worth the effort to initiate a change process on it. Sometimes this would result in a change that was positive to the code and our superiors, and sometimes I had to learn that working and functioning code shouldn't be monkeyed with.

    Maybe you need to ask more questions about the facts in and surrounding the code before offering an opinion on it."

    If this (maybe delivered a little more tactfully) doesn't satisfy, then we must go with the fourth F - find out who is writing that intern's report and inform them they should Fail. Or go to the Intern directly and tell him or her to go F off, you'll pay more attention to what your boss says than a wet-behind-the-ears Intern.

  98. Or... by JMJimmy · · Score: 4, Interesting

    The answer is really simple:

    Step 1) Hire a second, unpaid, intern
    Step 2) Give all the current responsibilities the 1st intern has to the 2nd intern
    Step 3) Have the 1st intern do nothing but beautify your existing code, with the understanding that he can't change how any of it is written.

    1. Re:Or... by Nefarious+Wheel · · Score: 2

      Why does this thread keep reminding me of BOFH?
      Ahh, I remember now. It's the hidden ITIL.

      --
      Do not mock my vision of impractical footwear
    2. Re:Or... by dintech · · Score: 3, Insightful

      One thing you might consider about junior guys is that they often say things like 'this code is crap' not because they really want to change it but because they want you to notice that they're smart. He probably is a bit socially awkward and doesn't get that he's also being offensive. Pretty much he's just trying to prove that he's knowledgeable, knows how to do 'the right thing', is a good coder etc.

      I think the best way to resolve the situation is not to distract him by giving him some greenfield work to do. This give him the scope to prove himself without pissing you off in the process. What you actually think of HIS code is a totally different topic.

    3. Re:Or... by Anonymous Coward · · Score: 0

      I meant "the best way to resolve the situation is to distract him"

  99. Your code IS bad by wcrowe · · Score: 3, Insightful

    Your code IS bad. I know this because it doesn't look like my code.

    --
    Proverbs 21:19
  100. React like he's Han Solo. by macraig · · Score: 1

    Encase him in carbonite and mount him on the wall.

  101. Yeah, the code sucks by Freddybear · · Score: 1

    You know what else sucks?
    Getting put down as a complainer and "not a team player" because management wants us to write new stuff instead of reworking old stuff that works well enough.

  102. What? Is this in retaliation from last week? by Anonymous Coward · · Score: 0

    Lol, so last week, someone says, on slashdot; "How do I tell an old programmer his code sucks", now the old programmer is coming to slashdot and complaining about the cocky new guy, just lol. I'd put more faith in the season guy personally.

  103. Yes, this is the problem. by mosb1000 · · Score: 2

    In the end the boss man doesn't give a shit about how clean the code is.. he give a shit about how fast the code was written and if it does everything it's supposed to and more.

    This is the reason most software is terrible.

  104. School Boys by Anonymous Coward · · Score: 0

    I love it. They all graduate and think they're code gods with all their new design patterns & coding standards and havent worked a single day in production.

  105. Code is like food by TsuruchiBrian · · Score: 1

    Quality of code has a very significant subjective aspect to it. There is correctness (does the code do what it's supposed to) which is pretty objective , but things like maintainability are not as easily quantifiable. What one person feels is understandable and easy to maintain another might feel is convoluted and hard to understand. It's like food. Some people like italian food and think it's better than chinese food, and vice versa. Almost everyone agrees that french fries are better than dirt, but that doesn't mean it's not subjective.

    Also, the fact that I consider code beauty to be subjective doesn't mean that I am not extremely picky about code. I am a code nazi. There is a right way and a wrong way, according to my aesthetics, but there is no objective reason why my aesthetics are correct.

  106. You're letting an intern contribute to production? by n7ytd · · Score: 1

    He's going to be gone as soon as the semester's over; don't let him touch anything important. He should be on one-off, throw-away projects. Counting on his coding ability in your bread and butter code is not a good idea. Once he's full-time and has a vested interest in what your team is doing, then his opinion counts.

    Now, that doesn't mean he's not right; your code may well suck. But, you're part of the team that's been crafting it for the last 10 years, and you're the team that will be maintaining it next year. Anyone can provide drive by criticism, but as he won't be there to see the fallout of his knee-jerk impression of your code, tell him to STFU, junior.

  107. I really want to imagine by Arancaytar · · Score: 2

    That this and the linked story are really about the same two coders.

    1. Re:I really want to imagine by Barryke · · Score: 1

      Bingo!

      --
      Hivemind harvest in progress..
  108. Reactions by WaffleMonster · · Score: 1

    "Tell me something I don't already know" ... goes back to writing horrible code ignoring continued presence of said individual.

    If someone has specific cogent points to make by all means listen, learn, engage otherwise whatever is coming out their mouths is most likely not worth your time.

  109. Just say "welcome to the real world..." by Anonymous Coward · · Score: 0

    Acknowledge that your code may not be great, for whatever reasons apply. Then use this as a teaching moment to set his expectations for the future. You ALWAYS encounter crappy code, you ALWAYS have to jam a feature into a place that originally was not designed for it, you always have to deal with the fact that the world changes, coding styles change, design philosophies change, technology changes, and your code is stuck at the point where you committed it.

    Ragging on your coworkers code is a quick ticket to becoming the least popular guy on the team, and to being blacklisted everywhere. Remind him that constructive ideas are great, whining is a waste of air.

    As one of my bosses used to say, "don't come to me with a complaint unless you have a cost-effective solution to suggest." Rewriting your entire code base probably isn't going to be one..

  110. if it really is because he doesn't understand... by Anonymous Coward · · Score: 0

    If you think that your code is not bad, but you had to do it a certain way because of a reason, then you should be putting that in your comments.

    Those are the kind of comments that make reading a piece of code for the first time easier. I am an intern as well and I never say that code is bad, but I do often find myself asking people, "Is there a reason this code is written this way?" Most of the time they do have an answer, but if that was put in a comment then I wouldn't even have to ask.

  111. Ever notice by Anonymous Coward · · Score: 0

    In German there is a word for almost everything most English speaking people don't talk about ....

  112. So, you think the code sucks? by Anonymous Coward · · Score: 0

    50000 lines? Luxury. I work with about 4,000,000 lines of code in my product (last time I counted). Your newbie doesn't understand that code gets worse over time. This is an excellent chance for him to learn refactoring skills. Assign him a module to refactor. Best case, you get better code and keep an annoying intern busy. Worst case, he learns a lesson in legacy systems.

  113. Only 2 aspects of code by caywen · · Score: 1

    I think there are only 2 important aspects to code quality: performance and readability (I classify correctness under performance).

    Both need a great deal of context to judge, and any judge will ultimately see what they want to see if they want to see it. It is impossible for a developer to judge without preconception. One developer working on highly parallel systems will, if they are predisposed to, gasp at your lack of use of parallelism. Another developer who lives and breathes C++ 11 will gasp that everything lacks move constructors and how your code could be refactored with lambdas.

    I remember working in an audio group where I found a long algorithm to do a bit of sound processing. I gawked at how unwieldy it was, and proceeded to hotshot a new implementation that was 1/2 the number of lines. And then I was promptly reprimanded: the original code, ugly as it was, was that way because it was way more L2 cache friendly. I ended up setting the project back with my "less sucky" code. Doing a source diff history, I found a much shorter version as one of the initial versions.

    The only rule when working in this industry is: Always be prepared to defend your decisions. If you can't, then either you deserve to be fired, or you're working in the wrong place.

  114. as usual: xkcd by spatley · · Score: 3, Funny

    just show him this http://xkcd.com/844/

  115. Well, here is the rub: by Anonymous Coward · · Score: 0

    As any experienced programmer can tell, the way to write good code efficiently is to just hack something dirty together until it works, iron out its kinks, then scrap it and rewrite from scratch, based on everything you realized when hacking together the prototype.

    Now the problem is that the "until it works" or at latest the "iron out its kinks" phase attracts management's attention, and the product is shipped and you are put on the next project. One tends to adapt by putting more effort in than the first run actually would warrant. But one can't really beat the thoroughness of the two-pass approach.

    The result is that, indeed, your production code is likely bad style and could be improved by a do-over. It is just that you are not allowed the luxury of a do-over, and you are not enthused that a beginner, as a test project, should be allowed to make you look bad.

  116. code before ego. by happyjack27 · · Score: 1

    "what we are doing and how we have pulled it off" is not necessarily very relevant. there may be better ways to do things than the way you've been doing them. in fact, the alternative (that there aren't) is nearly impossible. don't assume that he/she can only learn from you just because they're new to the team. it's almost certain that there are also things you can learn from them. perhaps its wrong to thing in terms of "good" or "bad" code, and more proper to think of it in terms of differentials: "better" or "worse". so then what constitutes better? the most important thing in all writing, code included, is organization. if things can be reorganized to reduce duplication, to make things easier to find, to make it easier to maintain, etc. well then, that's better. as programmers, like doctors put the patient first, we should put the technical operation first. screw egos. it's broken, fix it. it's better to do it some other way, do it that other way. etc. if, on a separate issue, the person just is being disrespectful, well that has nothing to do with code. sometimes its hard to tell the difference, though. in any case my main point is, don't put him off just because he's a new guy, or just because you've been doing something one way for a long time, or just because you're egos bruised. what matters is that the code works well and is flexible and well organized and is easy to maintain. and if you want him to be a valuable asset, you should be encouraging him, not discouraging him. abraham maslow's on management. he sounds self-motivated and driven to constantly improve. that's great! you should encourage that! mastery, self-direction and purpose are the primary motivators and it is a godsend to find talent coupled with motivation like that!

  117. Ask why. by Barryke · · Score: 1

    Ask why. Motivate your counter points, and expect him to the same. (!) Argue about facts not taste.
    Often the WHY aligns, but each has their own HOW, yet result in the same functionally. To each their own, often with good reason.

    --
    Hivemind harvest in progress..
  118. anecdote... by Anonymous Coward · · Score: 0

    I once walked into a job doing electronics design, not something I had done before in any formal capacity. I was handed a some datasheets and a copy of the nigh-on set in stone master schematic for the current project and told to familiarize myself with it, 2 minutes later I had found a mistake.

    Sometimes a fresh pair of eyes and a lack of preconceptions can see things the old hands haven gotten so used to seeing they never bothered questioning why they were there.

  119. Get On My Level, Punk! by Anonymous Coward · · Score: 0

    I have an app on my cell phone that plays the "wha wha wha wha" sound that the teacher made from the Charlie Brown / Peanuts cartoons that I like to use when people are spouting all kinds of horsecrap I don't feel like hearing: http://www.youtube.com/watch?v=ss2hULhXf04

  120. Of course he's right. by Dr.+Evil · · Score: 1

    The trick is to write better code from the original requirements, smeared over years of requirement changes, and not from the existing source code.

    Source code is an excellent requirements doc for the next reimplementation. But actually reimplementing it is just stupid. Especially if it works.

    The guy is inexperienced and being an ass.

  121. Intern? by Kozar_The_Malignant · · Score: 1

    This is the kind of intern who never becomes "employee." He obviously didn't learn any workplace skills in school. You could try to teach him those, or you could wait until you or someone like you is asked, "Should we keep Intern Bob around?" He will then disappear, and harmony will be restored.

    --
    Some mornings it's hardly worth chewing through the restraints to get out of bed.
  122. Is your name Ray Ozzie? by Anonymous Coward · · Score: 0

    The code did great things, but the writing sucked. Impossible to maintain.

  123. Get rid of him now by Otis+B.+Dilroy+III · · Score: 1

    before he catches the ear of non-technical management and ends up as your boss.

  124. IS your code bad? by Tracy+Reed · · Score: 1

    I have noticed that whenever I see people approached with comments about the quality of their code (by myself or others) they often say things like "You just don't understand what this code is supposed to be doing."

    That is always a red-flag to me. If your code is good the person should be able to tell what the code is doing.

    What are this person's specific objections to your code?

    There are no absolutes or hard rules and much is subjective and language dependent but as general rules of thumb:

    Does your organization have a style guide? Does your code follow it?

    Does your code have comments? I like to see at least one comment per functional block of code (function, loop, branch, new level of indent, whatever, depending on language).

    Are the lengths of your function limited to no more than a page of text, preferably half a page?

    Do your line lengths not exceed 80 columns?

    Do you make some effort at making the code visually nice to look at? Is it formatted so like elements line up for easy comparison of lines? I'm a big fan of lining up = and parens etc. to make the code look orderly. It makes it easy to spot differences or errors. It sounds shallow but I also find that when someone has done this it means they care.

    Without seeing a sample of your code to tell you if it IS bad there's no way we can advise you. If all you want is a polite way to tell the little twerp to shut up and mind his own business that won't get you fired I'm afraid I don't have much to offer.

  125. Most written code is shit by Anonymous Coward · · Score: 0

    Your new team member is most likely right. The code sucks. Especially after 10 years. In addition to the code, the documentation sucks too, as it is incomplete and outdated (which can be deduced from his inability to figure out what the job of a code fragment is). This is your fault, but I have seen no project so far, which is well documented and well written. Therefore, it is also a common situation of a 10 year old project and you are not a lousy programmer ;-)

    The best what you could do to teach him what the code does. Let him do some code analysis and bring the documentation up to standards. Most likely he will find abandoned code fragments and methods, API violations etc. which can then be fixed. In the end he knows how the software works and the software will be better coded.

  126. Coding elasticity by Anonymous Coward · · Score: 0

    If you have something which can only be understood by a few then it's those few that that "get it." However, the problem for organizations is that they generally have code-bases that no single or few people can maintain so now you're faced with a dilemma...do I put in genius code (which will require very little change), or do I put in mere mortal code (which might change often)? If you setup coding standards, naming standards, and performance thresholds then you typically end-up with more similar code than not since those can be measured/critiqued more easily. If you're faced with choosing between genius code or mortal code I think that mortal code is better, but if you can go between both when required...that is where real genius is.

  127. Wouldn't it be geat? by Anonymous Coward · · Score: 0

    Wouldn't it be great if this post and the one from last week were from the the opposite parties in the same debate? Knowing this crowd I am sure that they aren't and both posters are correct in their complaints, but how fun would it be if they were posting about each other and didn't know it?

  128. You Don't Darwinism in action by Anonymous Coward · · Score: 0

    Careers and made and lost by learning to control your mouth.

    He's on the leading edge of making or breaking his career.. it can be like watching an accident in slow motion.

    It's horrible.. you want to turn away.. but there's this guy yelling in your face.. having a complete meltdown.

    Don't take it personal.. one day the legacy code will be his.. but by then he'll be in marketing.

  129. Re:I Know Who This Is by Anonymous Coward · · Score: 0

    Ha - I was thinking of that exact story. Thanks for digging it up.

  130. You done got T-rolled by cats · · Score: 1

    We get an Ask Slashdot a few days ago about "How do I tell my co-worker his code sucks" Only to have it followed up with this?

    Son, I am disappoint.

  131. Uh, Well Your Code Probably Sucks... by Anonymous Coward · · Score: 0

    You have been at the same company for 10+ years... unless your company is a consulting company, staying longer than 5 years means you aren't likely worth a damn. If you were, you would have found 2-3 jobs between then because you would have gotten 15-25% raises from each move. You are safe where you and don't have to be frightened by interviewing and having a hiring manager tell you the same thing that this kid told you.

    Either that, or is a whiny punk...

    Or, he is right about your code and is still a whiny punk... that is likely it. Programmers are anti-social and can't put out consistency in their code... it is bound to be the case.

  132. *shrugs* by lightknight · · Score: 1

    Get the team to praise a section of the code he's harping about. It should force him to revisit his conclusions.

    --
    I am John Hurt.
  133. Clean code book by Anonymous Coward · · Score: 0

    I would highly recommend reading Clean Code by Robert C. Martin http://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882. It has a lot of very good ideas on creating clean code that should allow even a junior programmer to understand it without needing to be trained on how it works. This suggestion also assumes that the kids statement may have some truth to it, I doubt he knows everything about well written code, but most code can be cleaned up.

    I would focus the conversation on what actions he would like to take to update the code to be "better". Take his suggestions and see if they are valid and show him the amount of effort this project to change the code to his standards would take. I would also validate that there is a coding standard for the project and make sure he understand that first, assuming the code meets that standard.

  134. Believe Her by Anonymous Coward · · Score: 0

    A co-worked says your code is bad? Believe her. All code is bad.

    The skill level of an engineer can be measured as the time between when the code is written and when the engineer realizes that the code is bad.

    The best of the best engineers know they are writing bad as code as they are writing it.
    They understand that the code has inherent problems and those problems cannot be removed, only traded for other (possibly worse) problems.

    What programs are you using today that haven't changed at all since the day they were written?

    1. Re:Believe Her by Anonymous Coward · · Score: 0

      The use of "her" is incorrect.
      The use of "he" to refer to a person of unknown gender was prescribed by manuals of style and school textbooks from the early 18th century until around the 1960s, an early example of which is Anne Fisher's 1745 grammar book "A New Grammar".

      Unless you're a shrill jew computer science professor lecturing on cryptography, please use the proper pronoun.

  135. What is it with CS? by enter+to+exit · · Score: 1

    Why is the CS faculty full of these socially inept people who feel the need to obnoxiously prove how good they are to everyone? What is it about CS that attracts people who lack the ability to perceive social context?

    I'm an elec. engineering student and I've taken some CS, business and science courses. Without the doubt the CS people are always snarky, pedantic, condescending and down right rude more than any other discipline by a long shot. They're incredibly annoying to work/study with.

    Not to mention they're, well, downright runty. I originally thought its just the insular and challenging nature of CS but that's not true, engineering and the hard sciences are just and rigorous and insular as CS (if not more) and for the most part, they're fill of normal people.

  136. Sick of someone whining about your bad code? by Anonymous Coward · · Score: 0

    Here is what you can do about it. Go find a cliff or a bridge some where then take your entire fucktarded family. Have all of them jump off to their deaths and after that, jump to yours. Then you won't have to deal with the complaints and we won't have to deal with the bitching from someone like you that is too fucking stupid to even exist let alone use a computer.

  137. It's actually your fault ... by Coeurderoy · · Score: 1

    He should not have the time/need to look at your code...
    He should be busy writing his own code, he might bitch about your API definition, and you have then two choices:
    a) tell him to suck it and that "if it aint broken don't fix it", you need the API as they are
    or
    b) Listen and maybe it will really make future extensions easier, so negotiate...

    50K code is actually quite small so although refactoring can always "help" (in theory) but unless you are explicitly trying to win the obfuscated C award it's probably small enough to make it more valuable to add news feature than to "streamline it"...

    Unless you hit some roadblock and it is now "too slow", "break randomly", etc.... then you should probably urgently look at it and fix it yourself (after all 10 years o experience with the code base should make this faster for you).

    But either he refuse to deliver what you ask, then fire him, or you leave him to much time after delivering his module, and he looks at your code out of boredoom...
    So the best you can do is tell him : sure our code is crufty, we just hired you so that we can ease the tension and have some time to refactor, so "write you own f**g code, and let us play around with our stuff, or do you need some API that's missing ? ... write some specs and you'll get it ...

  138. not always by Chirs · · Score: 1

    Coding it "properly" may involve redoing significant parts of the codebase due to invalid assumptions made years ago. A hack now may allow it to work for another year or two, thus punting the problem down the road a ways.

  139. There is only one correct reaction by AmazingRuss · · Score: 2

    Fasten your teeth in his trachea, and pull your head back backward sharply until the trachea comes free from the body.

  140. Try this pragmatic approach. by Nexion · · Score: 1

    Have him pick a small section for rewrite. Have him rewrite it. Code review. If he manages to make improvements without adding bugs let him do it a few more times. If he continues to be solid release the chain. If he fails use the reviews to teach him what he is missing, and in the process you'll gain a developer you are more confident about making changes to the code base.

    1. Re:Try this pragmatic approach. by countach · · Score: 1

      Yeah, I think this is the ideal answer right here. It's not going to be practical in some cases, either because the code base is simply too fragile, or the project too critical to risk, or else because the guy was hired to do something more productive, but in an ideal world, this is what would be done.

  141. Re:Do you always let interns tell you what to thin by Anonymous Coward · · Score: 0

    "Tricks" are rarely an improvement and, to get away from that word, the sort of algorithms you see used and useful in real world applications don't change that much for a given language spec inside of 10 years. Odds are quite good the kid is misconstruing not rewriting to use certain trendy language features as the old code being bad, when often they're mathematically equivalent without any significant difference in maintainability.

  142. Punch him in the face by Anonymous Coward · · Score: 0

    Then tell him if hes so smart to do it himself while you go clean the blood off your hands.

  143. "Ask Slashdot"? Don't you mean "Blame Slashdot"? by Anonymous Coward · · Score: 0
  144. 50K LOC over 10+ years? by Anonymous Coward · · Score: 0

    50K lines of code over 10+ years for (presumably) multiple developers??? Either the team does not have full-time developers or they are really, really slow. 50K is not a lot of code at all.

    1. Re:50K LOC over 10+ years? by Anonymous Coward · · Score: 0

      Amen!

      Try 1.5 Million lines with 4 devleopers on 10 years. We had one Data Structure that was over 2,500 lines by itself!

  145. Re:Is Your Code Designed to Build Walls or Bridges by phantomfive · · Score: 1

    . If you have 5 lines of code, and it isn't clear how to enter it and begin to understand it, then the code sucks. It might be good in other ways, but in at least one crucial way it's bad.

    --
    "First they came for the slanderers and i said nothing."
  146. Perceived greatness by Anonymous Coward · · Score: 0

    There is a story around our Office of a new graduate who thought he was high and mighty because he had been very successfully at university and took that perceived greatness into the workforce. I heard one day his leader took him around to meet the many other people who worked in the office who had PHDs and Masters etc. He immediate got the feeling that he was not special but in fact quite normal.

  147. Mod Parent Up! by coyote_oww · · Score: 1

    Yes, already at +5 insightful, but this is the number one thing coders need to understand. You are getting paid to produce stuff people other than you want. Satisfying yourself is #6 on the list.

  148. Source code is like shit, you can't smell your own by TapeCutter · · Score: 3, Insightful

    Regardless of where anyone learned to program, I'd ask the kid one question - "You say can't read it, so why should we trust you to rewrite it?" - Then offer him some help to understand it, or sack the arrogant little shit if he's pissing people off with his unwillingness to learn "what is".

    I've been in the game for a long while, I have never seen anyone walk in and comprehend the inner workings of a non-trivial source tree in under 3 months, but I've seen plenty of inexperienced people that think they can. The real problem is that code is much easier to write than it is to read. When a coder rewrites something only one thing is certain, it will be an education for the coder. However that coder is now the SME for that application and other coders will have to try and read his code. An old friend of mine, an excellent coder and all round pragmatist, described this phenomena perfectly with the expression; "Source code is like shit, you can't smell your own".

    Disclaimer: Self-taught coder, BSc CS/OR, 22yrs commercial experience, 28yrs coding experience.

    --
    And did you exchange a walk on part in the war for a lead role in a cage? - Pink Floyd.
  149. What if your code _is_ bad? by Endophage · · Score: 1

    As with everything in life, it's hard to admit, and often even harder to see, your own failings. I have no idea what your code looks like, it would have been nice if you'd elaborated on exactly what this intern thinks is bad (architecture, syntax/coding standards, algorithm choices). Maybe there's nothing wrong with it. Plenty of developers are too locked into their own way of doing things and can't get on in a team when the team's way is different to their own.

    If this person can specifically come to you and say "X,Y and Z are bad, do A,B and C to make it better" he may have a case, otherwise he's just blowing steam. The worst thing you could do is completely write him off just because he's young. Ask him to come up with an action plan that identifies 2 or 3 key improvements that could be made.

    I attended an excellent lecture by a software consultant that was hired by a large financial institution to work on their trading platform. The platform was used internationally across their offices, was in excess of 500,000 lines of code and any attempt to add features was running months longer than it should have done. After 6 months working with his team on refactoring and rewriting large parts of the code the revised platform, with exactly the same functionality, was ~200,000 lines of code and features were on a one month release schedule. Some of the original developers quit as all the code they had written, and based their career on, was deleted.

    I'm not saying one or the other of you is right, but neither should either of your opinions be entirely discounted. You have 50,000 lines of code and a team that understands it, you can't change it all overnight, but maybe you can make it better over the course of a few months, there's always room for improvement.

  150. What is Good? by jmactacular · · Score: 2

    My top 3 practical criteria to judge whether code is "good" or not.

    1) Performance. How fast does the application actually run.

    2) Complexity. How many layers and levels and do you have to trace down into to debug something.

    3) Flexibility. Can it be modified easily as new change requests come in.

  151. Re:Drivers by johnnick · · Score: 1

    AAA did a survey in the US about 20 years ago where they discovered that roughly 80% of people believed that they were above average drivers.

    --
    "The plural of anecdote is not data."
  152. Re:Do you always let interns tell you what to thin by Dodgy+G33za · · Score: 1

    Not at all. There are plenty of cases where doing things differently work but can have a massive difference in terms of performance, scalability etc.

  153. An Intern? by Greyfox · · Score: 1

    Did you try blowing your nose on him, and then throwing him in the garbage can? Because that's really about all interns are good for. You could also ask him why he was looking at code and not getting you coffee. Really. The largest project he's probably ever done is probably smaller than the largest function in your code base.

    --

    I'm trying to teach myself to set people on fire with my mind... Is it hot in here?

  154. Re:Do you always let interns tell you what to thin by Dastardly · · Score: 1

    Some times it just takes a different set of eyes. You get buried in the code and things that are not quite right do not jump out at you because you understand it and know it so intimately that you develop blind spots. A fresh set of eyes no matter experience will see things that you simply accept because it does not trigger your "that does not look right" alarms.

  155. Consider the possibility.... by Anonymous Coward · · Score: 0

    Consider the possibility that the fresh set of eyes on the code might have some valid points. With 10 years, you ought to be able to fully know/understand at least 10K LoC (Lines of Code). The threshold (I've seen) is that about the maximum amount of code that a single individual can comprehend and maintain is around 250K of stable code. Specifically meaning understanding the architectural interactions & consequences of changes. Different developers have different maximum saturation levels. Not a "bad thing", just different. Unless the developer is obstinate (and thus a complete moron)

  156. Interns are NOT coworkers. by Nyder · · Score: 1

    Interns are NOT coworkers. They are peons. Scrubs. People who work for free (or nearly) for credit or experience. If they knew anything about the job, they wouldn't need to be interns.

    It's like a student trying to tell the teacher how to teach. You biff the back of the person head and give them some really demeaning job to do. twice.

    --
    Be seeing you...
  157. Coach them by Anonymous Coward · · Score: 0

    Personally (if you can stand them) I'd recommend attempting to coach them in how to provide constructive criticism that doesn't piss people off. I'd go for this rather than ignoring them (or worse), as (in my experience) if they care enough to have an opinion then they generally turn out to be good coders and maybe eventually good engineers.

    If they were my report I would discuss this in their 1 to 1's and if it was a recurrent theme I'd have a word with the HR department and see what courses they could be signed up for; most HR departments in engineering shops have plenty of experience in smoothing out the social rough edges of engineers, shame not to use it. If they were not my report, then I would talk privately to them and if it kept happening provide feedback to their line manager and maybe drop hints about the courses.

    Ultimately most engineering involves working with others, even software development; to be successful it generally helps to be able to get along with folks and most people can learn how to do this better if they choose.

  158. let us judge by Anonymous Coward · · Score: 0

    show us some and let us judge it for you.
    that will satisfy you and him as to whether your code is good or bad

  159. vi or emacs by Anonymous Coward · · Score: 0

    if you use vi - you are a good coder
    if you use emacs - you are a bad coder

    let the flame wars begin. hehehe

  160. Re:Possibly related? by thoughtlover · · Score: 1

    Wow could you not even be bothered to even read the first sentence of the summary?

    A week ago, you read the other side of the same question.

    Guess what? Yes, that was the question you linked.

    I'm glad someone else was paying attention! I'd mod you up if I had points.. It sounds like he told that guy what he thought of his code, albeit not to gracefully.

    --
    No sig for you! Come back one year!
  161. Re:Drivers by Immerman · · Score: 2

    And they may have been right - the really bad drivers bring the average down a lot more than the really good drivers bring it up.

    Now if you were talking above *median*, then sure, at least 30% of them were wrong

    --
    --- Most topics have many sides worth arguing, allow me to take one opposite you.
  162. Maybe your code /does/ suck. by m6ack · · Score: 1

    OK, granted the guy is green and full of himself... But perhaps a fresh perspective is not all that bad. We KNOW that a lot of the stuff we have worked on and inherited is absolute crap that is very difficult for average human beings to grasp. Here's a human being trying to come to grips with a wicked mass of old (and, granted, battle-tested) ideas.

    You are also right that all of us tend to want to greet a problem by trying to bend it into our will so that no matter if the pin is trapezoidal, it will fit (darn it) into our circular world view. And this goes for the new guy as well... We are aware of it, but this new guy may not be aware of it. Explain to him htat he needs to learn to do this as well. Instead of strict adherance to a dogma, a set of programming patterns grows up around a problem space -- not the other way around. Try to help him see the problem and make sense of it first before he triest to tackle the crap with the "new hotness."

    So... give they guy a challange. ell him the abovve, and also help him to understand that the code-base is NOT going to take on a revolutionary overhaul overnight. Tell him he can add his new ideas gradually if the new ideas do any of three things:

    1) Reduce the LOC's in the program.
    2) Measureably improve performance.
    3) Measureably improve the code quality (via new introspection/tracing tools, unit testing or algorithmnic proof of correctness).

  163. bad code? by Anonymous Coward · · Score: 0

    perhaps your code is bad? Has another senior developer with a varied background looked at it?

  164. Define BAD by Codifex+Maximus · · Score: 1

    Bad is such a subjective word. Bad as opposed to what? Bad how?

    To me Bad code is:
    Uncommented, obfuscated, sphagetti, poor structure, follows no name or calling conventions, uses unnecessary tricks to accomplish it's goals, uses soon-to-be deprecated functions, code that just plain doesn't work and above all non-portable.

    --
    Codifex Maximus ~ In search of... a shorter sig.
  165. Suck it up by segfault_0 · · Score: 1

    If out of the 20 things he complains about, one is a good idea, you should look at it as a net positive.

    Id make him pick one or two he is surest about, tell him to make a chart or document explaining whats wrong and how to fix it and make him explain it to you and his peers. Then critique him, accept or reject, and move on.

    --

    I was crazy back when being crazy really meant something. (Charles Manson)
  166. I'm with the new guy by Anonymous Coward · · Score: 0

    There certainly are a lot of respondents here attempting to defend bad code. As a 20-year veteran, I have found that most code sucks and most programmers suck. And it costs companies billions of dollars in unnecessary repairs, re-work, down time, confusion, and lost clients. Do yourselves a favor, folks: Stop making excuses and start doing things right the first time. The old maxim, "Garbage in, garbage out", doesn't just apply to the end users of a program. It applies to the process that creates the program.

  167. Separate work by Anonymous Coward · · Score: 0

    Have him write an error reporting code segment or plugin. He has to figure out real learning comes from fixing mistakes not doing things right from the start because right is relative and you never know when a mistake may occur therefor are walking blind. What he is demonstrating is called confirmation bias. He needs to see everything from the macro level not the micro.

    Know that this person will be talking behind your back so consider that he never spoke to you and is completely and entirely making up every conversation. Oh and stay away when he has his morning coffee.

  168. he should just fix it by Anonymous Coward · · Score: 0

    If I'm tasked to work on code, and the code is spaghetti, I rework/refactor the code until it is understandable and can be worked on without worrying about unseen dependencies. I never complain or critique, I just explain that a day or two of refactoring will make the code manageable, and to whit: the code as it exists is not manageable. For some reason, nobody takes ownership of code that is known to be bad, mums the word.

  169. Some very good reasons for "bad" code by krazdon · · Score: 1

    Nearly all code is "bad" to one degree or another. There are some very good reasons for this. 1. As Steve Jobs said, "real artists ship". If you're in a research lab it may be a different matter, but in the real world, your code is never perfect, yet sooner or later you need to let real people use it, and either make money or discover that you're trying to solve a problem that doesn't exist. If the former happens, you should try and go back and improve your code. If the latter happens, be glad that you didn't try to design the perfect solution to your non-existent problem and go try to solve real problems. 2. The human race moves forward. Hardware gets faster, cheaper, smaller and uses less energy. Operating systems, browsers, and languages become easier to develop for with new features, and become more efficient with hardware acceleration, various optimizations, etc. You may have written amazing code 10 years ago, but it is "bad" code today because there are now better ways to do things that didn't exist at the time. Over time you should update your code to try to take advantages of this, though you may be limited due to a need to support legacy platforms. 3. You weren't the same person 10 years ago as you are now. We are continuously learning new things, fixing previous mistakes, and making new ones. If you look back at your old code, you should think that it's "bad" at least in some ways. If you don't, it means you didn't learn anything since you wrote it, which is a shame. 4. You don't know everything, and you don't have to. That's why you hire smart people, so you can focus on your strengths while outsourcing the rest, and so that you can learn how others approach problems differently than you. Instead of trying to defend your territory as others have mentioned, I'd ask for ways in which the code is "bad" and can be improved, and then include him in the process of triaging those tasks against the rest of the team's workload.

  170. Have you considered.... by devloop · · Score: 1

    .... the possibility that your code is in fact terrible? might be worthwhile to examine his assertions.

    while the code might work today, it could easily turn into an obscenely unmaintainable pile of spaghetti.

    i have witnessed moderately successful start ups get their foot in the door and show promise, only to be immediately
    killed off by their own success when they are unable to expand their software base due to pervasive sloppiness
    in code that "worked fine but was not pretty".

  171. Growing Pains: My First Three Years in Industry by nickochee · · Score: 1

    It's a very personal journey to move from criticizing other people's code to taking the code for what it is. I've been in the industry for nearly 3 years now, and I pride my earlier self on having quickly gotten out of the rut that is "xeno-codo-phobia". Here are my own self-observations.

    Stage 0: I don't want to look at other people's code. I'd rather roll my own stuff given the opportunity. If I have to work in larger code bases where reading code is a necessity, I want to just get in and get out without so much as even looking at the decorations or saying hi.

    Stage 1: Okay, you've convinced me, Mega Corp X. I've seen some cool things in some code reviews that have been passed around and/or assigned to me. I might be open to taking at look at.. OH MY ***, IT'S ALL TERRIBLE. I NEED TO REWRITE THIS POS! A little, no some, no all of it! Hmm, my lead won't let me rewrite it? Okay, I'll just spend extra long on new features, stage 0 style, or I'll work on other people's code and complain the whole time to them about how they do X, Y, and Z wrong.

    Stage 2: Hrmm, my coworkers had wills of steel and could repel my complaints. I didn't change their minds very much. After finding out about the code's history, I almost 100% agree with the decisions that led to the code being the way it is given the constraints upon writing time. The only person I upset by complaining/harboring a negative mental state about the code was myself. Maybe I should just be more constructive with my complaints or not complain at all.

    Stage 3: When I see code I don't like, I spend time to first educate myself about it. I add docs/comments when there are none and otherwise make tiny checkins to beautify the code where I can. Sometimes I find bugs this way. Sometimes I simply add clarification (for myself and the next reader). Sometimes it spawns discussions with the original devs about how and why we did things a certain way, and there's almost always a reason. Sometimes it teaches me to avoid that code like the plague as the original dev left and now it's a maintenance nightmare that all devs use to play hot potato. 100% of the time I learn something new. 100% of the time, judging before I do my due diligence results in either a waste of my time or a waste of someone else's time.

    Stage 3 is basically where I not only know logically but also believe that:
    * I am smart and my coworkers are smart. Given the same inputs, we tend to code the same way.
    * My senior coworkers typically have a deeper understanding of the problem space. (they have more input than me)
    * My senior coworkers typically better understand the priorities imposed by the business/culture of the company. (they have more input than me)
    * Given the discrepancy between my understanding (my input) and their understanding (their superset of input), they are probably making better decisions for the company.

    Sure the code might be locally worse because one of the above assumptions may occasionally break. Sure the code might not adhere to some theoretical golden ideal. BUT. I have tremendous faith now that the code is for all intents and purposes in one of the best possible (where best is relative to the company) states it can be in. The deleterious effects of time may have already taken their toll, but at the time the devs made those decisions, they were most likely optimal for the larger organization.


    So yeah. I basically had to learn and accept that I was just full of myself and that an open mind trumps a closed one.

    My advice? If you like the intern and want them to come back, be patient. Put them in situations where they learn the above, and don't take personal offense as they go through this phase of their professional life. If you don't like them and don't want them to come back, call them out on their pigheadedness so they associate their failure (not getting a return offer) with their close minded values. You probably don't want someone like that on your team (at least in the immediate future), and it will be better for them (and the community) in the long run.

    Best of luck!

  172. Boy, this takes me back. by Anonymous Coward · · Score: 0

    Back to the time when I gave a shit. Now I just want to get paid and go on holidays.

  173. it *is* crap or you would have posted a sample by Anonymous Coward · · Score: 0

    I bet the guy is dead right that your code is crap.

  174. brings back memories.. by Anonymous Coward · · Score: 0

    Sounds like me 20 years ago. My first manager cured me by responding to every bad code issue I raised with this response:

    "Great! Thanks for discovering this. When do you think you can fix it?"

    After a couple of times I learned my lesson..

  175. fire him by Anonymous Coward · · Score: 0

    Simple. If you are in the position to do so, you fire him. Otherwise, ignore him.

    He's an intern. It's not your job to school him.

  176. Ask him why exactly and specifically it is bad. by Anonymous Coward · · Score: 0

    Most programmers do write fairly shit code, and I can usually enumerate to them exactly why it is shit and what they should do about it. Whether they agree or not is a different matter, and many things are subjective, but many things are not. It is generally because most programmers don't know a lot of fundamentals properly, and most programmers are lazy in the way they write code, but most importantly because most have never put their code up for critiquing by an audience. If someone can point out specific problems with my code and specific techniques for improving it I am very happy, and I love having my code reviewed. But if they just say it is shit and can't tell me why it is shit then it's water off a duck back and their opinion doesn't matter, and because I like to have my code reviewed I'm not thin skinned about criticism. That's what makes it a valuable learning exercise and not a torture.

  177. do these steps by Anonymous Coward · · Score: 0

    Step 1 - punch them in the throat
    Step 2 - go fix your shitty code

  178. Maintenance by Anonymous Coward · · Score: 0

    It's probably shit code.

    Software maintenance is a fundamental and always-forgotten part of the SDLC.

    I'm guessing your 50,000 lines of code have not been maintained, and your intern is calling you on it. As a dev, this is his job.

    To all you self-taught coders who hate college-educated kids, I hope you have all your future medical needs taken care of by self-taught doctors. Leave the college-educated docs for the rest of us.

    Furthermore, if it bothers you how bad those darn college-educated kids are at coding, why not become a professor and teach them?

  179. Re:Drivers by NoOneInParticular · · Score: 2

    If you want to be pedantic, please use correct terminology. First, the median is an average, the arithmetic mean another, the mode another, the geometric mean yet another. You probably equate average with arithmetic mean, but that's not strictly true. Second, the central limit theorem proves that for any random variable that has finite (stable) variance the mean and the median are equal. Not sure if 'driver ability' has finite variance, but if it is anything like IQ, length or weight, then yes, the (arithmetic) mean divides the top 50% from the bottom 50%.

  180. Visited the real world lately? by Anonymous Coward · · Score: 0

    "The boss is interested in the long term effects of having code that doesn't suck, such as lower maintenance time."

    In most places where code development happens there is no maintenance time/cost. Lots and lots of code goes into products and when the development of those products is "good enough" management orders production and shipment .... and they build and ship, and build and ship, etc until they discontinue the product either because there is insufficient demand or some component or subassembly is not longer available. Most products with microprocessors in them never get any upgrades or maintenance. Some products that DO get some maintenance are in strictly regulated areas like aerospace or medical in which case only the parts of the code that absolutely MUST be touched are in fact touched .... and any general "maintenance" is out of the question.

    The fantasy of a nearly perfect code base with constant maintenance is fine on the college campus or perhaps at a place like Amazon ..... but it's just NOT a general rule that applies in much of the part of the world where microprocessors are used

  181. And you, sir by Anonymous Coward · · Score: 0

    are the kind of jerk all your co-workers and their wives and kids can end-up hating

    In the real world, there are often investors who must (by contract) see a return on their investment by a certain date. In this world, an attitude like yours can lead to a division or an entire company getting shut down for failure to deliver the product in time and that means lots of innocent people who had no control over the situation (like technicians, shipping and receiving people, marketing people, sales people, janitors, IT staff, etc) can end-up unemployed all because some arrogant jerk decided there could be no ugly code in a product where there was not going to be any actual benefit to perfectly clean code. It's impure, and unfortunate, and we may not all like it, but in the real world there really is such a thing as "good enough". Given the choice between "good enough" (and a bunch of happy families who have health insurance, food, rent/house-payment money, etc) or an analysis that says "good code" cannot be ready in time (and a bunch of people with kids on the unemployment line) ..... well just count me as a humanitarian; I'll go "good enough" on the code.

  182. I was a third-party observer of the following by Anonymous Coward · · Score: 1

    disclaimer: names and specifics removed to protect the innocent from the lawyers

    New guy: "this code sucks"

    old guy: "how would you have done it?"

    New guy: "Like this: {details removed for brevity}"

    old guy: "yup, that looks better ... don't do that"

    New guy: "why not?"

    old guy: "because you do not know the hardware, the regulations, and the environment.

    New guy: "but its better and cleaner, so that stuff shouldn't matter"

    old guy: "I know, you think that, but we did it your way a while ago, and now we do it this way

    New guy: "This way sucks, why'd you change?"

    old guy: "we killed a customer

    New guy: "oh"

  183. he doesn't understand your code by Anonymous Coward · · Score: 0

    And you think it's his problem?

    sounds like the code is missing comments
      and some design documentations that explains the design and the reasons behind it

  184. Fire him by Anonymous Coward · · Score: 0

    I'd say I know the guy you're talking about, but the industry is rife with this sort.

    We give 'em a few months, and if they haven't checked their attitude by then, we fire them before their probation runs out. After a few boots like this, they'll either realise that they're not as good as they think, or they'll leave the industry, grumbling about elitist attitudes or something. Either way, we move on to the next hire and hope for a better one.

    Trust me - I've been at enough companies to know. If someone is shaping up to be a problem, you're much better off getting rid of them while you can. The cost of replacement and re-training of a newbie is much lower than the cost of having a problem on staff, pissing off all of your more experienced (and productive) developers.

  185. In depth code review by mattpalmer1086 · · Score: 1

    Well, then he needs to understand your code base a bit better, and gain some experience of coding with other people.

    You could schedule an in-depth code review of the main components of the system with him. You get to explain the what and why of the existing code, and he gets to explain what he thinks could be better. This isn't something to do in an hour - schedule at least half a day for this, or even more if you think it will be worthwhile.

    He may have some good ideas - but he probably doesn't have the experience to understand why some ugly bits of the code aren't worth changing, or why rewriting everything isn't usually the best policy.

    You could also get him to walk you through some code he has written (maybe open source?) which exhibits what he sees as good coding.

    The main thing in a coding review is to get people to explain what the defects and behaviours they see in the code are, without reference to style or that it's simply not how you would have written it. I've often found that the "why" of things is often missing in code. Sometimes the outcome of a code review is simply to add a few more comments explaining the why, rather than the what, so others benefit in future too.

  186. Figure out if he is on the level by Anonymous Coward · · Score: 0

    Ask him to come up with proposals for improving the code base. With that it should be easy to see whether he is a moron or your code really does suck. Like most people have mentioned, nearly all code is bad, so, unless the guy is a moron you could probably learn a few tricks...

  187. WWAD? by Anonymous Coward · · Score: 0

    Crosh your enemy, drive him befoah you, and hear da lamentation af his woman.

  188. Hmmm... by Anonymous Coward · · Score: 0

    Is this intern fresh out of school with no previous experience? Just fire him if he has that much audacity.
    However if he happens to have a significant number of years of previous experience, perhaps you should hear him out. Who knows, maybe a small bit of that self perceived greatness might be justified, and you might learn something new.
    Keep in mind, of course, that the fact that he doesn't understand some code yet does not, in fact, mean that that code is good. Code can be objectively terrible. Not to mention that good code is easy to understand, so this could be a big part of the problem.

  189. Software Metrics by Martin+S. · · Score: 1

    The answer to both Questions is use objective Software Metrics.

  190. Sack the cocky twat by tehcyder · · Score: 1
    While he's still on probation.

    I don't know how well that translates into American.

    --
    To have a right to do a thing is not at all the same as to be right in doing it
  191. engage him by Anonymous Coward · · Score: 0

    Give him one subsystem with clearly defined contracts and ask him as a backburner project if he fancies reimplementing it how he'd like.
    Call it a training exercise if you want.

    Worst thing that happens is he burns a few cycles learning the subsystem in depth.
    Best thing is you get an improved subsystem.

    In either case you are now in a position to critique his code. :D

    That is, of course assuming the codebase is broken into defined subsystems with defined interface contracts and the company allows guys space to train/learn.
    If not, then frankly his critique might have some merit.

  192. "easy" response to this by RobertLTux · · Score: 1

    What you do is have him IN DETAIL give you all the points where your code "sucks"

    then take this report and figure out where

    1 He is being a "buzzword jackass"
    2 the code actually sucks AND CAN BE FIXED
    3 the code sucks because %issue% that needs to be worked around
    4 he has actually found a cleaner and stable way to do the code

    then if he has more than say 60% in case 2 and 4 keep him around

    if he doesn't then well "phone for you its a Mr Piffy he said that Mr BOFH is a bit busy but he has some time to chat with you"

    --
    Any person using FTFY or editing my postings agrees to a US$50.00 charge
  193. Blast from the past by Anonymous Coward · · Score: 0

    Sounds like a lot of the "senior" coders here who are all in favor of "putting the newbie straight" in some appalling way forget the following:

    "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." – Brian W. Kernighan

  194. Maybe it really does suck by Anonymous Coward · · Score: 0

    I've seen lots of legacy code that sucked hard. Mostly due to lack of coding standards and continuing education. Maybe your code does suck and you need to reexamine it!

  195. Point him to your existing documentation by jlusk4 · · Score: 1

    If you don't have any, write some. If it's crap, improve it.

  196. Security by Anonymous Coward · · Score: 0

    I have seen good and bad code. I must say that I am extremely disappointed in the lack of security related comments. Good code cannot exist without this feature. There are many other features that are both desirable and needed from code. If the new employee has brought up security issues related to the code, please spend sometime thinking about the suggestions. This extra time could save you company a lot of grief. You won't get paid for it but secure code could be the difference between your company existing and looking for a new career.

  197. University marks. by Half-pint+HAL · · Score: 1

    One of the things most of us forget is that we've probably never actually seen a 100% pass mark on a student's programming assignment beyond first year (or second year, at a push).

    When I was at university, I wanted those As. I was OK with the Bs, but I was really annoyed when I got a C and distraught when I got Ds. In the end, I got a 2:2 for my degree -- a C.

    What's my point? My code at university was not spectacularly good code, but it wasgood enough. I passed. I got a job. I moved away from code. And almost a decade later I'm back in the IDE hotseat for a personal project and realising that I understand a hell of a lot about how computers work, and it's all thanks to a degree and results that I previously lamented as "mediocre".

    Most of us have a hard time doing it, but we need to accept that good enough is good enough. But at the same time, that's never a good excuse for not improving yourself when the opportunity arises.

    --
    Got them moderator blues I blieve I walk out the do', With these mod-points I been gettin', I 'most never post no mo'
  198. First, accept the truth by TheSkepticalOptimist · · Score: 1

    Maybe accept that your code sucks. I mean just as bad the guy that goes around assuming everyone else's code sucks is that guy who assumes he is perfect.

    I think the only reason why I can consider myself a senior developer is because I learned how to finally accept criticism and improve my coding based on it, and understand I don't know everything out there so every new idea or concept that is introduced to me should be evaluated. If someone shows me a better way to do things, I adapt and bring it into my skill set. Also a senior is not "possessive" of "their" code so should not be offended when someone criticizes it. The code is about the product you are trying to produce, and making the product better, not your personal ego.

    If that is not the case then ask him exactly why it sucks. People are reactionary as you said, so if he doesn't understand something and so assumes it sucks, but then can't explain why it sucks, or better yet, explain how to make it better, then he is just an ass that likes to bitch. If he stands there and can't give a reason for why it sucks then he basically sucks as a developer and should probably be turfed.

    --
    I haven't thought of anything clever to put here, but then again most of you haven't either.
  199. Re:Your code IS bad by Thuktun · · Score: 1

    "Oh, wait, this is my code? Well, I know better now."

  200. My bad code by phorm · · Score: 1

    Ever looked back at code you wrote a few years ago, and gone "ick!" ?

    I know I've had a few moments like this. I've learned new tricks, found new issues, and generally gone back to find that my old code just wasn't up-to-standard several years later.

    If the junior guy can point out stuff that can be updated, and a good reason why, then let him demonstrate a solid case and take the advice.

    However, "code" is one thing, and "coding style" is another. You can get into huge flamewars about just stuff like indentation (spaces VS tabs) etc. Over time, styles will change. In that case you need to balance necessity against time. Sometimes a style change can make an important difference. Other times it's just not worth the time. If the new guy is arguing that variable names $a, $b, and $c are less readable than say $sAccountName (string), $iAccountID (integer), etc... he would be right. Maybe you don't need the data-type (s/i) prefix, but at least having descriptive variables is an important improvement.

  201. Diagnose what he said by Anonymous Coward · · Score: 0

    Offer him an aspirin, and suggest he go home and get lots of bed rest.

  202. Reply? by Tug3 · · Score: 1

    Newbie: "Your code sucks and you don't know how to code!"
    You: "...and your mother smells of elderberries!"

    But he's probably to young to get that, so don't use it. Seriously, just as with human relations in general there's no one answer without being there. While something like this is not uncommon, it's still annoying. I just hope your manager is experienced enough to see through him. If not, I hope you got backup from your older colleagues to make him understand what's going on.

    Worst thing being naturally is that he is allowed to rip apart working old code. Instead he should be assigned to writing new functionality and be restricted to touch old code unless absolutely necessary. And that's the job of his supervisor, not his colleagues.

    --
    If all else fails, pull the plug and get out...
    The Life is out there...
  203. He *is* an intern.... by whitroth · · Score: 1

    So, set up an hour or two, maybe even pull in one or two other experienced people, and do a code review on some of the stuff he's complaining about. Listen to him, then explain why it's that way, and what he's learning in school is not necessarily correct for the real world.

    Oh, and I'd look at something he wrote, for things like parameter validation and error handling....

              mark

  204. When criticized, ask for help by lsatenstein · · Score: 1

    My experience with whiz kids who knock my code is to tell me where I did wrong. To explain to me if there is a better way, in terms of efficiency and maintainability.

    Sometimes I learn somethings, and often times the whiz kid learns something. I am open minded. I and he have no exclusivity on being geniuses.

    --
    Leslie Satenstein Montreal Quebec Canada
  205. Take him out to the car park by uninformedLuddite · · Score: 1

    and tap dance on his lungs

    --
    The new right fascists are bilingual. They speak English and Bullshit.
  206. First off by ananthap · · Score: 1

    First off, kids are cheaper and so eventually they will replace senior workers who are in higher pay slabs. Secondly how you "pulled it off" may not be the only way or relevant now. If he shows promise (as you say) ie. he seems genuine and not just criticizing, then you must try to go down to his level and tell it in his techie terms. OK

  207. Fire him. by ddt · · Score: 1

    Fire him. He'll start telling all his other job prospects how stupid your code was, and then he'll magically discover that he either doesn't get hired because he's a whiny bitch or that only other assholes will hire him, and then poverty, misery, or both will mop up the rest of his attitude by serving as a gentle nudge to stfu and code.

  208. Re:Drivers by Immerman · · Score: 1

    Ask a bunch of random people what the average of five numbers is and you'll be almost guaranteed to get the arithmetic mean, even among statisticians. Therefore, outside of special contexts, arithmetic mean = the average. In fact even in contexts where other types of average are in use it's unlikely that the unadorned term "average" will be used to refer to any but the arithmetic mean, it may even be avoided entirely for the sake of clarity since it is technically non-specific. Meanwhile the difference between the average and the median is something worth drawing attention to precisely because most people only know one mathematical definition, while the colloquial usage ("average Joe") corresponds much more closely to median, and the difference between the two can be very informative about distribution. I'll admit my pedantry is a work in progress though.

    As for the convergence of median and mean - that's heavily dependent on a symmetric probability distribution, which is actually not the case for a very wide variety (a majority?) of variables. My statistics terminology is rusty though, so perhaps that's covered in being finite and stable. Regardless of the reality of driver skill distribution, *perceived* skill distribution at least is highly asymmetric. Consider that under normal circumstances there are minimal distinguishing characteristics between a truly excellent driver and a merely competent one - in fact the excellent driver may even be perceived to be reckless if they engage in maneuvers that would be risky for someone less skilled. Meanwhile, idiot drivers have a tendency to make themselves extremely obvious, usually in ways that endanger or annoy those around them, increasing the perceptual weight of their incompetence. The resulting apparent distribution is thus has a relatively hard upper limited near "competent" (probably ~= median skill level), while the lower limit extends.... well quite a distance, and the average will thus be artificially lowered.

    --
    --- Most topics have many sides worth arguing, allow me to take one opposite you.
  209. All babies are beautiful by romons · · Score: 1

    Sadly, they get older. Just like code. Tell your lil friend that you can't compare babies to grandmothers, at least on a beauty scale. Also, tell her that there are compensations to being a grandmother, like being able to deal with the world in a rational way...

    --
    Go to Heaven for the climate, Hell for the company -- Mark Twain
  210. Have him update the comments by billstewart · · Score: 1

    If he isn't understanding your code, maybe you need better comments in it. Have him write some!

    Or maybe your code is complex because it's trying to implement a bunch of complex semi-contradictory requirements that evolved over time, rather than implementing one clear design specification that was available upfront. That also needs really good comments.

    --

    Bill Stewart
    New Fast-Compression-only CPR http://preview.tinyurl.com/dy575ks
  211. I'm on the kid's side by Anonymous Coward · · Score: 0

    I have worked with too many entrenched old-timers lately who use seniority and "it works" as justification for creating huge, disorganized and tightly-coupled messes in the code, and then stonewalling, bullying and intimidating anyone who points out that the industry long moved on past the techniques they are using, and that there are simpler and more flexible ways to do things. So I'm on the kid's side.

    The defensive tone of OP is kind of a hint. As are the inherent ad hominem attacks, e.g. "it is simply because he does not have the experience with it to actually understand" ... "his own self perceived greatness." This doesn't sound like an educate/learn situation, but a "I'm going to batter this kid because my feelings are hurt" situation. My guess is that this has been building, with rounds of increasing griping and intimidation leading to a confrontation.

    If the code has merit, then there's no point in coming on slashdot and whining about some intern breaking The Rules by expressing what he thinks.

  212. What's my job here? by Anonymous Coward · · Score: 0

    10 years at the company, and I"m faced with a smart new hire that maybe doesn't have my experience and judgment?

    If I don't view my job as teaching the new hire what I can, helping to make him great -- somebody should be firing me.

    I'd ask him what's wrong with the code. And what he'd do differently. If he's right ... I'd tell him to go do it, and come back and review it with me when he's done.

    If he's wrong, it's an oppt'y for me to teach him something he needs to know.

    If he's got an attitude issue ... I'll coach him on being effective engaging w/ others ... see if I can help learn this a little faster than I did.

    I'll recognize that I used to be him.

    And, if I do my job right ... he won't become a 10-year unapproachable, arrogant, know-it-all that keeps chasing away all of our new talent.

  213. Thoughts by Anonymous Coward · · Score: 0

    If the guy can convince me why it's wrong, then sure, I'll adopt a new way of doing things. That sting you feel? Pride fucking with you.
    If the guy is wrong I'll try to explain why. Unfortunately there's thousands of things you learn over the years, what to do and what not to do, heuristics and patterns, and sometimes along the way you may forget the exact reason why you use a certain technique. If you can't come up with a reason why, suggest that if it isn't broken, don't fix it until it is.

    Tell him that you think HIS code is shit, and that you don't trust his opinion, and that he needs to defend or back up his remarks.