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?"

326 of 507 comments (clear)

  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: 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.

    7. 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

    8. 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.
    9. 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.

    10. 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.

    11. 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.

    12. 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.

    13. 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.

    14. 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.

    15. 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.

    16. 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
    17. 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).

    18. 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.

    19. 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.

    20. 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.

    21. 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.

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

      Best Slashdot comment ever.

    23. 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.
    24. 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.
    25. 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.
    26. 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
    27. 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.

    28. 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.
    29. 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.

    30. 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'
    31. Re:Tell him to write goddamn login page himself? by SolitaryMan · · Score: 1

      This. A thousand times this.

      --
      May Peace Prevail On Earth
    32. 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.

    33. 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.)

    34. 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.
    35. 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.
    36. 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.

    37. 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.

    38. 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.

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

      good post! enjoyed it.

    40. 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.

    41. 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.

    42. 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.
    43. 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.
    44. 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???).

    45. 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.
    46. 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.

    47. 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 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
    4. 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.

    5. 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

    6. 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
    7. 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.

    8. 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.

    9. 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.

    10. 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

    11. 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.

    12. 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.

    13. 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.

    14. 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.

    15. 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).

    16. 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.

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

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

    18. 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.

    19. 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
    20. 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."

    21. 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
    22. 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.

    23. 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
    24. 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.

    25. 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.

    26. 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.

    27. 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.

    28. 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.

    29. 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

    30. 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
    31. 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
    32. 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
    33. 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.]

    34. 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
    35. 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
    36. 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
    37. 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
    38. 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.

    39. 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.

    40. 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.
    41. 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
    42. 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
  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 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.

  4. 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 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.

    6. 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.

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

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

    8. 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
    9. 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?
    10. 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.
    11. Re:Is he right? by AwesomeMcgee · · Score: 1

      Less effective than advertised.

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

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

    13. 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.

    14. 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.
    15. 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.

    16. 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
  5. Fire him by Anonymous Coward · · Score: 4, Funny

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

  6. 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

  7. 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: 1

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

    2. 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.

    3. 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.
  8. 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.
  9. 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: 4, Funny

      That's easy.

      Perform a Core Dump.

    5. 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?"

    6. 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!

    7. 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.
    8. 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.

  10. 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"
  11. 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 dcollins · · Score: 1

      Oh so much this.

      --
      We know where leadership by an anti-intellectual "strongman" who scapegoats minorities and likes boisterous rallies goes
  12. 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.

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

    outside, at the gate.

  14. 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.
  15. 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.

  16. 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 caywen · · Score: 2

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

    3. 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.

    4. 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.

    5. 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.
    6. 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.
    7. 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."

  17. 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.
  18. 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.

  19. 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.

  20. 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.

  21. 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.

  22. 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).
  23. 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!
  24. 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..

  25. 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.

  26. 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.

  27. 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.

  28. 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.

  29. 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

  30. 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."
  31. 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

  32. 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...

  33. 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! ~~
  34. 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.

  35. 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.

  36. 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.

  37. 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.

  38. 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.

  39. 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.

  40. 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 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.
  41. 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 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.

    6. 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.

  42. 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,

  43. "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.

  44. Stacktrace or GTFO. by zarmanto · · Score: 1

    B-B-But...

    Stacktrace.
    Or.
    GTFO.

  45. 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.

  46. 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
  47. Re:Step One by zarmanto · · Score: 1

    There are no coders or technically literate people here.

    Incorrect.

  48. 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
  49. 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.

  50. 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.

  51. 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.

  52. 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 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.

    2. 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.

  53. 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.
  54. 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.

  55. 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.

  56. 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.

  57. 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: 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.

    2. 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.

    3. 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.

    4. 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.

    5. 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.

    6. 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
    7. 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/
    8. 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.

    9. 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.

    10. 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."

  58. 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...

  59. 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.
  60. "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!

  61. 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!

  62. 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.

  63. 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.
  64. 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
  65. 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.

  66. 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!
  67. 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.

  68. 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.

  69. 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
  70. 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.

  71. 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.

  72. 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.

  73. 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.

  74. 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.

  75. 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"?
  76. 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.

  77. 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
  78. React like he's Han Solo. by macraig · · Score: 1

    Encase him in carbonite and mount him on the wall.

  79. 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.

  80. 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.

  81. 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.

  82. 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.

  83. 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..
  84. 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.

  85. 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"!

  86. 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.

  87. as usual: xkcd by spatley · · Score: 3, Funny

    just show him this http://xkcd.com/844/

  88. 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!

  89. 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..
  90. 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.

  91. 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.
  92. 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.

  93. 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.

  94. 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.

  95. *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.
  96. 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.

  97. 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 ...

  98. 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.

  99. 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.

  100. 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.

  101. 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."
  102. 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.

  103. 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.
  104. 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.

  105. 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.

  106. 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."
  107. 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.

  108. 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?

  109. 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.

  110. 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...
  111. 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!
  112. 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.
  113. 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).

  114. 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.
  115. 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)
  116. 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.
  117. 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.

  118. 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".

  119. 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!

  120. 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%.

  121. 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"

  122. 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.

  123. Software Metrics by Martin+S. · · Score: 1

    The answer to both Questions is use objective Software Metrics.

  124. 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
  125. "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
  126. Point him to your existing documentation by jlusk4 · · Score: 1

    If you don't have any, write some. If it's crap, improve it.

  127. 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'
  128. 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.
  129. Re:Your code IS bad by Thuktun · · Score: 1

    "Oh, wait, this is my code? Well, I know better now."

  130. 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.

  131. 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...
  132. 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

  133. 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
  134. 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.
  135. 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

  136. 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.

  137. 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.
  138. 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
  139. 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