Slashdot Mirror


Ask Slashdot: How To Convince a Team To Write Good Code?

An anonymous reader writes "I am part of engineering team that maintains a very important component in our company. Our code quality and general engineering quality focus has been very weak: we have frequent buggy releases, our latencies are shooting up, our test coverage is nearly non-existent, and it is impossible for a newcomer in our team to get up to speed and be productive in less than a month due to unnecessary complexity. A group of 2-3 of us want to change that, and we know what needs to change technically — the better code review and release processes, better build tools, etc. But despite that, the quality of our code and design continues to suffer, and poor code continues to get released in the name of keeping the scheduled release date (product guys don't like to wait). We feel that if the right thing is done every time, we would can eliminate our issues and still release at the same pace. How do we effect the social change necessary to convince them of what is better and encourage them to take the effort to do it?"

221 of 366 comments (clear)

  1. Sooo.. by kiriath · · Score: 5, Funny

    Do you work for Blizzard?

    1. Re:Sooo.. by Anonymous Coward · · Score: 1

      Or Samsung?

    2. Re:Sooo.. by Anonymous Coward · · Score: 1

      Or Microsoft?

    3. Re:Sooo.. by Anonymous Coward · · Score: 1

      Or Yahoo?

    4. Re:Sooo.. by c0lo · · Score: 1

      Or CA?

      --
      Questions raise, answers kill. Raise questions to stay alive.
    5. Re:Sooo.. by nedwidek · · Score: 1

      IBM. Definitely IBM.

      --
      Post anonymously - For when your opinion embarrasses even you!
    6. Re:Sooo.. by phantomfive · · Score: 4, Interesting

      Heh, that raises a question. I often complain about other people's code, it's a typical developer hobby. I can name a lot of companies that produce lousy code, but

      What companies do you know that produce good, high-quality code? I was depressed to find I couldn't think of many. Maybe Sun before they disappeared, and NeXT, before they disappeared, and SGI.

      --
      "First they came for the slanderers and i said nothing."
    7. Re:Sooo.. by Anonymous Coward · · Score: 4, Funny

      So.. you are saying good code equals company goes bust? Straps on flameproof suit and helmet...

    8. Re:Sooo.. by cheater512 · · Score: 2

      Google's code that they have released seems pretty decent.

    9. Re:Sooo.. by phantomfive · · Score: 1

      So.. you are saying good code equals company goes bust?

      It's kind of worrisome, isn't it?

      --
      "First they came for the slanderers and i said nothing."
    10. Re:Sooo.. by phantomfive · · Score: 5, Interesting

      Google's code that they have released seems pretty decent.

      I don't know which code you were looking at, you are probably right. But I can tell you, I've spent a lot of time in the Android codebase, and that thing is giant mess. Everywhere you look there are bugs. You can report them and they don't get fixed. There is undocumented behavior. More than once I've wanted to throw my monitor out the window in a rage after working on Google code. I hate their stuff.

      --
      "First they came for the slanderers and i said nothing."
    11. Re:Sooo.. by dgatwood · · Score: 2, Insightful

      What companies do you know that produce good, high-quality code?

      Consistently or occasionally? From what I've seen, your average company produces one or two great products and a lot of half-assed projects. I call this the Lightroom-Flash spectrum. On the upper bound, you have code that is fairly well written (apart from that case-sensitivity maps bug, ahem...), and on the lower bound, you have... well, Flash.

      What distinguishes one from the other? IMO, you can roughly quantify it as: q = 1 / (t_sub_r * b_sub_p), where q is quality, t_sub_r is time since the last ground-up rewrite, and b_sub_p is the bug punt rate—the number of bugs that got punted to the next release because you couldn't fix them.

      In the average organization, T_sub_r is a linearly increasing variable based on time, because rewrites never happen. Similarly, because the schedule is fixed, the total number of bugs is proportional to the code size, and the number of coders is also proportional to the code size, the number of bugs punted tends to be proportional to the code size.

      Assuming your code size increases roughly linearly based on time (but in sudden jumps at every release), then code quality is roughly O(1/(t^2)). With products that are given adequate care, though, the schedule lengthens or the rate of code expansion tapers off over time, so that Q is probably closer to O(1/(t * log_base_k(t))) for some base k.

      Either way, though, it's a race against the clock, because the OS is changing under you and the world is changing around you, so even if you did absolutely nothing, the code quality would fall off at a rate of O(1/t^2), because all of your bugs are punted.

      Either way, the only way you'll ever do better than 1/t is if you periodically do major rewrites of big chunks of code. Of course, this introduces a whole new set of bugs, but the code quality will improve because you will have learned (hopefully) from the mistakes of the previous version of the code. And you must do this for pretty much every section of your code on a regular basis or else the old, crufty parts will eventually degrade into a black box that everybody is afraid to touch.

      Or you could just do everyone a favor and periodically introduce code that looks like this weaved in and among what you consider crap code in an effort to force people to rewrite it.

      --

      Check out my sci-fi/humor trilogy at PatriotsBooks.

    12. Re:Sooo.. by Anonymous Coward · · Score: 1

      Android was not originally developed by Google - it's probably a real millstone for their devs now

    13. Re:Sooo.. by TheRaven64 · · Score: 2

      That certainly isn't the case on any of the projects I've worked on with Google contributors. They tend to think a nest of #ifdefs is the correct way of writing cross-platform code, and fall into the trap of thinking that the solution to any problem - especially the problem that the current codebase is overcomplicated - is to add more code.

      --
      I am TheRaven on Soylent News
    14. Re:Sooo.. by pjt33 · · Score: 1

      Sun? Did you see the size of the Java Bug Parade?

    15. Re:Sooo.. by anyanka · · Score: 1

      What companies do you know that produce good, high-quality code? I was depressed to find I couldn't think of many. Maybe Sun before they disappeared, and NeXT, before they disappeared, and SGI.

      I see you haven't tried to secure a newly installed Irix system.

    16. Re:Sooo.. by RabidReindeer · · Score: 2

      So.. you are saying good code equals company goes bust?

      It's kind of worrisome, isn't it?

      The perversity of the universe tends towards the maximum

      Larry Niven (I think).

    17. Re:Sooo.. by invid · · Score: 5, Informative

      I used to work for a company that produced avionics software. Obviously, we had to write solid code. This is how we did it: (1) Mandatory line by line code review by a different department. (2) Have a test cycle about as long as the development cycle. (3) Be willing to sacrifice the schedule to make it work. This is why planes are late and over-budget, but I wouldn't fly otherwise. And no, I had nothing to do with the 787.

      --
      The Moore-Murphy Law: The number of things that will go wrong will double every 2 years.
    18. Re:Sooo.. by hackula · · Score: 1

      So... "Here is what didn't work for me, and you should too!"

    19. Re:Sooo.. by Big+Hairy+Ian · · Score: 3, Informative
      There are a number of things you could try.

      1. Pair programming usually improves coding standards

      2. Code Reviews can promote improved standards

      3. Don't let them maintain code they've worked on before unless it's been round the rest of the team

      HTH

      --

      Build a Man a Fire, and He'll Be Warm for a Day. Set a Man on Fire, and He'll Be Warm for the Rest of His Life.

    20. Re:Sooo.. by Minwee · · Score: 1

      The perversity of the universe tends towards the maximum

      Larry Niven (I think).

      It's a restatement of Finagle's Law, which was first used by John Campbell in the 40s. Niven popularized it up in the 60s, but it was already old by then.

    21. Re:Sooo.. by luis_a_espinal · · Score: 2

      Heh, that raises a question. I often complain about other people's code, it's a typical developer hobby. I can name a lot of companies that produce lousy code, but What companies do you know that produce good, high-quality code? I was depressed to find I couldn't think of many. Maybe Sun before they disappeared, and NeXT, before they disappeared, and SGI.

      The small companies I've worked for have aimed to produce good code. The insurance company where I had my first professional programming job, we aimed to produce good code (and we methodically refactored badly written legacy code inherited from a contractor.)

      When I worked for Citircorp Latin America Division, I remember every development team aiming to have some quality in their deliverables. With other large companies, I've seen teams producing shitty code, but also teams having outstanding performance.

      There are people and teams churning decent work out there. Unfortunately, they get eclipsed by the hordes of code monkeys in which we drown.

    22. Re:Sooo.. by gbjbaanb · · Score: 1

      Sun?! the people who made Java so bad its still got massive security holes in it today.

      No-one makes perfect code, its as simple as that. But if you recognise that the real world and imperfect humans are involved then any code that is maintainable and working can be considered both good and high-quality.

    23. Re:Sooo.. by phantomfive · · Score: 1

      Sun?! the people who made Java so bad its still got massive security holes in it today.

      Good point. But it is readable and a well specified interface.

      any code that is maintainable and working can be considered both good and high-quality.

      Oh no, here you are very wrong, I've had to maintain some very horrible code. Just because I was able to do it doesn't mean it wasn't horrible. It slows you down like walking in molasses.

      --
      "First they came for the slanderers and i said nothing."
    24. Re:Sooo.. by phantomfive · · Score: 1

      I'm guessing you're talking about post-1997 SGI. Certainly they went downhill pretty quick.

      --
      "First they came for the slanderers and i said nothing."
    25. Re:Sooo.. by invid · · Score: 3

      Don't say it's impossible to replace one of your developers. It's so very easy to replace one or all.

      You're a manager, aren't you?

      Of the two outsourced to India projects I'm closely familiar with, one had to be completely scrapped because the code was unusable and the other had to be fixed requiring delays that doubled the original schedule. Good code is hard, even for China and India.

      --
      The Moore-Murphy Law: The number of things that will go wrong will double every 2 years.
    26. Re:Sooo.. by AuMatar · · Score: 2

      I don't find constant pair programming improves standards. I find it slows development to a crawl while leading to developers who are either mentally checked out or goofing around most of the day. Or depending on your developers, arguing over inanities. Or they just leave- I wouldn't stay at a job where I was going to literally have someone standing over my shoulder telling me what to do all day.

      Code reviews are good, but you have the same problem as the OP does- you have to convince people not to half ass them. Its quite easy to fall into either rubber stamping (especially if you're busy), or arguing over trivial matters. Like any other tactic it takes people committed to quality and getting things done to make it work.

      In the end, there's no substitute for developers who take pride in their work. You either have them or you don't. If you can't convince them to start taking it, no tool or technique will improve things.

      --
      I still have more fans than freaks. WTF is wrong with you people?
    27. Re:Sooo.. by lsatenstein · · Score: 1

      So.. you are saying good code equals company goes bust? Straps on flameproof suit and helmet...

      ===
      Good code means the programmers go bust and out of work. The company thrives due to low support costs.

      --
      Leslie Satenstein Montreal Quebec Canada
    28. Re:Sooo.. by cwsumner · · Score: 1

      Don't say it's impossible to replace one of your developers. It's so very easy to replace one or all...

      That is what managers have to say to employees. But no manager should ever fool themselves into believing it is true!

      More than one company has died because of this...

    29. Re:Sooo.. by sjames · · Score: 2

      In a sense. When a development staff are happy, working normal hours, and cranking out quality code, the management from newly minted MBAs on up to the CEO all have a single thought: "If I squeeze hard enough, I can get a few more nickles out of that department for my bonus check". So they decimate the workforce and rattle off platitudes like "work smarter, not harder" at an ever increasing rate. They set "stretch goals" but punish people severely for not meeting them. They demand shorter deadlines and more bullet points. They push out senior people and bring in fresh (cheap) grads.

      At this point, the company is doomed to fail.

      There is another scenario that might play out in other corporate cultures. In those cases, other managers see the great success and want to get the credit for themselves. So they descend upon the successful projects and mark their territory (in pretty much exactly the way dogs do). Unfortunately, being a pack of ham fisted morons, they destroy everything they touch.

  2. Easy by Anonymous Coward · · Score: 5, Funny

    1. Higher Pay
    2. Good Management
    3. Beatings

    Pick any two.

    1. Re:Easy by Savage-Rabbit · · Score: 4, Funny

      1. Higher Pay
      2. Good Management
      3. Beatings

      Pick any two.

      4. Hire the consultant in China who did such good work for that cat video guy

      --
      Only to idiots, are orders laws.
      -- Henning von Tresckow
    2. Re:Easy by boundary · · Score: 1

      Just beat them twice.

    3. Re:Easy by Cryacin · · Score: 2

      All I would need is a hammer, two nails per developer, a roll of duct tape for every 3 developers a carrot and a monkey wrench. Oh yes, and the development floor to be on international waters.

      Easy!

      --
      Science advances one funeral at a time- Max Planck
  3. JackBlack Strippers by Anonymous Coward · · Score: 1

    Strippers and blackjack

  4. Send them to North Korea by Anonymous Coward · · Score: 1

    Make good code or no rice.

  5. Stop pissing in the wind by Anonymous Coward · · Score: 5, Insightful

    What you have just described is what happens when Management does not see value in what you do.

    To them, you are just an interchangeable cog. Like, the brand of air conditioner in the office. Or the janitor. It has no bearing on their success and they don't really care what you think about anything.

    The way they see it, if you don't do your job, they'll just replace you with something else.

    Your best bet is to leave. And do as little work as possible in the meantime.

    1. Re:Stop pissing in the wind by NevarMore · · Score: 4, Funny

      Like, the brand of air conditioner in the office. Or the janitor.

      My father was an air conditioner and put me through college you insensitive clod!

    2. Re:Stop pissing in the wind by Austerity+Empowers · · Score: 5, Insightful

      I view management as cogs too, they are fairly interchangeable, and on their own worthless. Put them all together in a bag and you get a percussion instrument. Percussion instruments are essential to music, and you can bang on them with sticks or mallets.

    3. Re:Stop pissing in the wind by Anonymous Coward · · Score: 3, Insightful

      Other than doing as little as possible, I wholeheartedly agree.

      You should work hard while you're there though, if for no other reason than because doing things the right way in the wrong environment is really, really hard and you'll learn a lot. Properly made code doesn't interface well with awful code, but it's a task you'll have to do at least occasionally for as long as you're a developer. Being good at that is an invaluable skill.

      It's also nice to not feel awful about what you left behind, if you're the kind saddled with a conscience. Do it without complaining uselessly (you also shouldn't just hoof out the door without at lest trying to change things if you like where you're at), and you might even be remembered well, which is a really good thing when the economy shits itself as it occasionally does, or if somebody you worked with and respect later has an opportunity to recommend you for a better position.

    4. Re:Stop pissing in the wind by Anonymous Coward · · Score: 1

      You must be used to working inside the bowels of large monolithic corporations because I have not encountered anything like what you say. Working for smaller organisations I've discovered that if you can prove that you excel at your job then people will trust you and what you say, and you can gradually affect change. As you move through your career and are employeed at more and more senior levels this only becomes easier as you start to be employed precisely [i]because[/i] people want you to lead change and drive innovation. Of course, you also have to go in with your business hat on and realise that you can't change everything over night and probably can't down tools for months at a time to bring everything up to scratch as the business still needs to make money.

      Everytime I hear about this interchangeable cog stuff it's always followed by "so do as little as possible, collect the paycheck..." etc. This makes me think this is precisely the attitude that makes you unable to affect change. I wonder if either a) The person saying it has not very much experience and is jaded by the one or two places they've worked, or b) May well be experienced but is not actually very good and has been middling in the same job for 20 years wondering why nothing changes and is jaded by that. Of course, I'm sure there are places such as you describe as well, but there [i]could[/i] be other reasons for your own effectiveness at pushing for, and affecting, changes.

    5. Re:Stop pissing in the wind by gwayne · · Score: 1

      Bender, is that you?

  6. You are doomed by Stirling+Newberry · · Score: 5, Insightful

    It is very clear that your company is a typical feature and marketing driven morass. What happens is you flog yourselfs until something goes horribly wrong, a bunch of people are fired. Then there is a new director of technology, who gets a ground up rewrite approved to enter some new space, and the cycle of accretion and feature creep starts all over again. So advice? Polish your resume or make good friends with who ever will run the purge when it happens.

    1. Re:You are doomed by Asmor · · Score: 1

      > I am not sure the purge is going to happen soon - revenue wise we are growing better than our estimates, and the overall sentiment in the camp is positive. That means the company as a whole is doing a lot of things right.

      Well, it could also mean that your company is a little tiny bubble waiting to pop.

      Or you could be right.

      I know less about economics than I do about your situation. I just like to point out flawed reasoning. :) Cheers!

    2. Re:You are doomed by Manfre · · Score: 2

      If you have buy in from management, then you have a decent chance of improving things. It's hard to give feedback without knowing what workflow stuff you have in place, so here are a few generic things that might help.

      - Get approval for time and resources necessary to set up an automated build environment for deployment packaging and also running tests on every commit. The unit tests should report test coverage to give you a metric to track progress over time.
      - Enforce a policy where an issue cannot be truly resolved without code review and test coverage.
      - Devote a percentage of team time toward code review and unit test retrofit.
      - Document whatever policy decisions are made.

    3. Re:You are doomed by gregor-e · · Score: 1

      Culture flows from the top. So long as software quality is constrained by arbitrary sales deadlines, your problem will not go away. The only way out of this mess is for management to buy into the value of quality and to insist on it, over the screams of marketing and sales. It is also a function of your customers. In many industries, customers will be ticked off for a while if you ship their product late, but if you ship them a brick, they'll never forget. Perhaps you are 'blessed' with more forgiving customers. In which case, your best optimization for the situation will be to polish up your resume and jump ship at your earliest convenience.

    4. Re:You are doomed by Splab · · Score: 2

      Not necessarily; had the same problems described by poster in former work place. We solved it by locking down commits, bug reports and had the database guys drive development.

      No development was allowed without a bug/feature request, no commits where allowed without a bug reference. Database guys made the calls since the company money where in their domain.

      In the beginning there was a bit of unrest, but the rest of the crew quickly realized it was actually really nice to know exactly what went where and why. When you got the processes down and you can show improvement, then you go ask the big guy for more money to do proper test driven development.

    5. Re:You are doomed by bikin · · Score: 2

      How I wish the parent were wrong, but he is dead on the spot. Unfortunately, unless you can convince someone up the chain that quality matters, you are going to keep in state forever. Quality is not free, though the returns outweigh the costs. I can assume that the OP just gets a request get M features in N time, when it will certainly take 2N to create the features, and there is no way to either change M or N. So my advice is the same, just polish your resume.

    6. Re:You are doomed by MadKeithV · · Score: 1

      Thanks, we are trying to follow some of your suggestions already. We already mandated code reviews, but now we are going to reduce the size of the group who can approve that the code is good to go.

      What specific knowledge would make you give more specific feedback? I'll list something here:

      1) We recently moved enterprise github and use pull requests for code review. We have setup jenkins for continuous build. I have setup sonar on jenkins for static code analysis and unit test coverage, but no one uses that right now (except me, to lament :-( ). That jenkins will soon deploy to nexus, so building our application becomes easy from anywhere. 2) We currently release as we finish the change, but are going to move to once a week release train model in less than a month. 3) We have QA and Pilot (1% release) checks before release rolls out 100%.

      Note that it is very difficult to set policies which doesn't have loopholes. Our goal is to do this without severely limiting freedom - evoking the feeling that we don't trust them doesn't look like a good idea.

      That reads like the toolkit version of "buzzword bingo" - indiscriminately throwing everything and the kitchen sink at a problem and hoping it'll solve itself. It could also be "methodology-du-jour". None of it guarantees you're solving your actual problem. "We've mandated code reviews" - sure - but are they actually finding useful issues and improving "software quality" (as ephemeral as that is to define)?
      If a release gets through QA, can you sleep soundly at night knowing it got past the most bastardly testers the universe has ever known?
      If you can't answer "yes" to those questions, do you still think those tools improved your quality? Do you still think adding yet more tools would improve the situation?

      You say you are worried about "loopholes", and are worried about trust. If you're worried, I would bet that there is already a hostile, potentially toxic development environment, and it might be that environment causing the (perceived) lack of "software quality". If people are looking for and exploiting loopholes in the rules, that's because they think the rules are stupid and not helping them to do their job. More rules / tools / buzzword bingo will make that problem *worse*, not better.

      You'd do well to talk to everyone first to figure out:
      a) If they actually think their own code is bad. You might be surprised and find they hate the code they write, BUT
      b) If they do, ask them why they can't write better code in the current circumstances.

      Like others have said, if the devs do NOT believe their code is bad things get difficult, but for your own sake, make DAMN SURE that the problem is not you before going any further!

  7. This does not bode well. by Anonymous Coward · · Score: 3, Insightful

    Your inability to proof-read the text of your submission does not give me hope for your team. ("I am part of engineering team...", "...non-existant...", "...we would can eliminate...")

    1. Re:This does not bode well. by DNS-and-BIND · · Score: 2
      That's the editor's job.

      Yeah, on Slashdot...I crack myself up. Editors!

      --
      Shutting down free speech with violence isn't fighting fascism. It IS fascism!
  8. Create a presentation by eksith · · Score: 5, Insightful

    Of how much time and productivity is being wasted on inadequate practices and how much you'll improve your product, discover bugs faster and generally innovate with your improvements. Worst case, you'll need to do a shame trip on a few egregious offenders (pick their work and try to exclude names) and show how you'd do things differently.

    The benefit from your improvements must be obvious, immediate and beyond reproach.

    Fair warning: You cannot change the mind of management if they're more worried about maintaining the status quo. A very likely issue, if it's been this long with no improvements. All of the above will only work if your 2-3 people have any position of authority within the company. In my experience, the old-dogs don't want to or can't change, in which case you'll be on your own.

    Of course, you will also earn the ire of those around you if it's that type of atmosphere. People fear change when they're not the ones doing the changing.

    --
    If computers were people, I'd be a misanthrope.
    1. Re:Create a presentation by eksith · · Score: 1

      Who said anything about PP? And it isn't a waste of time to build a big picture of exactly what's needed, what needs improving and what needs weeding out. If they don't know what to change, how will they change?

      --
      If computers were people, I'd be a misanthrope.
    2. Re:Create a presentation by Anonymous Coward · · Score: 1

      Management loves powerpoint - changing the delay between slides is almost like programming to them. Makes them feel like productive, contributing members of the department. Powerpoint is the right solution, methinks.

    3. Re:Create a presentation by ahabswhale · · Score: 1

      I agree but I think the presentation needs a lot of concrete examples of wasted money. Technical debt is very expensive but most managers don't really understand it and how it impacts their schedules, competitiveness, and the bottom line. All they know how to do is count features but they really need to understand software development more so they can make more informed decisions.

      --
      Are agnostics skeptical of unicorns too?
  9. Is it too late by bobstreo · · Score: 3, Funny

    to outsource your work to someone in India giving you time to peruse Reddit?

  10. Learn how to code yourself by NetNinja · · Score: 1

    You will never convince your team to write better code if you cannot review thier code and throw it back in their face.

    Also your QA person should be slapping thier dick in the dirt.

    1. Re:Learn how to code yourself by smhsmh · · Score: 1

      You might convince a team to write good code simply by trying to convince them to write bad code, provided you can obfuscate you efforts sufficiently so what you encourage is plausible.

      Herding cats...

  11. Do you maintain your own code? by alvinrod · · Score: 2

    Do you maintain your own code? If it's as bad as you say it is, it shouldn't take much to convince everyone to improve the quality. Otherwise, try to start small. See if there's a really tiny project where you can try to implement some good practices. Make sure you document your process, and record some basic metrics (e.g. time spend developing, defect density, time spent fixing said defects, . Once you've done that, compare it to some of the other projects that have been done. If the results are good, you'll have a lot easier time selling it to management and to the rest of the team. And don't expect things to change overnight either. Successfully implementing change is a process unto itself and something that can take a while to do correctly.

  12. Hi, I'm In QA by cosm · · Score: 4, Insightful

    Hopefully you have a QA team...if your project is large enough and you do not have a QA team, consider proposing the concept to management. Proper controls and planning on unit test, functional test, system test, solutions test, things like that are all really required to help keep large, multi-developer projects in check, especially in this day and age of migrant coders, on-and-off contractors, and out-sourced-then-imported coding jobs.

    Having strict thresholds as to allowable defects per release, enforced feature regression guidelines, expected/projected pass/fail rates per test case, etc. can all be very useful if used PROPERLY to improve code quality. I highlight properly because some managers misuse metrics as the final yardstick of worth of employees, when at the end of the day it is much more complex than developer a fixed X defects or tester Y passed Z test cases this week. Implement proper code reviews, have a consistent and formal process for testing, finding defects, defect resolution, targeted releases. Have your QA devise up with your strategies, test plans, test cases, have them cross-reviewed, and start testing cycles based on release cycles.

    If you aren't doing any of the above, imposing some of what I mentioned is sure to have a positive impact on subsequent quality. If your code sucks, it will reflect your team, your company, your management, and your bottom line in the long haul (IMHO, YMMV, IANAManager).

    Signed,
    Your Friendly Neighborhood QA Tester

    --
    'We are trying to prove ourselves wrong as quickly as possible, because only in that way can we find progress.' RPF
    1. Re:Hi, I'm In QA by Ichijo · · Score: 1

      And give the QA team enough authority to prevent buggy releases.

      --
      Any sufficiently unpopular but cohesive argument is indistinguishable from trolling.
    2. Re:Hi, I'm In QA by Anonymous Coward · · Score: 4, Interesting

      yfnqat,

      Everything you wrote is correct and well taken. However, all the things you bring up are not nearly sufficient, and I would argue they are not even the most important. As an analogy, during the '60s, '70s and '80s Detroit automakers developed a reputation for shoddy workmanship. But they did spend a lot on quality control - tons of workers were assigned the job of "reworking" botched vehicles that came off the assembly line. And their dealers learned to do their own fix up work before moving vehicles onto the showroom floor. During the '80s, after the Japanese and Germans started kicking Detroit's butt, a slew of quality consultants came along with essentially the same recommendations:

      1. Mistakes have to be caught EARLY in the process, when they can be corrected in a cost-effective manner, not LATE
      2. Vehicle design and manufacturing have to be better engineered to reduce the incidence of errors introduced during assembly

      In other words, testing is important, but good architecture is much more important. Without good architecture you are doomed to running a treadmill to keep the bugs out as the code is churned for feature development and maintenance.

    3. Re:Hi, I'm In QA by PCM2 · · Score: 1

      Hopefully you have a QA team...if your project is large enough and you do not have a QA team, consider proposing the concept to management

      I worked for a company that had a QA team. Basically, the presence of the QA team was seen as confirmation that every engineering decision was right and correct. Never mind that nobody ever listened to what the QA team said. The fact that they were allowed to speak up at meetings was proof that everything we did had "passed QA."

      --
      Breakfast served all day!
    4. Re:Hi, I'm In QA by Anonymous Coward · · Score: 2, Insightful

      No. Please god NO.

      QA is not the Release-Police and shouldn't _ever_ put themselves in the role. QA's role is to tell you that something _is_ a buggy piece of shit, that Devs have been too stressed, that planning didn't go into architecture, and that all the "Crunch" is going to come back and haunt twice over.

      QA can have the role of saying that something stinks, but should also be able to tell you _where_ and _what_ and in some cases _how_ it stinks.

      However, QA should not be able to say "We won't release this piece of crap" because if QA starts doing that, QA will be opposed to release and Management, thus QA will never be allowed to do a good job. QA will then be the dreaded guys of white tape or code-reverts, and you don't want that either.

      What you want is to have a QA team that are your friends. Not the roadblock to release. Even if you're trying to release a steaming pile of pig manure in the shape of IE6.

    5. Re:Hi, I'm In QA by Hognoxious · · Score: 1

      Having a QA team that have to approve everything is a total waste of time & money.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    6. Re:Hi, I'm In QA by Comrade+Ogilvy · · Score: 1

      In the long run, a QA team matters only a little unless the C-level executives care. There will always be abundant short term (and short-sighted) incentives towards steamrolling over the QA. It is the CEO who must set expectations here -- you cannot expect water to flow up hill.

    7. Re:Hi, I'm In QA by Ichijo · · Score: 1

      What you want is to have a QA team that [is] Not the roadblock to release.

      Then how can they "assure" the "quality" of the released software?

      You're thinking of software testers, not QA. There's a difference.

      --
      Any sufficiently unpopular but cohesive argument is indistinguishable from trolling.
    8. Re:Hi, I'm In QA by toddestan · · Score: 1

      The problem is that companies give lip service to the whole idea of QA being able to stop a release that's not up to standards. Except that when QA tries to actually do just that, they just get slapped down and the release goes out anyway. Once that happens the damage is done and after a few times no one takes QA seriously anymore.

  13. GIve them a sense of ownership by brainstyle · · Score: 5, Insightful

    People do amazing things when they feel like the thing they're creating is an extension of themselves. Far more than any engineering process or philosophy I've seen, the best work I've seen in my career is from people who identify strongly with their work.

    --
    "Why can't everyone just be straight with me?"
    "Because we live in a bendy world, dear."
  14. You must convince both management and developers by bbbbryan · · Score: 1

    Figure out who stands to gain, and convince them. For management, try two tactics in the sales pitch: 1. Better customer experience (seeing fewer defects) due to higher quality code. 2. Faster and more predictable creation of new features due to higher quality code (after the investment in the needed changes) which should improve business results over time. If these fall on deaf ears, then play hardball and say that without some investment in the code base the code will become unable to support the business, and the business will not be able to continue. It takes a while to get here, but it does happen. In parallel, sell these changes to the development team so that they welcome instead of resist the changes. Make sure the dev team is part of deciding and implementing these changes. I expect that most developers would welcome the changes you suggest. If not, perhaps they would fit better in a different environment that required less disciplined software engineering practices.

  15. Just like snipe hunting by narcc · · Score: 4, Insightful

    Get your team to write "Good Code", eh?

    Does your team write bad code? Do they think that their code is bad?

    Why do you think that your team writes bad code?

    I'll bet a nickle that the problem isn't your team. I'll bet that you're the type to write a factory factory factory under the banner of "flexibility" and not understand why everyone groans at your "superior" code.

    1. Re:Just like snipe hunting by codepunk · · Score: 1

      This is one of those times when I wish I had mod points. "spot on my friend, spot on"

      --


      Got Code?
    2. Re:Just like snipe hunting by engun · · Score: 5, Insightful

      Your comment assumes that the person who criticises bad code is always a factory factory factory guy but fails to take into account that there IS such a thing as good code and bad code. The OP has outlined the reasons for why the code is bad - such as buggy releases, lack of test coverage etc. That indicates that the code or process is bad, somewhere.

      Over-engineering is a problem yes, but just as commonly, under-engineering/non-engineering is an equally big problem. Both lead to bad code.

    3. Re:Just like snipe hunting by Marxdot · · Score: 1

      Unfortunately it may be the other way around. Worst case scenario: they're all FactoryFactoryFactoryFactoryFuckers.

    4. Re:Just like snipe hunting by junglee_iitk · · Score: 3, Insightful

      GP is part of the problem. For people like him/her, it is not about good code or bad code, it is about 'my way or the highway'.

      Calling someone "factory factory factory guy" without any basis is how you get mod points on Slashdot without being correct. For all one knows the submitter might be exact opposite.

    5. Re:Just like snipe hunting by maxwell+demon · · Score: 1

      1) People check not null against ResultSet.getInt() in JDBC (to check if a nullable Integer column is in fact null or not), when it can never return null (and checking for 0 is also wrong because it might be a valid value).

      So your complaint is that they add checks for something that shouldn't happen?
      You know, in C there's even a separate header for this type of checks: <assert.h>

      3) Many objects have a getJSON() function where we create JSON by hand (using string constant and +s). And this is not a debug string - these go into our server logs, which are parsed downstream by hadoop jobs.

      I don't see any problem with that. The method name already says that it creates a JSON string, so it cannot be a case of missing flexibility (a method named getJSON that generates anything which is not JSON would be stupid). And as long as the JSON string generated is correct, then why not generate it directly?

      Indeed, over abstraction can be detrimental as well. If there's a bug, and you have to seek for hours just to find out where the actual code doing the work sits, there's something wrong.

      5) We have some encryption and decryption in our workflow. The classes which have have the encryption/decryption algorithm have a lengthy init, but don't maintain any state. Yet we create a new object of that class for every request in our server.

      If the class doesn't maintain any state, then what is the lengthy initialization for? Maybe the problem is in the design of that class instead.

      --
      The Tao of math: The numbers you can count are not the real numbers.
    6. Re:Just like snipe hunting by rjstanford · · Score: 1

      Somewhat agree...

      The OP has outlined the reasons for why the code is bad - such as buggy releases, lack of test coverage etc. That indicates that the code or process is bad, somewhere.

      Buggy releases are a good sign that there's a problem (assuming that the bugs actually are significant in impact, of course). Lack of test coverage though is a symptom that may explain how bad releases happen, but is not in and of itself a cause of bad releases or bad code. I've seen plenty of truly poorly written and unmaintainable code that had 100% test coverage (although the tests were often testing the wrong things), and plenty of nice, clean, maintainable code that didn't have tests associated with it (at least partially because it'd be factored down to simple, understandable methods that "didn't need" comprehensive automated testing because, once written (to do one thing with no side effects at the same internal mental level) they were rarely if ever touched and the extra (small but significant) time to spend writing tests for mostly write-once code would have been a bad business decision.

      Having said that, there's plenty of time that developers (myself included) should have better, smarter test coverage. Automated unit and integration tests are amazingly useful - but they're not the end-goal of software development, just another tool in the belt.

      --
      You're special forces then? That's great! I just love your olympics!
    7. Re:Just like snipe hunting by rjstanford · · Score: 1

      Though not helpful, I will give you examples of code issues (Java):

      I wouldn't actually call most of these code issues.

      1) People check not null against ResultSet.getInt() in JDBC (to check if a nullable Integer column is in fact null or not), when it can never return null (and checking for 0 is also wrong because it might be a valid value).

      This is an actual code problem. Start a pattern of using a result set wrapper or a utility library so that people don't have to keep remembering to use wasNull().

      2) People acquire a lock before try catch block (where catch blocks rethrow exceptions), and don't release it in a finally block.

      Another problem although thankfully one that's fairly easy to mitigate (manual locks are generally although not always fairly rare and can trigger manual code reviews; if this is a major problem then a lock wrapper can be used that releases locks when its going out of scope, etc).

      3) Many objects have a getJSON() function where we create JSON by hand (using string constant and +s). And this is not a debug string - these go into our server logs, which are parsed downstream by hadoop jobs.

      This, I don't see as a problem and and of itself. The function is completely self-contained and its implementation can be ignored by all users of the class. Its possible that it does things that using a JSON library would be annoying about, like sometimes trimming/masking certain strings or making sure that the output text is always in a consistent order - also, while adding annotations to internal attributes/methods to indicate inclusion/exclusion is a good idea, if the output is intended for a specific consumer rather than general use and the formats are basically fixed, putting all of the logic into one method may be ultimately cleaner.

      If those aren't the case, its also something that can be trivially refactored from inside the classes.

      4) Inside a class we assume the member is immutable, whereas one of the getters returns a mutable copy of that object.

      That's a problem alright, but probably easier to fix then to complain about, no?

      5) We have some encryption and decryption in our workflow. The classes which have have the encryption/decryption algorithm have a lengthy init, but don't maintain any state. Yet we create a new object of that class for every request in our server.

      Also not a code issue IMO - sounds like a well abstracted design. If long-lived utilities are more efficient, then the injected/instantiated class can be modified in one place to do whatever state management is needed and the users of the utility should never notice anything other than a speed improvement.

      We know this because when we work on some of our code, we try to "update" to a higher quality standard, and have found such issues and fixed them.

      And how long did that take? What risks were introduced in touching code that worked? Were those areas also identified to QA to test independently of the documented issue that was being worked on? Refactoring code that's regularly modified and frequently triggers bugs really pay off, but that doesn't mean that the refactoring is "free" either in time or risk. Sometimes even performance tuning a heavily relied upon piece of code, such as an encrypt/decrypt routine, wouldn't be worth it if the refactoring introduced even a single production issue, whereas throwing more hardware at the problem is fairly safe. Development shouldn't be making those decisions in a vacuum without understanding the business implications.

      --
      You're special forces then? That's great! I just love your olympics!
    8. Re:Just like snipe hunting by engun · · Score: 1

      Agree with what you say a 100%. To me, and correct me if I'm wrong, tests are mainly about a means to automate testing I might otherwise have had to do manually. Beyond that, I see the law of diminishing returns hitting back too hard - and the overhead of maintaining test code more onerous than maintaining the original code itself.

  16. Yes a LOT more QA is needed also out side the box by Joe_Dragon · · Score: 2

    Yes a LOT more QA is needed also out side the box testing needs to be done do not just have auto tests they are easy to code to pass them while failing big time.

  17. Get management buy-in... by mooingyak · · Score: 1

    Get management buy in, and have them pad your estimates to allow a little bit of code rework in each release cycle.

    If that fails, lie about your estimates and use the extra time to rework the code in each release cycle.

    --
    William of Ockham had no beard. The most likely explanation is that it was chewed off by squirrels every morning.
  18. My suggestion by damn_registrars · · Score: 2

    Show them this lousy website and tell them that is what happens when your company propagates lousy code - your existence goes to pot and your company is sold for very little money to a larger company who also doesn't care.

    That should scare them straight.

    --
    Damn_registrars has no butt-hole. Damn_registrars has no use for a butt-hole.
    1. Re:My suggestion by Ash+Vince · · Score: 1

      Show them this lousy website and tell them that is what happens when your company propagates lousy code - your existence goes to pot and your company is sold for very little money to a larger company who also doesn't care.

      That should scare them straight.

      Maybe instead of just bitching about it uselessly you could actually do something useful. Go here and help fix the awful slashdot code: http://slashcode.com/www.slashcode.com/

      After all, it is an open source project like any other.

      --
      I dont read /. to RTFA, I read /. to offend people in ignorance.
    2. Re:My suggestion by damn_registrars · · Score: 1

      Maybe instead of just bitching about it uselessly you could actually do something useful. Go here and help fix the awful slashdot code: http://slashcode.com/www.slashcode.com/

      After all, it is an open source project like any other.

      An open source project is an open source project, except when it isn't. Have you looked at the last release date for slashcode? Right on the page it reads

      The public Slash repo has not been updated in awhile

      And that is from a message dated 02:01 PM October 1st, 2009, written by someone who no longer works for slasdhot.

      In other words, more than three years of changes have been made to the code since the last time it was released on that site. Making changes to that would be like suggesting new extensions to Microsoft for Windows XP.

      --
      Damn_registrars has no butt-hole. Damn_registrars has no use for a butt-hole.
  19. you don't know what the goal is by rubycodez · · Score: 1

    the goal is to remove as much money as possible as soon as possible from customer's pockets and to put it in the pockets of your senior executives and stock holders. now shut the fuck up, quit jacking off on company time whining on slashdot, and get that shit shoveled out the door!

  20. Seek employment elsewhere by Anonymous Coward · · Score: 1

    Look for another job and be vocal about it. This is one of those cases where you have to be selfish and look after your own interests. Get your co-workers to do it too.

    There are three possible outcomes and they all have upside for you.

    1. They pay attention and fix things
    2. You leave and get a better job
    3. They fire your ass and you get a better job

    Clearly your present position is not advancing your career. Your future as a developer is mired in the same muck as your code.

  21. Start a new company, its the only way. by j-stroy · · Score: 1

    Embed your culture in a fresh structure. Your core team will have high ideals. Your new hires will be ambitious. Overvisioning will force you to cut corners to keep your first contracts and meet milestones so that everyone has a job. You will move forward with the intention of a version rewrite that addresses the hacks. New hires will question the legacy BS, Rinse, Cycle, repeat.

  22. Start small and do it in stages. by ralphbecket · · Score: 5, Informative

    (1) Code reviews. At first, just get 'em to grab a passer by to look at their code prior to check-in. If the PB cannot understand what they've done, they haven't finished the job. Later on you can upgrade to more stringent reviews, but the first thing is to get *some* reviews happening *at all*.

    (2) Comments and (some) documentation. You need to lead by example. This stuff isn't optional.

    (3) Unit testing. If your code base is a pig, you'll need to start somewhere and begin teasing out the "bits that think" (easier to UT) from the "bits that talk to things" (these are harder to UT and you can get away with integration testing here until you're in better shape). Unit testing is a skill anyone can learn. Sack 'em if they refuse to do it!

    (4) Simplify your processes and your architecture where possible. Avoid trendy bandwagons. If the obvious thing works and is maintainable, then that is probably the best way to go.

    1. Re:Start small and do it in stages. by coofercat · · Score: 2

      (5) Longer time-scales (at least for a time)

      If you're being hot-housed, you get something that ostensibly works out the door, and "to hell with the unit tests". I someone told me "I need X in a week", I'd just hash together any old crap that essentially meets the requirements. If they told me "do it as quickly as you can, let me know when it's done", then I'd probably spend a bit more time planning it out so that I could make a better job of it, and be reporting my progress along the way.

    2. Re:Start small and do it in stages. by laffer1 · · Score: 1

      Code reviews are great for developers early in their career. I think they can be insulting to mid to senior level people. I've seen shows force code review on every commit and it turned into a giant backlog of code reviews. You can't add the extra work of code reviews without adding developers or lowering the work load. They take time.

      Like anything, it has to be done correctly.

      I'm not suggesting that code review can't be useful to older programmers, but it has to be done delicately. It also can't be arbitrary criticism because you don't like someone's style.

    3. Re:Start small and do it in stages. by ralphbecket · · Score: 1

      I don't know why you were down-voted (well, other than this is Slashdot where egos are fragile things).

      I completely agree: I want my code to be reviewed for two reasons. First, a second pair of eyes invariably catches a problem I've missed, even if it's not having adequately explained my code. Second, I want to show off how cool my code is and set a target to aim for :-)

    4. Re:Start small and do it in stages. by ralphbecket · · Score: 1

      You must know some astounding programmers. I've been doing this for thirty years, I've a PhD in the subject, and I still grab people to review my code (wherein they often find something to fix). Maybe your experience of code reviews has been adversarial? They shouldn't be like that at all.

  23. Quit and work somewhere else by cryfreedomlove · · Score: 1

    You sound like a smart person who wants to be surrounded by great colleagues. There is a tremendous shortage of computer science talent nationwide. You don't have to work for a company that 'does not get it'.

  24. Act on your own initiative, and beg forgiveness... by Lodragandraoidh · · Score: 1

    I've had great success acting on my own initiative and begging forgiveness afterwards.

    That being said, the bottom line is I was able to show marked improvement. If your tools and processes have no tangible benefit - then I'm sorry, but you're going to have to pay the price for your insolence.

    --

    Lodragan Draoidh
    The more you explain it, the more I don't understand it. - Mark Twain
  25. Do the following: by Anonymous Coward · · Score: 1

    1. Write the worst code you possibly can.
              - Unnecessary subclassing and then reference methods or functions from two or three or four subclasses away.
              - Use variable names that don't reflect the values that hold them
              - Use as many classes as possible
              - Make the code as fragile as possible, use threading if possible avoiding mutexes
              - Make a lot of files that do very small things
              - Put large blocks of untested code that only run once a day.
              - Implement large data structures two different ways and then write fragile translation code to transform one object to another
              - Create an api that requires it's own processing loop completely incompatible with other processing loops.
              - Declare the current language insufficient for your task and rewrite everything in lisp.

    2. Leave and start a new company

    1. Re:Do the following: by c0lo · · Score: 1

      1. Write the worst code you possibly can.
      (long list)

      Used to be quite easy in the past. With C, you just needed let your pointer variables uninitialized or free twice the same memory.

      --
      Questions raise, answers kill. Raise questions to stay alive.
    2. Re:Do the following: by smellotron · · Score: 1

      Write the worst code you possibly can.
      <useful context snipped>

      Used to be quite easy in the past. With C, you just needed let your pointer variables uninitialized or free twice the same memory.

      What do you mean? Do you mean that C is a dead language, or that these problems no longer occur in C languages? Or maybe you mean that the types of developers who frequently had uninitialized-variable or double-free bugs no longer use C? The GP's list is all about bad data-structure design, and that can be done equally well in all languages. Maybe you're joking with the C comment, but I don't see the humor in inaccuracy—and I think it detracts from an otherwise excellent list of ways to totally screw with your maintenance programmers.

  26. Bribery and Punishment by vinn · · Score: 4, Interesting

    Ok.. those are strong words in the subject, but inducing a culture change quickly is something you can incentivize. I'm not sure of your particular situation, but here's two ideas:

    1. Bribe them. Companies usually call this merit based bonuses. Break the goals of the team(s) into individual goals. If a particular module is due to be rewritten for the next release, then pay a bonus if it gets done correctly and on time. If it's not done correctly, don't pay the bonus. If it's not on time, don't pay the bonus. With regards to it being "correct", that falls into the next item..

    2. Punishment. If the code sucks, don't commit it. Force the programmer to rewrite it. That even might mean rearchitect it if there was architecture involved. Programmers hate repetition. They will very quickly learn that if they are forced to do something over that they can do it better the first time. If they find themselves working late hours to meet a deadline, perhaps because a bonus is riding on it, they'll get better.

    Most important, make sure your deadlines and features are realistic. Are you sure they are? Are people being sloppy because they feel too pressured? Shipping a buggy feature isn't a feature.

    --
    ----- obSig
    1. Re:Bribery and Punishment by Hognoxious · · Score: 1

      Bugs correlate exponentially with code complexity.

      No they don't.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
  27. Which part of the team you need to convince? by c0lo · · Score: 1

    and we know what needs to change technically

    Which we?

    Is the technical team than need to be convinced? Either you convince the guys to do the right thing (write better code as part of professional pride) or you need to convince the managers to impose doing the things right (i.e. better processes, tools, infrastructure). Did you note the difference between doing the right thing (part of the leadership) and doing the things right (part of management)?

    If it is the management team that need to be convinced, then either:
    a. the cost of lack of quality is greater than the cost of "missed opportunity" (i.e. the cost of not releasing in time). In this case, management should be on your side and be ready to accept an extra investment in setting up the quality system; or
    b. the cost of lost opportunity overshadows the cost of non-quality - in which case your focus on quality may not be the right thing (for the business) and you should consider your position: accept the risk of non-quality and forge ahead to early releases (maybe you'll get enough time to fix the bugs) or not accept it and find for yourself another employer.

    --
    Questions raise, answers kill. Raise questions to stay alive.
  28. QA by DavidClarkeHR · · Score: 3, Interesting

    Hopefully you have a QA team...if your project is large enough and you do not have a QA team, consider proposing the concept to management. Proper controls and planning on unit test, functional test, system test, solutions test, things like that are all really required to help keep large, multi-developer projects in check, especially in this day and age of migrant coders, on-and-off contractors, and out-sourced-then-imported coding jobs.

    My wife works in QA, and simply having a QA team is not adequate. Yes, it is one more check (or balance), but it's also redundancy that can quickly overwhelm the primary focus of your coding team.

    You need strong leaders in your coding group. If you have strong coders, and they're not strong leaders, think about structuring the work in a way that forces the code into spec. Find ways to develop those leadership attributes, and train the other coders to conform. The nice thing about working with coders is that a structured training program (training, as in behaviouralism) will work - routines, structure and cause/effect (or compulsion loops) are much easier to implement with an emotionally detached, logical group of individuals. You can actually discuss the "training" routine (but don't label it as such) and expect a level of rational resistance to change. Rationality can can be worked with, and in my experience, you don't get people who are much more rational than coders.

    It doesn't have to be a permanent arrangement, and it doesn't have to involve raises. It does have to give your team an opportunity to make the transition to a new way of coding without feeling threatened. Think of it as a clean break from a bad relationship. You can't stay friends, you need a complete change of scenery.

    --
    - Nec Impar Pluribus, or so I'm told.
  29. Well let's see by scamper_22 · · Score: 1

    "Our code quality and general engineering quality focus has been very weak"

    So you want people to write good code on top of crappy code. This is hard for people to do. Just as it would be in any field to fix up crappy work. A carpenter, plumber, artist... will all be demotivate worked on a botched job.

    "and it is impossible for a newcomer in our team to get up to speed and be productive in less than a month due to unnecessary complexity"

    How many newcomers are joining your team that this a problem? Lots of churn in your staff is going to be a detriment to performance. No different than any team based sport.

    Before you worry about details like code reviews... you must get the picture right. Do you value software developers as a skilled profession to train them on the code base, keep members on the team for their knowledge...

    Better still, are you hiring good people? You can't convince me to be a good artist. I can't draw for the life of me.

    After that, focus on quality in new code and components. Provide some time for rewrites of code they really hate.

  30. Here, Let Me Try... by Greyfox · · Score: 1
    *ahem* Write better code or you're all fired! You have one month!

    That ought to work.

    --

    I'm trying to teach myself to set people on fire with my mind... Is it hot in here?

  31. Dollars & Sense by multimediavt · · Score: 4, Insightful

    Yep. You're going to have to make a business case for what you want to do and show management what it will save in $$$ or change will come with much more pain, if at all. You are going to have to argue sensibly and make sense to them in a language that they understand. This should be at most two to three pages covering the nature of the problem, how it can be solved and a budget and/or cost comparison. You want to be coherent and concise without getting into too much detail and three pages is about as much as you can ask a high-level manager to read. You are talking about major process change within the structure of the company. You might think it's trivial (or not), but understanding as much as you can about what effect this has across the board (not just in the software you're writing) will help you make a better case for this kind of change. You will also need to appeal to the bottom line.

  32. Management is not on board - You're fucked by bigsexyjoe · · Score: 1

    What you are describing is a work place that does not follow modern software engineering practices. Management does not see the value in it. It will not devote the resources to cleaning up the code or refactoring. It will not develop training for new employees.

    Of course, two or three of you want to change it. I think "you" are two young people who don't understand that management doesn't care you have an older friend who agrees it could be better (although he understands nothing will change).

    I think it's pretty hopeless but it might be worthwhile to make some effort. You and your friends can put together a pitch to management. Emphasize that what you are suggesting is the orthodox way of developing software these days. Try to keep the things you want simple and practical. You might want to show management this Slashdot article so they can understand the perspective of the software engineering community on this issue. But don't come across too angry and or too radical in your suggestions. Be agreeable, and watch for changes with a cynical eye. Remember management might say they agree with you, but talk is cheap.

    Other than that, I think you need to serve your time where you are at, and then leave for some place better. Listen to lots of podcasts and read lots of articles. Keep abreast with the latest technologies and practices. This will help when it is time to leave.

    You will eventually learn that you can't fix management. You are not in the position to fix everything about your place of work.

  33. Re:From today's TheDailyWTF by TapeCutter · · Score: 5, Insightful

    If as the submitter claims "new people take a month to get up to speed" then either their project is trivial or they are doing something right.

    --
    And did you exchange a walk on part in the war for a lead role in a cage? - Pink Floyd.
  34. Kill the "product guys" by chriswaco · · Score: 1

    Date-driven development is almost always a disaster. The only way it works is to completely finish a reduced feature version of the application, add and test one feature at a time to it, and ship what you have when the date is hit.

  35. TDD by Jane+Q.+Public · · Score: 2

    TDD forces good test coverage, and reduces or eliminates regression errors.

    Also, TDD is correlated with successful, robust software, but code review generally is not. (Unless you count QA as "review".)

  36. Re:Yes a LOT more QA is needed also out side the b by Savage-Rabbit · · Score: 1

    Yes a LOT more QA is needed also out side the box testing needs to be done do not just have auto tests they are easy to code to pass them while failing big time.

    You also need a management that is willing to stand behind the QA team. QA can be a thankless job and when you start trying to teach new tricks to a bunch of old dogs who have gotten away with sloppy work for years it can lead discontent in the ranks. When the QA team starts doing things like limit developer's freedom to do projects in any language they happen to have the hots for at the moment, implement a code syntax checker to enforce coding standards, mandate a set of standard coding tools, make devs write unit tests, make user tests mandatory, throws code back at devs because it failed testing, .... (the list goes on) developers get pissed off and sometimes management folds. You will not change anything until you declare that untested and unreviewed equals unfinished if you really want to piss the developers off you can add the caveat that undocumented also equals unfinished. Just remember that the best way to boil a developer is by turning the QA heat up slowly. Don't make too many changes at once. Another thing about QA is that alluvasudden (according to CS studies) your developers are spending 5+ hours writing unit tests etc. for every 10 hours they spend writing code and that is not always popular with other people within the company who have grown used to them pumping out a lot of code with quality being a fortuitous byproduct of making deadlines.

    --
    Only to idiots, are orders laws.
    -- Henning von Tresckow
  37. My Team has the Exact Same Problem by Anonymous Coward · · Score: 1

    There is too much backlog of work, and despite bringing in new people for the express purpose of improving project management, not much is changing. Our team lead is (understandably) not very enthused about suggestions to improve things, since he is up to his ears in client requests and complaints, and all of us spend all our time barely making our deadlines using the cobbled-together framework we're used to.
    It seems like a self-perpetuating problem... every time we talk about fixing things, it's always "after we catch up on our current projects."

    1. Re:My Team has the Exact Same Problem by nullchar · · Score: 1

      The only solution then is to "fix it as you go" -- thus, each "current project" action must re-write modules or add unit tests or create documentation to slowly dig your team out of their hole.

      You don't have to re-write the entire application, or create huge flow charts showing how everything works, but a little here and a little there, along with some quick code reviews so the "right hand" of the team knows what the "left foot" is doing.

      Good luck!

    2. Re:My Team has the Exact Same Problem by gnasher719 · · Score: 1

      It seems like a self-perpetuating problem... every time we talk about fixing things, it's always "after we catch up on our current projects."

      How do you eat an elephant? One byte at a time.

      Make it a rule: Whenever you make a change, improve _one_ thing. Depending on how bad the mess is, it may actually safe time each time you do it. Remove one static variable. Or one public member. Or one warning that the compiler gives you. Create one header file that should have always been there. And so on, and so on.

  38. Be professional by valentinas · · Score: 1

    Infrastructure, tools, culture.

    Infrastructure: continuous build server, that runs unit tests, continuous deployment to staging servers (and eventually live), github, github enterprise (or equivalent)
    Tools: depending on what language you are working with - there are many great tools to monitor code quality. Good example would be resharper for c#.
    Culture: Get everyone to do pull requests to main repo. No direct committing. Also no merging your own pull requests. Someone else has to do it and while doing it review it. Only give commit access to main repo to trusted people. Give them ability to give commit access to people they trust too. Call people on bullshit code.

  39. It's going to be hard by engun · · Score: 1

    The truth is - unless people realize it for themselves - it's really hard to do. Not every programmer has pride in their code and a genuine desire to learn and improve. Let's say you get approval to rewrite the code and reduce the unnecessary complexity. Most likely, the code will break and you won't know till it's too late. This is because, no matter how convoluted the logic - it would still be relatively debugged code. Rewriting stuff will break things, and without the unit tests - it's really hard to even get a clue where. As a result - people will blame the rewrite for the new bugs - and still never get the point.

    My suggestion is, start with pushing for process and get tests written for existing code. Try to convince people that the reasons for your release problems are the absence of good process and good tests. Explain that tests are a way to automate the drudgery of manual testing and will save time - so that it is comprehensible to management. Once those two are in place - you can safely rewrite the code without breaking existing functionality - thus avoiding being blamed for your "meddling". You can then start pushing for code refactoring next. Eventually - it will be possible to display the tangible benefits of a well-structured code based. It'll be a long hard slog.

    Sometimes though - the people around you are too calcified in their thinking to want to learn or to do things "better". In that case, find another job.

  40. Schedules by boundary · · Score: 1

    It's not just about writing better code. You also need to ensure that you have enough time to do a proper job. Sounds to me like you could do with sorting out your estimation process. If you're running out of time to do a decent job, give yourself more time, or de-scope the delivery. When you get code & test estimates, are you taking into account the fact that your code sucks, so you need to add more time for the rework that is bound to occur?

    A product manager who will never de-scope functionality or move the date for the sake of quality has no pride in his work, and I'd strongly advise against working in a company where such people rule the roost.

  41. Re:Fire your boss. by Cryacin · · Score: 2

    He's not for hire as a perm. He's a consultant.

    --
    Science advances one funeral at a time- Max Planck
  42. Small incremental change by phantomfive · · Score: 1

    How do we effect the social change necessary to convince them of what is better and encourage them to take the effort to do it?"

    Make small incremental changes If you try to make all the changes at once, you have a high probability of failure; both at the implementation level, and at the 'convincing management' level. Choose a small change that has a high probability of success, for example, set up Hudson to do automated builds. When people see benefit from that, they will be more likely to make other changes. One thing at a time. But:

    we have frequent buggy releases,

    This raises a warning flag. Are you adding bugs to the product that get released? If so, you are the problem. First figure out how to write high-quality code yourself. That is your first step, even if you're working on a messy code base that isn't an excuse to make things worse. Don't even think of telling your team what to do if you can't write stable code yourself.

    --
    "First they came for the slanderers and i said nothing."
  43. abstract singleton factory method bridge prototype by Anonymous Coward · · Score: 2, Funny

    I'll bet that you're the type to write a factory factory factory under the banner of "flexibility" and not understand why everyone groans at your "superior" code.

    That is so 2008! These days we've shown that an abstract singleton factory method bridge prototype facade is the only way to go for maximum flexibility! Get with 2013! :-)

    Now if you'll excuse me I have to go write my unit tests for the old factory factory singleton - see how the old way makes it difficult to test!

  44. Bribery by ProfessionalCookie · · Score: 1

    Have you tried making sure they have access to great food and drinks?

    1. Re:Bribery by maxwell+demon · · Score: 1

      Have you tried making sure they have access to great food and drinks?

      With the quality of the food/drinks reflecting the quality of the code?

      --
      The Tao of math: The numbers you can count are not the real numbers.
  45. Have an hour meeting every week by lawpoop · · Score: 2

    My team has an hour meeting every week where we review code, how it could be better, what we can do better next time, how our overall system could change and improve. Instead of ragging on people, we sympathize when they are under deadlines and stress. People were hesitant and embarrased at first, but over time, as we've nurtured a supportive envrionment, people feel free to air their problems and ask for help. Knowing that your teammates truly have your back makes you feel good about yourself want to succeed. Sometimes people will give presentations of design patterns, functional programming, certain libraries, or new technologies like REST. Nothing big and fancy, just enough for everyone to get a handle on it and small enough to digest mentally. I don't know if this can work on every team because IT people seem to have a pandemic negativity and perfectionist syndrome. In the long run this just makes you give up and write crappy code, when you believe everything is futile and worthless when it's not perfect.

    --
    Computers are useless. They can only give you answers.
    -- Pablo Picasso
  46. Wrong focus by Dcnjoe60 · · Score: 1

    You have the wrong focus. Expending your energy to "How do we effect the social change necessary to convince them of what is better and encourage them to take the effort to do it?" will get you nowhere. If you want to improve the code, it is not the programming team you need to convince. You already state that code suffers to meat the deadlines.

    If you want code to improve, you need to convince management of the value of the improved code, so that it becomes their priority. Until they value it, the deadlines won't change and the code will continue to suffer.

  47. Have a programming contest by seven+of+five · · Score: 1

    First prize is a Cadillac Eldorado
    Second prize is a set of steak knives
    Third prize is "you're fired."

  48. Nope by russotto · · Score: 1

    We feel that if the right thing is done every time, we would can eliminate our issues and still release at the same pace.

    Nope. Writing better code generally requires more time. People will try to tell you otherwise, but either they're just off base, or they're confused by the fact that the amortized time of writing good code is less than of writing code as quickly as possible. That is, if you write all quick+dirty code, you reach a point each new feature you add takes much longer than if you had written all good code. However, at any given stage, it's quicker to write the quick+dirty code.

    And of course, once you're in the hole and full of quick+dirty code, it takes extra time to replace it with good code.

    1. Re:Nope by gnasher719 · · Score: 1

      Nope. Writing better code generally requires more time. People will try to tell you otherwise, but either they're just off base, or they're confused by the fact that the amortized time of writing good code is less than of writing code as quickly as possible. That is, if you write all quick+dirty code, you reach a point each new feature you add takes much longer than if you had written all good code. However, at any given stage, it's quicker to write the quick+dirty code.

      Absolutely true. By making the decision that is more profitable _right now_ you get yourself into a hole and eventually you lose out. But since it's code, your managers may not understand.

      Now ask them to compare Dell and Apple. One company did all the right things to make more money, and now it looks like they are up for sale. The other never listened to customers, never listened to stock analysts, never cared about money but only about making great products, and ended up having about $100bn in the bank.

    2. Re:Nope by rjstanford · · Score: 1

      Now ask them to compare Dell and Apple. One company did all the right things to make more money, and now it looks like they are up for sale. The other never listened to customers, never listened to stock analysts, never cared about money but only about making great products, and ended up having about $100bn in the bank.

      Then look at NeXT who did everything "right" and hemmoraged through obscene amounts of money without ever coming close to breaking even. Like many things in business, its about getting the balance correct.

      --
      You're special forces then? That's great! I just love your olympics!
  49. Another vague post - replies will come anyhow by NotQuiteReal · · Score: 1

    "I am part of engineering team that maintains a very important component in our company [we'll let that slide, if your code is that bad and the company hasn't folded yet, it can't be THAT important]. Our code quality and general engineering quality focus has been very weak [don't do that. Even Ford says Quality is Job One, of course they make cars, which can be a lot easier]: we have frequent buggy releases [what? no QA department?], our latencies are shooting up [your code runs slower and slower - or your is taking longer and longer to get out, even without QA(see last)], our test coverage is nearly non-existent [Again, sounds like you need QA/QC tools], and it is impossible for a newcomer in our team to get up to speed and be productive in less than a month due to unnecessary complexity [any non-trivial code will take that long]. A group of 2-3 of us want to change that [out of how many? out of 4? out of 1000?], and we know what needs to change technically — the better code review and release processes, better build tools, etc. But despite that [so, despite knowing the problems, nothing is changed... I think you have answered your question], the quality of our code and design [both?] continues to suffer, and poor code continues to get released in the name of keeping the scheduled release date (product guys don't like to wait) [so, they are on commission, and you are on salary - win-win!]. We feel that if the right thing is done every time, we would can eliminate our issues and still release at the same pace [uh? so do it?]. How do we effect the social change necessary to convince them [who? the "bad" programmers? the "release-it-now" managers?] the of what is better [for who? your workload or their sales commissions?] and encourage them to take the effort to do it? [Similar to Q:How to make a million dollars? (paraphrasing Monty Python) - A:'think of a really, really, good idea, and make a million dollars!']"

    --
    This issue is a bit more complicated than you think.
  50. Money, and recognition !! by Taco+Cowboy · · Score: 3, Insightful

    As one who has plied this trade for decades, I'll tell you that programmers are human beings, just like everyone else.

    We urge for recognition, and we need money.

    You just do not tell us to do what you want us to do without recognizing the hard work we have put into debugging the products.

    And you will not go anywhere if you do not pay us.

    --
    Muchas Gracias, Señor Edward Snowden !
    1. Re:Money, and recognition !! by Maximum+Prophet · · Score: 1

      "What gets rewarded, gets done"

      --- Attributed to Steve Jobs*

      * I'm sure someone else said it first.

      --
      All ideas^H^H^H^H^Hprocesses in this post are Patent Pending. (as well as the process of patenting all postings)
  51. Deja Vu All Over Again. by westlake · · Score: 1
    I thought we went through all this a week or two back.

    it is impossible for a newcomer in our team to get up to speed and be productive in less than a month due to unnecessary complexity

    The miracle worker. The mutant mastermind.

    New to the team, Core component. Mission critical. Up to speed in less than a month?

    A group of 2-3 of us want to change [things]. How do we effect the social change necessary to convince them of what is better and encourage them to take the effort to do it?"

    Who is "them?"

    Your supervisors or your managers?

    More importantly, who are you?

    Not the team leaders, quite obviously, and probably no more than a bare five to ten percent of the team, if that. Unless you have the social skills to build a much broader consensus for change, you'll get absolutely nowhere no matter how good your technical arguments.

  52. Either be engineers or be coders. by MartinSchou · · Score: 1

    In every other engineering discipline I can think of, where the word "engineer" actually means something, releasing sloppy and buggy work means you'll either get fired or sued. Possibly both.

    Think of your products as buildings or structures. They have to live up to certain standards, have to work when they're put up (ever seen someone replace the foundation of a sky scraper after it's been built?) and have to be stable. Or worse - imagine chemical engineers who designed your drugs, or the mechanical engineers who designed your artificial heart were allowed to be as sloppy as software "engineers" are.

    When engineers fail to do their work properly, the fixes are mostly lengthy and expensive, and often have to be paid for by the engineering company, and their products are withdrawn from the market (or buildings and structures closed).

    As long as companies make a rule of flat out refusing to make and schedule engineering quality work, I refuse to consider their employees engineers, regardless of their education or working title.

    If you have a Ph.D in astrophysics, but you work as a janitor, I'm not going to be calling you Dr. either.

    1. Re:Either be engineers or be coders. by w_dragon · · Score: 1

      Go talk to someone actually working as a civil engineer sometime and tell them that. Once they stop laughing they'll probably have lots of stories to tell you about drawings being wrong in hilarious ways, materials having the wrong tolerances being discovered too late and the quick patches they did to fix them, and how all modern construction is done as quickly and cheaply as possible. The difference between their bugs and our bugs? They have a group of people building their structures who can see if something is off during construction. We have a compiler that will blindly follow whatever we tell it to build, no matter how obvious the bugs.

  53. Improving Code by Anonymous Coward · · Score: 1

    The changes that helped our team overcome this were:
    1. Code reviews are required for every single checkin. Establish a minimum standard criteria to meet for reviews, and hold people accountable.
    2. Make a requirement that every code checkin must be accompanied by one or more unit test checkins, otherwise the code review automatically fails.
    3. Our team held contests and offered incentives. This worked especially with the overseas teams in India and China, who were more than willing to write unit tests in an effort to win an iPad.
    4. Reward those who show that they are dedicated to improving code quality.

    Results will take time. It took about a year to see results, but they were HUGE. And that first release after implementing these changes was just the start of several successful releases.

  54. Only Love can kill the demon by BroadbandBradley · · Score: 1

    What you have are people who are apathetic about the quality of their work and who are in-fighting among each other. You already have formed an "Us and Them" (you mentioned that "2 or 3 of us" know what to do) situation which projects negative energy at the them side (works both ways) and further feeds the lack of a cohesive and collaborative space.

    Here's how you fix it, find something beautiful about the people you work with and compliment them on it. Look for the positive in people and let them know what you appreciate about them, love the people around you. Give this positive energy to everyone around you and watch how the situation changes, watch how people feel compelled to connect rather than divide. Resist the covert struggles for energy and maintain your positive focus, eventually you will be surrounded with positive people who will all work well together and good ideas will materialize as if delivered by a higher power.

    in essence, only love can kill the demon.

  55. Re:From today's TheDailyWTF by Anonymous Coward · · Score: 5, Insightful

    One man's clean code is another man's over-engineered rubbish. The industry is not as united on the definition of "good" code as one might expect it should be, and in my (lengthy) experience with developers of different temperaments, there is great variance in how code is received and evaluated.

    The standard of judgement that gets applied to code is not objective, and never will be. It cannot be, as coding includes art as well as science.

    Trying to force your preferred coding style on to developers who operate differently will never end well. Unless you are uncommonly versatile, adapting yourself to a standard you hate will also not go well.

    Find a job where the programmers evaluate code similarly to how you do, and you will be much better off.

    As an aside, I have worked with developers on both ends of the spectrum, and found that both extremes are equally bad in different ways:

    1) Hastily-written code makes the trade show date and wins business, but can really ruin a company's reputation when the app doesn't scale and the bugs drive clients' costs through the roof. Contrary to the beliefs of those who write such code as their standard MO, constantly delivering maximum value in minimum time is NOT sustainable in the long run.

    2) Writing very clean code, and then keeping it clean, does NOT save you time in the long run. While it does reduce bugs and (in theory) makes it faster to add features in the future, the length of time it takes to write the code in the first place exceeds the time saved by fewer bugs, and the future features must also be clean, which *always* requires more refactoring than you would expect.

    Successful businesses will find a happy medium between these two extremes, much to the chagrin of developers who earnestly believe one extreme is better than the other.

  56. Culture by EmperorOfCanada · · Score: 4, Insightful

    With out a doubt you need to be able to measure what works and what doesn't but the moment some first turns to any kind of standard or the nightmare word "metrics" you have already failed. Too many companies go through all the fads and all the silver bullets. They have scrum masters, and black belts in Six Sigma (I am not making up the black belt part) but the fundamental problems are not fixed. Often the first place to start is with communications. Who does communicate and who is supposed to communicate. It is great if the sales people can bounce stuff off the programmers in the lunch room and even better if the programmers meet the clients but once the sales people are able to direct a project the project will instantly start chasing rainbows.

    The second place to look is the why? Software is made for two reasons, to make money or to avoid losing money. This allows you to boil down any "solution" to the money. So if the argument gets into religious territory such as language choice, OS choice, documentation, or even commenting style you can then ask, how does this either make us money or prevent us from losing money? So someone might say, such and such a documentation system is better when you can then ask, lets look at the cost or value of us having no documentation at all vs perfect documentation. After breaking it down you might find it is a huge cost one way or another and your decision is made for you. This prevents programmers from continuing to try and impress their long past CS professor and his insatiable demands for Hungarian notation. But as a pro-documentation example if you are routinely cycling in new programmers into a project great documentation can pay for itself in spades; but first you must calculate the cost of bringing a programmer into a project sans documentation and bathed in documentation. Did that documentation save more than it cost to produce; you might argue that a good documentation is low cost but again compare that low cost to the cost of not having it at all or having less.

    So better engineered high quality code feels like a great idea but make sure that the value of increasing quality does not have a disastrous business result. A simple example would be if your company's business is famous for being first to market with each new feature. People might grumble about how it crashes quite a bit but that since they make $500,000 a day using each feature having it a week earlier than the rock solid competition is very valuable. So if you slow the process of delivery down by 8 days and make the software perfect you will be out of business in no time. This is all a bit extreme but I suspect your core business is not making software but doing something else that the software supports. So it is quite possible that your company is mildly irritated by the bugs but that they exploit the features quickly.

    Personally I have found that unit testing on larger projects ends up speeding up deliveries but on smaller projects definitely delays delivery.

    One bit of horrible experience that I have picked up over the years is that some great systems were built on truly terrible code and truly terrible architectures. The disasters were also legendary but more often than not the cost of the disasters still justified the speed to market of the terrible system. Some systems were then recoded after disasters and made great but often at the cost of many release cycles resulting in a business disaster far greater than the disasters prompting the recode. Often the best solution was to make the code base slightly less terrible and press on at full speed. I have seen this terrible code and it is just solid WTF but when you look at the piles of money generated you just get angry that your own "perfect" code didn't make you rich. But as a counter point I have seen systems so terrible that the disaster took out the company; but even there just a slightly less terrible system would have saved the company. (The example I am thinking of had no backups so they lost everything, POS, invento

    1. Re:Culture by craigminah · · Score: 1

      I concur...if salary isn't a motivator find out what is. Basic motivational theories work in situations like yours...nothing magical but it's not so simple to implement either. Find out what motivates each programmer and use that to motivate them...or you could find out what demotivates a programmer and remove that. Maybe overly simplistic, but it's worked for me although I work in a completely different field but people are people (I think).

    2. Re:Culture by donatzsky · · Score: 1

      A nice essay, however it has nothing to do with being able to convince a team to write good code.

      Not directly, no. But sometimes (often) it's management you need to convince first, and in that case this is a good way to go about it.

      As for the rest, I absolutely agree: If the team isn't motivated then that's the place to start.

  57. Methods for Forcing by Epicaxia · · Score: 1

    Social changes are hard and difficult to enforce--the most reliable way is to thoroughly screen who you hire and, reciprocally, who you work for, both of which are moot points for situations like this. Therefore, I am going to enumerate three easy steps, albeit brute-force, that should help change the way you and your engineers work and think. Devious, yes--but wait on your judgement until you've read through the list, they're not all that bad.

    • * Start managing a trunk repository, and require all engineers to branch and merge as needed. Nearly every version control tool worth a darn now adays can handle distributed repositories, and most are easy to learn.
    • * Document, document, document. Interns are great for this, as it's also a good way to learn a new code base. It's also easier to track and sort new feature requests when you know where they stand with respect to your current version. This doesn't have to be Word DOCs--two easy and useful alternatives are wikis and PowerPoint (a lot easier to edit and communicate with the former; a lot easier to diagram and illustrate with the latter).
    • * Establish an expectation of workflow--specifically, bug and feature pipelines. A substantial part of this duty falls on your shoulders, as you must always know (or be able to look up) who is working on what, and where that piece fits into the big puzzle. Particularly important is the feature pipeline, as this is your interface to managers and others who interact with your code base.
    • I'm assuming, of course, that you haven't already done these things. If you have, there are many ways to take it to the next level: start using Bugzilla (or a similar tool) to track bugs and features; organize your documentation into User Guides, ICDs, and ADDs; define a small but standardized set of processes for complex challenges; etc. You get the idea--incremental is good, as you can't simply dictate, from top down, the behavior and practices of your engineers (unless... are you on a management track?). Of course, if you're in a CMMI-4 organization in which each person has their own HG clone of the primary code base, with your own QA and support staff, these are hopefully already in your rear-view mirror.

      One additional practice I would recommend is periodic release cycles--that is, release a major version every year, minor every month (or some variation thereof), and include in each release only the features and updates that are ready. If you can get to a point where your schedule and release cycle is no longer at the mercy of your requirement creep problems or an almost-done set of patches, you will find the atmosphere becomes much more productive and stress-free; quality will skyrocket as a result.

      Last but not least... I'm sure there will be many fine suggestions from knowledgeable slashdotters on this page. Pick and choose the ones you think will work (feel free to ignore all of mine, except this one) for your team / company / project--and when you sit down to implement them, don't expect to get away with 100% of your changes. Do what you can, what you are allowed, and what keeps you productive. Too many idealistic junior managers or engineers-turning-managers try to bring their 'brilliant ideas' into an environment where they simply don't work, and the lack of pragmatism leads to total failure of all of their efforts, when they could have gotten away with 60% (which is better than 0%). Throw in the vast world of methodologies, process monkeys, and paradigm acolytes, and you'll see why it's worth being cautious and flexible.

  58. Re:From today's TheDailyWTF by Anonymous Coward · · Score: 1, Funny

    Try proof by counterexample.

    If you're using C++ make a "fun" header file and hide it in an automated build script.

    #define true false
    #define false !true
    #define if while
    #define continue break

  59. The "Nut Island Effect" by rbrander · · Score: 1

    There's a decent Wikipedia article on it. Accusing your management of allowing one of the now-classic dysfunctional management failures to grow could get some discussion going.

  60. Re:Read "Code Complete", follow its guidelines by Marxdot · · Score: 1

    A better option is to study the Plan 9 source code or read the Practice of Programming.

  61. Write a business case by khchung · · Score: 2

    We feel that if the right thing is done every time, we would can eliminate our issues and still release at the same pace. How do we effect the social change necessary to convince them of what is better and encourage them to take the effort to do it?

    Write a business case showing how much these "issues" are costing your company, and by extension, how much your proposed changes is going to save.

    Then write out clearly what you want to change, how much that costs, and exactly how those changes can be objectively measured (i.e. so someone outside can know if real change has been implemented or if only lip service been paid).

    Then offer to put your money on the line, and offer to take a share of the P&L that resulted in this change you wish done, on the condition that the changes have been implemented measurably.

    Make your presentation to your manager, his manager, all the way up to the big boss who is ultimately responsible for these related costs and profits.

    Then let them decide. This is the most important part, your job is to do the work, their job is to make decisions. Don't presume you can do their work better than they do. If they decide against it, don't make a fuss, don't try to implement your changes by subterfuge, find another job if you wish, but respect that your management had made a decision.

    --
    Oliver.
  62. Start with management buy-in, and start small by swillden · · Score: 3, Insightful

    It sounds to me like this is a group of 2-3 developers who want to improve processes, without (currently) support from the business, which just wants to keep shipping on time. If you can't get management support, you're going to have a hard time, so that's the place to start.

    If your management doesn't understand the concept of Technical Debt and how it's costing the company time, money and reducing your agility and competitiveness, that's where you need to start. How to go about educating them is something that you're going to have to figure out for yourself, since you know the people and the context, but I'll give you a warning: people don't like to be told they don't know their business. If you try to approach it like that, you're very unlikely to be successful. And, frankly, unless the group trying to initiate the change is already among the top performers, and has a track record of successfully delivering, you're unlikely to be successful no matter how you go about it. So you first need to get the guys the management perceives as being their top contributors on board.

    Still, if you can get the conversation started in the right way, technical debt is a concept that business people can easily grasp, because it so closely parallels the notion of financial debt. For that matter, you should make sure you understand it thoroughly as well, including the fact that it often makes perfect sense to take on technical debt in exchange for a business advantage which is likely to have sufficiently-large rewards. Never forget that the purpose of the code is to generate revenues, not to appeal to your sense of aesthetic purity.

    But, technical debt slows progress and massively increases the financial impact of bugs. The interest will be paid -- there's no avoiding it or deferring it -- and as the debt grows it becomes a burden which sucks up all resources. If you can get your management to understand and agree on that, you've won, as long as you don't screw it up.

    To avoid screwing it up, do not embark on a massive development process re-engineering effort. If you do, you'll fail. You'll delay the next release, cost the company large amounts of money and customer goodwill and completely undermine everything you said.

    Instead, figure out what one thing you can change which will have the most immediate significant and measurable impact. Do that, show the benefit, then move on to the next incremental improvement. This is hard. It requires you to not only figure out what will help the most, but also how to measure the before and after states, and to ensure that your measurements won't be gamed or encourage counterproductive behavior. Also, spend a lot of time thinking hard about how to make the change in a way that will have the lowest negative impact on productivity -- because anything you change is going to hurt at least a little, in the short term.

    Though you need to look at your own situation, my prediction is that the thing that will do you the most immediate good is code reviews. Automated testing is a bigger win, but has a steeper up-front cost and the value is harder to quantify. With a little care, it's easy to document the financial benefits of code reviews. But to make them work, you first need good code review tools -- sitting around a table with printouts wastes everyone's time and rarely accomplishes anything. Spend the time to find a good code review tool that you can integrate into your workflow, set it up, test and validate it and be sure that it's going to work well before you ask people to use it. Note that this is all a lot of work, and unless management is extremely enthusiastic you'll probably have to do a lot of it during evenings and weekends.

    Once you have it working for a while go back and pull out a bunch of reviews and take some time to carefully analyze what kinds of bugs were identified and fixed in the review process, and try to estimate what it would have c

    --
    Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    1. Re:Start with management buy-in, and start small by swillden · · Score: 1

      I find Code Collaborator (CC) is a great too for reviewing code.. However, you should still sit in a room to discuss the code and use CC for capturing the notes.

      I disagree. I find having everyone in a room creates two problems. First, merely having to schedule meetings reduces the number of code reviews that can be done, which increases the amount of code that you try to cover in a given session. It also doesn't allow reviewers to easily do research on related issues to make their commentary more informed. The result is that the reviews are much less detailed. Second, the personal interaction creates more opportunity for emotion to get involved.

      Asynchronous reviews are more time-efficient and less emotional. I submit a commit for review, you look at the diff in a nice tool and make comments, I respond with changes, and so on, until we're both happy with it, then I push my commit into the central repository. It works very well. Oh, and a byproduct is that all of the discussion about the code is captured along the way.

      With Respect to "Automated testing is a bigger win, but has a steeper up-front cost and the value is harder to quantify".. I think the value is easy to quantify. As your application grows, your automated testing will ensure you have not broken something that was previously implemented. The more use case testing you have the better your end results will be when adding new features and changing code.

      What you've (accurately) stated is the reason automated testing is so valuable. What you haven't done is offered any way to quantify the value. You've offered qualitative analysis of the value, not quantitative analysis. Also, even if you can find a good way to measure the value and to assign dollar cost and benefits to it so you can show ROI, much of the ROI of automated testing comes later. Some is immediate, of course. I don't know how many times I've discovered and fixed bugs in my code while writing unit tests, and that win is worth the effort right there -- but it's hard to track. Short of asking developers to not only write unit tests but also to keep detailed logs of what they discovered and fixed, the only way to assess the immediate impact is by observing lower bug counts during QA or later phases, and many shops don't have processes that allow them to establish good baselines for comparison.

      Code reviews, however, provide all of the documentation needed to extract a direct measurement of at least part of the value obtained, usually one that on its own justifies the effort.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
  63. No brainer. by ma1wrbu5tr · · Score: 1

    Bad code = No pizza.

    --
    Why can't we go back to using jumpers to configure slot adapter cards? Why? I say!
  64. Re:From today's TheDailyWTF by Z00L00K · · Score: 3, Interesting

    Start with teaching the employees the importance of writing good code.

    Also teach them how to refactor code in the IDE they use to avoid gigantic monolitic methods/functions/classes.

    Then provide them with the tools. In addition to compile at the highest warning level and using the built-in support in the IDEs they should look at Stylecop for C# (even though it's more about style than finding potential bugs), Splint for C, FindBugs for Java.

    People that are willing to take in and understand the importance of writing good code will end up being better.

    And don't forget that people are competitive to some degree - so if you find a way to measure the quality of the code produced it's fine, and let it come with a small advantage. A movie ticket, a box of chocolate or something similar.

    --
    If builders built buildings the way programmers wrote programs, then the first woodpecker would destroy civilization.
  65. No Such Thing As Grassroots Improvement in IT by wadexyz · · Score: 1

    Two or three people in a large company can't change jack shit. This type of change can only come from the top. And the chance of that happening is zero. Do what I do, grin and bear it.

  66. "Convince"? by matunos · · Score: 1

    The question presumes that developers are choosing to write crappy code and just need to be convinced to write good code. That's silly. Either they're capable of writing good code and want to, or they're not. If you have to convince people to write good code, then you have poor developers.

    That's not to say there aren't external factors that degrade the maintainability and robustness of the code, and the questioner suggests things are rushed to get stuff out of the door.

    You can try to get management's agreement to terms regarding technical debt (that is, that time will be given post-release to deal with technical debt). If this cannot be agreed to, or the managers reneg on an agreement, then you can just start estimating your work upfront taking into account (a) the effort it'll take to do things with minimal technical debt, and (b) the refactoring of existing crud that you'll need to do in whatever areas you'll have to work with.

    Things like improving new team mber ramp up time are fuzzy and speculative. If you can make the improvements you want, then you can look back to see how those improve. Gather that data so you can advocate for more changes with some data to back your arguments, including the value to the company in saved hours, increased turnaround time (after the initial investments for undoing the crap that's already there).

    Above all, prepare to go the extra mile to do the sorts of refactoring you want to do, including spendig long hours. If you're not motivated to do that, then you should ask yourself if you really care enough about the product/company to make that level of personal investment. If not, then learn to coast by their standards, or seek another team/company that provides the work environment you're looking for.

  67. Precision pays by GerryHattrick · · Score: 1

    "...we would can..." - seems to be a bug right there.

  68. "Good Code" by codeButcher · · Score: 2

    I think not enough people understand that coding is just a small part of producing a working software system. A system starts with an idea in someone's head - when this is formally documented, we often call it User Requirements. Now note that that system already exists, although not in a machine-executable form, but as a vision in someone's head. So formal software lifecycle processes usually define various levels of documentation/specification. Each of these refines and details the previous level. So each level already represents the system, but starting at a very abstract ("in the head") level, until you get to the very concrete ("machine-executable") level. (QA/testing runs in parallel, ensuring that the product at each level complies with what was specified (the product of the previous level).

    Enhancements also start as enhancements to the User Requirements and down the process, it is just an incremental addition, which is obviously a smaller work package than the original system. I don't have any experience of Agile methodologies (as you might be able to tell - military market), but if that is your environment you might be able to adapt the above, and allow for the tweaks that make Agile what it is. In effect most Agile methodologies have a lot less levels, and also divide work into a lot more but smaller incremental enhancements, enabling one to go through the remaining levels much quicker. Either some Agile or the older more formal methodologies are good, it depends on your circumstances which would be better.

    What I'm saying is that changing the coding to be better alone, is like giving some paracetamol to someone with a brain tumor. Your way of working needs fixing, and it will probably not only involve your coders but all people in the process starting from the people that provide requirements - since everyone works on some level of abstraction of the system. Formalized processes are sometimes helpful in this, as it can be a standard condition of employment to comply with company policies and procedures. In effect, you need to turn your team from a collection of individuals who do much as they please, to a single organism that is "better than the sum of its individual parts" (see "Heterozygous" for a biology analogy).

    Furthermore, all the above documentation can be helpful to newcomers (and existing employees) to get up to speed, since one can select the document at the desired level of abstraction and learn what you need to know at the quickest speed. Reading code (even good clean code), being at the lowest level of abstraction, can be quite time-consuming and frustrating.

    Now it IS a big problem to get people to write good, to-the-point, unambiguous documentation - documentation that is as terse as possible and still verbose enough to contain everything that is needed - and that can be understood by someone other than the author.

    Now to your question: (1) Do developers/employees in general, perceive that there are problems with the way they are working? If they are unhappy, then they might be more open to change that would improve their experience, than if they are quite content. (2) Once they are looking for improvement, it might be shown to them in the form of published work ("best practices") on this, or other companies' way of working, or even a small "pilot study" team in your own organization. (3) Many possible solutions exist, some contradicting others, and your org needs to find the one that will best work for them. I would say if people can provide input, they might be more accepting of the solution. Of course, an organization consists of lots of individuals so management is needed to provide (some) direction. (4) Be open to adapt/tweak for further improvements. (5) Use some carrot and stick to reinforce, but be careful of polarizing management vs employees - rather try to have people praised or censured by their peers, even if it is just weekly voted "biggest boon|booboo awards" that sit on someone's desk but don't do much else.

    --
    Free, as in your money being freed from the confines of your account.
  69. You already identified the problem by Stefan · · Score: 1

    Easy, you already identified the root of the problem: "product guys don't like to wait". Means you're in a company run by marketing/sales-people caring only for their commissions and next quarterly bonus, not quality-minded people who understands the business of building software. Probably you don't have the power to replace/educate those guys. That leaves you two options.

    1. Apply for better jobs elsewhere. You can be a bit picky since you already have a job. Easiest way to end your suffering ;-)

    2. Be a professional and convince the rest of your team the same. My philosophy when managers want to rush _every_ release out yesterday regardless of quality instead of just the occasional genuine crisis, is that their "average" instructions, however they formulate it, must be to produce a quality product. Ignore them breathing down your neck, throwing childish temper tantrums etc. They obviously don't know better. In the long run your way will provide them with more timely releases. Half a year from now they won't have less urgent planning, so you better have the code continuously in good shape.

    1. Re:You already identified the problem by rjstanford · · Score: 1

      Easy, you already identified the root of the problem: "product guys don't like to wait". Means you're in a company run by marketing/sales-people caring only for their commissions and next quarterly bonus, not quality-minded people who understands the business of building software.

      You've just identified another problem. Chances are very high (but not 100%) that your company is, actually, not in the business of building software. Its quite possibly in the business of solving buisness problems with software, but if the software contains no defects but is late or doesn't actually quite solve the right problem, that's far worse than correctly solving business problems with a few bugs.

      Additionaly, know your tolerances. There's a reason that when building a house the carpenter doing the framing - even if they're the same person who builds the cabinets - doesn't spend too much time planing the 2X6s before sheetrocking but may take several days to lovingly carve details in the entryway.

      --
      You're special forces then? That's great! I just love your olympics!
  70. Different stages of code by olafura · · Score: 1

    Here is a good presentation on what to do: http://www.infoq.com/presentations/Erlang-Scalability

    But there is a short description, if you want to innovate you have to write prototype code. If you want somebody else to be able to work on it then you have to make it more beautiful. Then you can have somebody come in and make it fast.

    If you break it down and segment who works on what face then you will be able to convince somebody in charge of change, unless he's pointy haired and then your screwed :)

  71. big problem... by SuperDre · · Score: 1

    The biggest problem is.... what is good code..... It's all in the eye of the beholder, and I've seen it so many times, that what one programmer calls good code, another calls big crap, and vice versa..

    When is something good code? NO THAT DOESN'T MEAN FOLLOWING SOME RULES YOU'VE READ IN A POPULAR BOOK ON CODING....

  72. The way forward by jandersen · · Score: 1

    The only way of producing good quality code that I know of, is by introducing rigorous quality assurance, and by management realising that code is not ready for release until it has passed all QA tests. Not meeting deadlines is a minor sin, releasing unfinished code is a major one.

    QA is something that should be integrated on all levels:

    - When developers estimate the work, they have to learn that it takes much longer than you expect; even if you can accurately estimate how many hours a piece of code will take, you have to take into account all the overhead, like meetings, context switches, breaks (and that IS important!) etc. 30% of effective work is probably all you can realistically sustain over a longer period of time. QA in this context means that you compare your estimate to how long it actually took and change your future estimates accordingly.

    - Code must not be checked in to source code control unless accompanied by unit tests etc that demonstrably work as expected. Many source code control tools can check this automatically as part of the check-in.

    - The product must be integration tested by a separate QA team, whose only purpose in life is to break your work. They musst not be developers, because developers will know too much about how to work around problems. All integration testing must be carried out on non-development systems, so you are not unwittingly relying on development libraries and environment settings that your customers don't have.

    There are tools that can help you with this process, but really it is about management discipline, and ultimately about sustaining a good business. After all, if you take money from your customers and give a poor quality product, they will decide that you are liar, an incompetent - or both. And then they'll go away and give you a bad reputation.

    1. Re:The way forward by rjstanford · · Score: 1

      The only way of producing good quality code that I know of, is by introducing rigorous quality assurance, and by management realising that code is not ready for release until it has passed all QA tests. Not meeting deadlines is a minor sin, releasing unfinished code is a major one.

      And when you miss your first external deadline that has seven figures of penalty attached to it rather than shipping a product with known (documented) minor defects that still helps someone solve their business problems and your own company meet its contractual commitments, you'll be polishing up your resume. Unless its a small O/S pet project, software development is a means to an end not an end of itself.

      --
      You're special forces then? That's great! I just love your olympics!
    2. Re:The way forward by jandersen · · Score: 1

      As far as I remember, the question was about how to ensure good quality. And if you'll notice, QA also addresses the need to make accurate estimates of your development times. Poor quality code delivered before it is ready for shipping is like wetting your pants: initially it feels quite nice and warm, but ...

  73. two things by kcmastrpc · · Score: 1

    pay them well, let them work. don't do either, and you'll get bad code - you can count on it.

  74. Joel on Software sayz by magic+maverick+ · · Score: 4, Insightful

    Joel Spolsky wrote a number of articles, years ago, that are really relevant. I'm going to link to and quote some of them:
    The Joel Test: 12 Steps to Better Code:
    1 Do you use source control?
    2 Can you make a build in one step?
    3 Do you make daily builds?
    4 Do you have a bug database?
    5 Do you fix bugs before writing new code?
    6 Do you have an up-to-date schedule?
    7 Do you have a spec?
    8 Do programmers have quiet working conditions?
    9 Do you use the best tools money can buy?
    10 Do you have testers?
    11 Do new candidates write code during their interview?
    12 Do you do hallway usability testing?

    Joel says you should be getting at least ten of those twelve. Sounds like you aren't. So, next article is relevant:
    Getting Things Done When You're Only a Grunt:

    You could just leave, I suppose. But presumably, there's some reason you're stuck there. The stock options haven't quite vested, there's no better place to work in Podunk, or perhaps your boss is holding someone you love hostage. In any case, dealing with life on a bad team can be infuriating. But there are strategies for improving your team from the bottom, and I'd like to share a few of them.

    And those are:
    "Strategy 1 Just Do It", setup a build server, write the make file to automate the build process, etc.
    "Strategy 2 Harness the Power of Viral Marketing", setup your own bug tracker. Use it for your own bugs. If someone sends you a bug in an email, add it to the tracker and reply saying that it would be so much easier if the person just added it directly to the tracker themselves. Setup local version control. Use it. Etc.
    "Strategy 3 Create a Pocket of Excellence", be excellent. Write specs and follow them. Write schedules and follow them. Etc.
    He continues with "Strategy 4 Neutralize The Bozos", "Strategy 5 Get Away From Interruptions" and "Strategy 6 Become Invaluable".

    Another article Top Five (Wrong) Reasons You Don't Have Testers explains that you need an independent Q&A team with real power, while Things You Should Never Do, Part I says don't throw out code and rewrite from scratch and Incentive Pay Considered Harmful says what it says on the tin.

    Browse around the site and read some of the other articles as well. There is a lot of good advice there.

    --
    HELP MY ACCOUNT HAS BEEN HACKED BY AN ILLIBERAL ART STUDENT SET TO DESTROY THE INTERWEBZ!
    1. Re:Joel on Software sayz by undeadbill · · Score: 1

      Or Strategy 4.a, a la John F. Woods: Hire the proverbial homicidal sysadmin, let them support the code for a few months, and then let that person hold some code review meetings. There may be expenses for plastic drop cloths and quick lye, however, so ensure the new sysadmin has access to a company credit card and a van.

  75. Is the code bad? by caywen · · Score: 1

    When someone tells me my code is bad, I look them straight in the eye and say

    Is my code bad, or is it BAD ASS. Aw yeah.

  76. Define "good code" by TheDarkMaster · · Score: 1

    Your good code can be trash for me, and vice versa. The code that is excellent into the situation X can be horrible if used in the situation Y. Stop looking for "the perfect coding style that fits all," it does not exist.

    --
    Religion: The greatest weapon of mass destruction of all time
  77. Categorical Imperative by dreamtripper · · Score: 1

    Talk them about Kant and the Categorical Imperative. Transpose those moral concepts to coding and there you go! I tried that once, not sure how much difference it made, though...

  78. It is not just "convincing the team" by CptJeanLuc · · Score: 1

    As long as the company (management) is pushing strongly for pushing new releases fast, then there is no solution to your problem. You can ask for a "day of zen" where all the programmers go off-site and discuss "what is good code" until everyone is fired up, only to return to work and get back into the old mode. The todo list and release dates hasn't changed.

    In terms of "good code" there is of course never any excuse not to have properly written, formatted, and commented code etc. I am assuming the main problem with your code is it is somehow poorly architected and quality checked; bad or inconsistent design, commit stuff as soon as things seem to work, avoid spending time on writing tests - that sort of thing. New stuff gets layered on top or some quick band aid is applied, and it eventually turns into a big mess.

    For that kind of code problem, "fixing the problem" is a big thing. It is in itself an investment - the poor development processes has incurred a development "debt", which requires man-hours to fix. Lots of stuff may have to be rewritten. And in return for all this time, product managers are getting no new features to show the customers - "only" a more stable product. Secondly, new stuff will (in the short term) take a little longer to implement, because doing it right takes a little longer, plus various problems with the old code will surface that need to get fixed. Thirdly, the team's mentality towards what it means to write a good product needs to be changed - and some of the team members may not be able to change their attitude, or may not have the skills to write and architect proper code.

    In the end, this is a problem that needs to be discussed with the powers in charge, as a big and serious issue. While it may be comforting for management to let things just run as they are, this is the type of approach that leads to complex and unmaintainable products. Which at some point, so much debt has been incurred that product is completely unstable, everyone is caught up in "fixing" bugs and crashes, and new features take forever to fix even when trying to take the quick route.

    Unfortunately, with the typical near-sighted "next quarter" focus, it is an uphill battle you may well end up losing.

    1. Re:It is not just "convincing the team" by rjstanford · · Score: 1

      For that kind of code problem, "fixing the problem" is a big thing. It is in itself an investment - the poor development processes has incurred a development "debt", which requires man-hours to fix. Lots of stuff may have to be rewritten. And in return for all this time, product managers are getting no new features to show the customers - "only" a more stable product.

      A more stable product is great. Frequently, however, the product works well but is a PITA to enhance. In those cases, you're offering XX hours of no new features (and a reasonably likelyhood that the new code will have at least one glitch in it just because it hasn't had 3 years of real-life production use) in exchange for the promise that future features will be easier to implement. Sometimes that's a good deal; frequently its not.

      --
      You're special forces then? That's great! I just love your olympics!
  79. Re:From today's TheDailyWTF by jellomizer · · Score: 1

    In general (meaning they are exceptions, a lot of them) engineers are not good at coding. Good coding is more of an art and math science are the mediums, and the computer is the pallet. Part of good coding is to make your code elegant, small and easy to follow. I tend to prescribe small applications that do one thing and do it well, over the large program that does it all. Then combine these small apps together in a unified UI, this makes each piece easer to debug because you know what piece is doing what. However that be the case (performance, tighter integration, etc...) that you need to make a larger project, similar rules apply, make it easy to navigate. Know where the code stars and how to follow it.
    But the biggest problem I have seen is because coding is an art form people get too personal with their code and try to protect it when it is time for it to go. So we end up with a bunch of code of different styles and ages that have been over reworked to be a hindrance, where a remake would be better.
    Get rid of code that has many different ways of doing the same thing. Avoid third party libraries that are not standard or where you don't have the source too.
    Try to maintain a coding standard, and have someone review the code at random intervals to make sure they know what is going on. Some people try to put enterprise development designs into a small app making it too bulky. Conversely some people try to code like it is a small app in an enterprise app, making it less uniform. You just need to watch them and keep them implace and Change behaviors before it is too late

    --
    If something is so important that you feel the need to post it on the internet... It probably isn't that important.
  80. Open the source for someone by Parker+Lewis · · Score: 1

    In a small company that I worked, we opened the code for the client (the client has a code team and in order to convince the client to purchase our product, we offered the code for them, and then we got a deal). This fact (the client developers will check our code) make all the team code better. Open the source code, in some level, automatically make you write better code, cause you start to think "omg, what others will think about this? and my reputation as developer?".

  81. Re:From today's TheDailyWTF by rjstanford · · Score: 2

    Trying to force your preferred coding style on to developers who operate differently will never end well. Unless you are uncommonly versatile, adapting yourself to a standard you hate will also not go well.

    Also, when developing, realize that having consistent code that matches the rest of the project is far more useful than having a small chunk of code that - to you - is slightly more readable in and of itself but dissimilar to everything else. Most (although not all) coding standards, after all, are relatively trivial.

    With Java, at least you have the official Sun recommendation to start with which almost every project follows somewhat. I prefer to operate as a diff of the standard - "Follow the guidelines, but lines up to XX characters are fine", for example.

    2) Writing very clean code, and then keeping it clean, does NOT save you time in the long run. While it does reduce bugs and (in theory) makes it faster to add features in the future, the length of time it takes to write the code in the first place exceeds the time saved by fewer bugs, and the future features must also be clean, which *always* requires more refactoring than you would expect.

    A very good point. If your code is well compartmentalized this gets even less efficient - if you have a big hairy ball of code that only gets tweaked once a year, but each "5 minute" fix ends up taking a full day of testing and hair-pulling, spending a month or two to fix it just won't ever pay off, especially when you add in the opportunity cost of missing a month's worth of new feature development.

    --
    You're special forces then? That's great! I just love your olympics!
  82. wow by Skal+Tura · · Score: 1

    wow, one should not need to convince why doing quality work is important :O
    Just leave that company, or get all of those who oppose doing quality fired. There really is no middle solutions in situ like this.

  83. Why Care About the Team? by nicholdraper · · Score: 1

    I worked at one place that fired all the programmers nearly every two years. Bad programmers come and go. So what. I worked there nine years until I quit to go to another company when I wanted to leave. If you cannot take over a project, figure out what is wrong and correct it, then maybe you're not the great programmer you think you are. Here's how to become a better programmer. Realize first what is good code, it isn't the code style, you can use a code beautifier to change that. It isn't in the comments. Although good programmers recognize when a well placed comment will help. Good code works. Support calls decrease. You can demonstrate that to a non-technical boss. Why was I still employed when they fired all programmers every two years? Because often I was the sole programmer on a project and it didn't fail. If they had a project that failed, they gave it to me and after a few releases it was fixed. So secret number one, the reason you right unit tests isn't because your boss forces you to do it, it is because you recognize that your work is your reputation. So what if you aren't given time to write good code, you're not given time to write bad code, are you? Don't even commit your code to the repository until you have tested it. Study programming, and I don't mean like you did in school, realize that professors like to teach, programmers like to program. Find a good programmer and look at his code. If there are no good programmers in your company, look at open source. Lastly, recognize that becoming a good programmer takes years. Learn a little about metrics, it will help you to show your boss that your projects are improving while you are becoming a better programmer.

  84. Re:From today's TheDailyWTF by JaredOfEuropa · · Score: 3

    I'd have to disagree with point 2. Writing clean code is not just about keeping to coding standards, keeping functions small, or even making a decent object model. It is also about making a system open and extensible by providing clean APIs, web services, mechanisms for adding extensions, function hooks, etc. That takes time and effort, but does reward you with a way to add new features faster. However, those extensions (new features) do not need to be particularly clean in themselves. Because the code for those new features will be isolated from the base code, you can get away by hooking a quick & dirty extension into your clean system. Such extensions are likely small enough to debug or change easily even if the code is messy, if you've done your homework on providing a well defined interface on the main system. Having a type 2 (clean) base system with a well defined interface allows you to add new features with type 1 programmers, delivering maximum value in minimum time, in a sustainable manner.

    You don't want to find a compromise between the two styles, you want to find the right mix.

    --
    If construction was anything like programming, an incorrectly fitted lock would bring down the entire building...
  85. Re:The Politics by rjstanford · · Score: 1

    Don't rock the boat.

    Although pride of workmanship improves profit it's viewed as a counter to the current direction of the wind. This is a matter for which management will ultimately be blamed. However, as producers you should learn to understand the source of the flawed code beyond time constraints.

    "Management creates quality", W Edwards Deming

    Also, understand your role and the role of your company. Not every level of craftsmanship is appropriate for every level of project.

    --
    You're special forces then? That's great! I just love your olympics!
  86. Re:You don't by rjstanford · · Score: 1

    What the code review should cover, however, are standards like "Have your methods do the thing that matches their name, do one thing, and don't have any avoidable or undocumented side-effects." The nice thing about forcing correct (not too much, not too little) abstraction in a code review is that a) automated tools are terrible at figuring that out, and b) you've locallized your problems - if there are any - to code that can either be refactored if its a problem or just left alone and ignored if its ugly but effective.

    --
    You're special forces then? That's great! I just love your olympics!
  87. Just encourage it! by jameshofo · · Score: 1

    Reward good behavior and push people in the direction your trying to go, get rid of the people who are blocking your attempts to make things cleaner.

    but the attitude may be that way because the typical demand is "push push push" until the goal is met, I see a lot of people fall into this trap where they believe that if they can just get to "X" we'll be O.K. and we can stop making the developers life hell. If that's the case then its a managerial problem, the environment will tell you a lot about how things operate day to day.

    --
    Good leaders run toward problems, bad leaders hide from them.
  88. Re:From today's TheDailyWTF by DoctorBonzo · · Score: 1

    Almost amusing, but wouldn't the 1st 2 #defines cause an infinite loop in the macro expander of most compilers?

  89. Polish your resume first by Anonymous Coward · · Score: 1

    I just got fired on a project for doing this. The inevitable outages and downtime when cleaning up a 10 year old mass of hand-built, undocumented systems caused me to revamp and document the systems, but encounter some very bad failures. (When there are entire databases, subnets, user accounts, and critical production software running on developer's desktops that no one in the company has ever documented or even backed up the machine, there are going to be outages as you do cleanup.)

    The newer engineers there are doing a much better job now, partly due to my technical leadership and partly by my taking a backhoe to the documentation and throwing out most of the outdated and irrelevant material. And they were all shocked as I left the building. But when management wants 24x7 availability, new features all the time, and gives no time to do it, something's got to give. They've taken my good work and hung me out to dry because I discovered a lot of the existing "dry rot" in the project and cleared it up, but yes, it cost time and political capital when services went offline in the cleanup. They'll now get a few years of stability, and they won't be paying my senior engineering rates and I won't get stock when they go public next year. That kind of thing is why I make damn sure I get paid in real money, not just "shares".

    So, a critical lesson for me and for you, is to spend the political capital in advance to get managerial buy-in to the project, or be ready to move on if someone doesn't like any aspect of your work. Outages and breakages are *bound* to occur as a result of the cleanup, at least at first. If you're like me and do your work because you love it and want everything to work, do it but be prepared to be unloved by some parts of management. Publish if you can: publishing your work in open source projects so others can benefit from it, and so that you've got verifiable achievements on your resume, is priceless.

  90. How a manager should treat coders! by kurt555gs · · Score: 1

    This video clip says it all:

    http://www.youtube.com/watch?v=LvwqK2gn3S0

    --
    * Carthago Delenda Est *
  91. Are you sure? by ArrayIndexOutOfBound · · Score: 1

    There are ways to instigate a change without being loud about it. When you write your code, write it pretty, well documented and with great unit tests. When you are releasing, write good release notes. When you are in charge of a feature, do good code reviews. Make code review templates. Write good documentation. See what happens.
    If you really want to put this on the corporate agenda, you need to convince the person making technical decisions. If this gets on his or her agenda, things will happen. Beware when approaching this person - you've been thinking about this for weeks or months, while it may be quite a new idea for them. It may take a while for things to sink in. Don't expect it will happen quickly, or even the way you think is right. Plant the seeds and tend to them as they grow. Be prepared for resistance among coders too - writing docs, tests and releases are rarely seen as very compelling work, especially with tight deadlines.
    Before doing anything though, you need to think about how important this is to the business. To you, it may seem like a very important thing and a complete no-brainer. However, you may not have all the information necessary to make this decision for the business. To the product and business people, the opposite may equally seem like a no brainer. All they care about is that it does the job and hits the market when they need it. Tech leaders are often enslaved to this kind of stuff.
    Also, in my experience, many times a rewrite / major refactoring ends up costing too much and producing little benefit in the long run. Old idisyncracies are replaced by new ones and key sections of the code - often most critical to the business - end up scarred by changes around them and not better in any way. Be prepared to encounter people with similar experience and perhaps a bit of resistance along those lines.

  92. Re:WTF by RabidReindeer · · Score: 1

    Kick them in the nuts. Now that you have their attention tell them to write good code.

    And while you're at it, tell them that there are plenty of people in India who will be glad to write good code for $5/week, have 3 people on a team that properly requires 10, lay off 1 of them in order to instil proper levels of terror, make the remaining 2 work 70+ hours a week (salaried, of course), and just in case that doesn't motivate them enough, tell them that they must give "110 percent" and "work smarter, not harder".

  93. Re:From today's TheDailyWTF by invid · · Score: 1

    I would say six months is the average period to get up to speed with a significantly large software project. In a month you might allow someone to make a trivial change to the GUI.

    --
    The Moore-Murphy Law: The number of things that will go wrong will double every 2 years.
  94. Re:From today's TheDailyWTF by hackula · · Score: 1

    Yeah, one month is a pretty small amount of time IME. Everyone sucks at their new job for the first 6 months. Any experience otherwise is probably a perfect example of the Dunning Kreuger Effect.

  95. Release schedule driven solely by Product people? by Stolpskott · · Score: 1

    If by "Product" people, the OP means sales/marketing people, then this will be a constant problem, the development team will always be to blame, and you will always feel like a cross between Sisyphus and a dung beetle.
    First, you will need a development manager with the authority to hold the release of a product version.
    Second, you will need a development manager with the backbone to stand up to pressure from the "product" people and push back.
    Third, you will need a development manager who protects you from the "product" people who are used to coming to you directly and dropping tasks on you.
    Fourth, you will need a development manager who will inspire your development team to change their coding habits from fighting fires to development based on a plan. Whether than inspiration comes from higher pay, a kick up the arse, threat of firing or good old-fashioned physical intimidation/sexual innuendo is dependent on whatever works on the individual developers.
    Finally, you need all of those development managers to be the same person.
    Once you have that person in place, they need to adopt a specific development methodology - Scrum, Agile, fundamentally it does not matter at this point. You are starting from such a low level of code quality that it sounds as though just about anything will be an improvement, as long as all the developers are pulling in the same direction.
    The development manager sits down with the "product" people, establishes a list of required features for the next version, and either talks to the team about estimated development times or comes up with that figure themselves. Add time for comprehensive testing and bug fixing (not all bugs, just the major ones), plus a little extra time. That gives the release date. Product people want it sooner? Fine... what features shall we take out? Once the feature list and timeline is established, if the product people want to add features or change their mind, then either the release date is moved or those changes are held over to the next version, or other pre-agreed features that have not yet been developed are held over.
    The development manager will be the most hated person in the office for about 6 months, and (s)he will need the full backing of the company directors because you can be sure that the product people will be on the directors' cases 24x7 complaining about the obstructive person. It is not an easy job, it is not a nice job, but it is one that I have done at a couple of companies, and once the product people see a release come out on time and relatively bug-free, they will start to come around.

  96. Re:From today's TheDailyWTF by rjstanford · · Score: 1

    I find it amusing (actually amusing, not being ironic here) that we both had similar comments but, with minor differences in interpretation of the GPP, posted them as agreements-with and differences-with the point being made by the AC above :)

    --
    You're special forces then? That's great! I just love your olympics!
  97. Re:From today's TheDailyWTF by rwv · · Score: 2

    If as the submitter claims "new people take a month to get up to speed" then either their project is trivial or they are doing something right.

    I agree... a one month ramp-up time is totally insignificant assuming the shop has a reasonable turnover of about 5% per year. If there are a significant number of people voluntarily leaving on a regular basis, however, management might have other fish to fry. That said... smart people might want to leave a place with crappy standards, so management would have the best interests to create quality controls and standards.

  98. Qualtiy code by thvv · · Score: 1

    I think there are four things you need.
    - commit to quality (has to be top to bottom)
    - use systematic process (seems like you get this)
    - check everything (at every stage)
    - improve continuously (own your process and your meta process)
    i wrote more about this at http://www.multicians.org/thvv/nasty.html

  99. make them depend on it by chstwnd · · Score: 1

    well, I think a relatively straightforward approach would be to have them tag-team assignments. not the resource you're talking about, but individual subroutines/functions. if you can afford the individuals' downtime, have them rewrite the code from scratch. have pairs work on one subroutine, but not simultaneously. half way through the initial writing phase, force them to hand off to their partner without the benefit of a handoff or status briefing. when they realize that they're taking more time to interpret the code than to finish it because it has obscure variables or function calls or zero commenting, they'll start doing it on their own. it would speed up the process if you made inputs from the individual coders fold into an annual review.

  100. It starts way before the first LOC is written .... by Zero__Kelvin · · Score: 1

    Solid code needs to be engineered, not written. Very few people understand that today. It is the reason why so much code is straight garbage today. Unless you can get everyone, including management, to understand that actually writing the code is a relatively small part of the equation then you will never, ever, ever succeed in getting your company to churn out anything but bug-ridden, undocumented, untested, garbage.

    --
    Guns don't kill people; Physics kills people! - John Lithgow as Dick Solomon on Third Rock From The Sun
  101. XKCD by Leif_Bloomquist · · Score: 1

    Nobody's posted this yet?

    http://xkcd.com/844/

    Just to reinforce what others have said - code reviews (even starting small) and independent QA is essential as a starting point. Make the quality of the code a source of pride.

  102. Where there's a whip by virgnarus · · Score: 1
  103. Fire the programmers who won't write to standards by gestalt_n_pepper · · Score: 1

    Harsh, I know, but code improvement methods are not rocket science. A programmer who writes a single unit test that essentially does nothing but let the programmer say, "Hey, I unit tested this code!" is a programmer who needs to be shown the door. Ditto for the programmer who won't add the "Why I did this" layer of comments, or the programmer who consistently overlooks error checking, anomalous inputs or other obvious errors. For that matter, I would (and have) booted programmers whose idea of a help message is "Error on Input Block 40!", OK? A programmer who doesn't understand human factors is frankly, incompetent at their trade.

    --
    Please do not read this sig. Thank you.
  104. Rearchitect? by Jay+Juch · · Score: 1

    I realize such an endeavor is both daunting and expensive but you may want to assess your list of issues around this topic. I've worked in several mature products and the differences are quite startling. Good architecture not only prevents issues from getting in but encourages great code.

    If you don't have a detailed architecture document, this would be priority number one. As you write this document you'll also be building up a laundry list of the uglies.

    Some of the interesting findings I've seen in past:
    1. Duplicated code. Usually a symptom of lacking modularization or lack of architecture training
    2. Change complexity - to add relatively simple change, too many files are touched. could be due to over engineering or the lack of one.
    3. Slow builds, hard to configure and test. high time for componentization. cut down on the dependencies. create mocks and emulators. implement dynamic loading/plug-ins. basically, optimizing dev testing cycle results in more testing, and better code.

  105. Perfect is the Enemy of Good by Araes · · Score: 1

    Engineers and engineering companies frequently fall into the trap that a product must be "good" before it can go anywhere. Often leads to an endless cycle of perfection without actual release.

    The OP seems to be in this mode. They could instead release a quick, simple version of their work, make it functional, and then iteratively build toward the ideal "good" as needed. Has the bonus of making product marketing happy too, as they get an early look and can say whether that was what they wanted in the first place.

    1. Re:Perfect is the Enemy of Good by Anonymous Coward · · Score: 1

      That NEVER works. I've never had to time to refactor something that was rushed out to meet a deadline -- at least not until the wheels fall off. By that point, the cost to maintain poor code has become some large multiple of the cost to do it correctly the first time. Sacrificing quality for features/schedule has always been a fool's bargain in my twenty years of software engineering. That said, I never let the perfect become the enemy of the good.

    2. Re:Perfect is the Enemy of Good by stewbacca · · Score: 1

      Doing it right the first time is terrible for job security. Or at least that's what the devs I've been around lead me to believe.

  106. Block Slashdot until after the code review by davidwr · · Score: 1

    If the code isn't good, NO SLASHDOT FOR YOU!

    --
    Knowledge is how to play a game, intelligence is how to win, wisdom is knowing what game to play.
  107. lack of ethics by luis_a_espinal · · Score: 3, Insightful

    As one who has plied this trade for decades, I'll tell you that programmers are human beings, just like everyone else.

    We urge for recognition, and we need money.

    You just do not tell us to do what you want us to do without recognizing the hard work we have put into debugging the products.

    And you will not go anywhere if you do not pay us.

    If we need recognition in order to do work of acceptable quality, we have an ethics problem. For people with a sense of professional ethics, recognizition and remuneration are pre-conditions for staying at a company or project. But they are never pre-conditions for doing developing software with a professionally acceptable level of quality. Professionals leave, when the time is right, when they feel unrecognized or underpaid. But they do not deliver shit.

    Barring the unavoidable hacks that must happen here and there, software professionals with work ethics do not deliver shit even when unrecognized or underpaid. The greater problem in the software industry is not the lack of recognition (and certainly not the lack of good pay). It is the scarcity of developers with a sense of work ethics.

  108. well, it's better than endless dupes... (sort of.. by Thud457 · · Score: 1

    Ask Slashdot: How To Convince A Team Member That Thinks The Code We Write Isn't Good?

    --

    the preceding comment is my own and in no way reflects the opinion of the Joint Chiefs of Staff

  109. Hard to do by Murdoch5 · · Score: 1
    I would say make a loose standard, Only include major visual aspects such as brackets or control blocks. Make sure you comment the code very well so it's useful. The main issue I have when I have to look at other peoples code is mainly the fact that 99% of the world can't write a good comment that has any use. I think comments are the most mistreated and misunderstand concept in programming. I'm going to completely disagree with every programming book, prof and professional developer out there! A good comment needs to explain what you were thinking and why you thought it and how it works, anything else is not effective. For instance, this is from my working code

    /* loops forever looking to see if a message queue exists,
    * looping every 10 seconds to see if it exists
    * if it does it continues in the program,
    * otherwise it loops forever */

    This is an example of how to write an effective comment that explains what's going on, how the structure works and why it works the way it does, most code I've seen wont even put that comment there, leaving a new team member to have to look at it for a period of time longer then needed to figure it out. I also think people don't comment enough, a comment should be at any line that isn't simple enough where a non coder can sit down and figure it out with in a few seconds.

    So in my opion, focus on making effective and good comments, not a ton of code structure, formatting, characters in a line, editor to use etc... etc... etc... and NEVER include spelling. Any developer who gets mad at a spelling mistake shouldn't code, a spelling mistake that doesn't break the code doesn't matter. Spelling errors matter in documentation and legal defence not code. Also overall have fun, I find alot of standards have no fun in them, locking a standard into a military strict format just takes the fun out of coding, having to worry about every little thing with no freedom doesn't help to create an effective coding enviroment.

  110. Re:From today's TheDailyWTF by luis_a_espinal · · Score: 4, Insightful

    2) Writing very clean code, and then keeping it clean, does NOT save you time in the long run. While it does reduce bugs and (in theory) makes it faster to add features in the future, the length of time it takes to write the code in the first place exceeds the time saved by fewer bugs, and the future features must also be clean, which *always* requires more refactoring than you would expect.

    That is an excellent point. But I would counter that the aim is not reduce time of delivery, but to control risk (and ergo, cost). As a business, I would prefer to know that something will consistently take me, say, 4 weeks, of testing and delivery with fewer bucks, than knowing I could "deliver" in half the time, but with a "hidden", hard-to-quantify, highly variable cost of defects, maintainance or extensions.

    With the former case, I can consistently ballpark the cost and ROI. With the later, it's like driving while blind.

  111. I went through a similar issue about 4 years ago by BeSharps · · Score: 1

    I went through this very thing when I first started at the company I work at now almost 4 years ago. The company was fairly small, but was in the process of significantly growing (when I was hired, it was about 20-30 people, now it is around 70-80). The software manager, who I had worked with previously and had brought me in, wanted to bring in better processes including test plans, unit tests, continuous integration, common tool base, etc., had just recently started at the company, was overwhelmed with work, and had very little support from above and below. It was bad. There was no QA. There were no dedicated testers. There were no unit tests anywhere. Plus, the company was on the verge of a fairly large increase in the number of projects that needed software support, and had just suffered a fairly catastrophic failure of their core product on a major project (the company would have folded if it was a product company, fortunately as a services oriented company it was able to remain afloat and even profitable over this time).

    The way we have approached it has been to incrementally improve things over time. I would say there were very few wide sweeping changes done.Little by little, we added personnel (a dedicated tester was added right away, a QA manager 2 years ago, and a senior tester one year ago). Little by little, we improved processes (added a Development Guidelines and Practices wiki-page to outline how we do our work right away. Created a development environment setup procedure. Slowly and continuously developed build, installation, and deployment procedures. Maintained design documents by adding a little to them each week, etc.).

    On the development front, we started using Bugzilla, adding it to the core work flow - you did not write any lines of code without a bug (either issue or enhancement) being in place first. The code base was spread across Java, Matlab, Embedded Linux applications, drivers, and kernel c and c++ code, as well as custom firmware originally developed by a 3rd party contractor in c. A re-write would be impossible, and like the original poster, there would be no way to meet deadlines if we were to do it. We put in place a release process, and integration test plans for the core products. We also started to better utilize shared code between projects, adding a "common" pacakge for Java code that is built into every application, and a shared repository for both the embedded firmware and Linux source to share algorithms and processes between them.

    Our approach on improving the code quality was 3 fold:

    1) Brought in unit-test frameworks for all software components. C-Unit for embedded c, TestNG and UISpec4J for Java, slowly built up unit test firmware binaries for the custom firmware code. Note that this was done over the first 2 years, not all at once. The embedded firmware was core to our company, so we started there. Any new code developed would always have unit tests created for it. If we had to fix bugs, a unit test would be created to re-create it before fixing it.

    2) For old code, we slowly cleaned it up. It was simply a mess, especially the embedded firmware. It was basically a giant pile of monolithic code with no concept of modularization or testability. Our approach here was to slowly evolve the code into a better design. If we found a bug, as noted above, we would add a unit test for it first. When we fixed that bug, we would spend an additional 2-3 times the amount of time fixing the area of code affected, both design and implementation. Slowly, the code became more modularized, more robust, and much easier to work in. We can add features in half the time it used to take, with far less bugs and much less

    3) Any new application were done right from the beginning - incremental releases, unit test coverage, test plans, etc. It was a slow process improving what already existed, but new projects. Developers who were not onboard with this were phased out, with new developers hired to replace them.

    I would say it probably wasn't until about 2 ye

  112. Re:From today's TheDailyWTF by UnknownSoldier · · Score: 3, Insightful

    > Trying to force your preferred coding style on to developers who operate differently will never end well. Unless you are uncommonly versatile, adapting yourself to a standard you hate will also not go well.

    The better programmers leave their ego at the door. As Neil Peart brilliantly said recently:

    Q. I think that a lot of people are surprised to learn that you still take drum lessons. You're seen as this drum master by most everybody.
    A. What is a master but a master student?
    http://www.rollingstone.com/music/news/q-a-neil-peart-on-rushs-new-lp-and-being-a-bleeding-heart-libertarian-20120612

    If programmers have that much ego, it is probably better that they leave since they have shown that they aren't interested in learning a different perspective. (This can apply to both the young-whipper-snapper or old-crotchy ones equally.)

    Every time I was forced to use a new coding style I initially disliked it. But I always was able to put my ego and biases aside and ask myself:

      * What are the advantages of this way?
      * What are the disadvantages?

    Only by understanding BOTH answers can one really grok what works and what doesn't work. The rationale is more important then the rules.

    The same thing applies to naming conventions.

    Likewise, I've worked on code where there NO getter-setters allowed at all, where you MUST write getter-setters (even trivial ones), and ones where there no trivial getter-setters. The 3 different styles made me appreciate the different trade-offs.

    > 1) Hastily-written code makes the trade show date
    > 2) Writing very clean code, and then keeping it clean

    Yes, completely agree there are 2 extremes:

    * Ship it
    * Over-Engineer it

    > Successful businesses will find a happy medium between these two extremes,

    Again I concur 100%. A pragmatic programmer knows when to just "let it go" and when to "rip everything out" -- the code is good enough, and when to re-architect, re-engineer, re-factor, etc. because the original code no longer solves (or handles) a different set of requirements.

    It is a tough balancing act but there is one general guiding principle.

    If you can achieve the same solution with less code then that is preferred. Less code has less bugs, and less edge conditions.

    Smaller code is usually more beautiful then Large code. :-)

  113. Re:From today's TheDailyWTF by phantomfive · · Score: 1

    Writing very clean code, and then keeping it clean, does NOT save you time in the long run.

    There are different definitions of clean, but your definition is wrong. You didn't say what you think clean code is, but if it's taking you more time, then you are definitely doing something wrong.

    --
    "First they came for the slanderers and i said nothing."
  114. Re:Fire your boss. by Titus+Andronicus · · Score: 1

    As others have said or implied, the OP's question is itself incorrect. The actual question is about how to get management to buy in.

    Have your management read the relevant sections of the following: (1) Steve McConnell's Code Complete, (2) Chris Sterling's Managing Technical Debt.

    If management can't or won't learn these lessons, then I can't emphasize enough how correct the P, GP, and OP posts in this thread are.

    There are many ways to have management terminated or shoved aside. Go to the targeted manager(s)' boss(es). Or go to the boss(es)' boss(es)' boss(es), etc. Go the board of directors. Go to the investors. Or if management has engaged in illegal activity, report them to the proper authorities, etc. However the OP goes about having his management terminated, he is morally required to do it for the long term benefit of the investors. The investors' long term interests must come first.

  115. Jenkins Continuous integration game by hli · · Score: 1

    see https://wiki.jenkins-ci.org/display/JENKINS/The+Continuous+Integration+Game+plugin
    Continuous integration, together with a basic set of automated tests, ensures good quality all the times. And the game ensures that all participants want to get a good score :)
    Maybe you can add some (very basic) static code analysis - just some rules where everybody agrees that they are essential for good code.

  116. Education by plover · · Score: 1

    There are a lot of ways to improve software quality. Some are cheap and easy. Others are hard and organizational.

    • Static code analysis. Use a tool like Coverity, Klocwork, or Fortify. Get your manager to make them fix the bugs those tools reveal. It's a cheap and easy way to dramatically reduce existing bugs.
    • Code quality metrics. Use McCabe Complexity, the Maintainability Index that comes with Visual Studio, or download a copy of sonar, or whatever fits your environment. Use them to convince other developers that your code is not of high quality. If they don't believe in the tools (lots of people discount them) run them and show them in real time how the tool instantly zooms in on the modules you all know and agree are the real stinkers. As a group activity, refactor one of them, so they can all see how it becomes simple. It demonstrates why the code is bad, and how you can make it better. But don't force everyone to meet a complexity standard of 7 for every module - that's one of those ridiculous management ideas. Just use the tool to make some improvements for a while.
    • You need to be really good. Learn the SOLID design principles. Learn design patterns. Learn object-oriented design. Even if you don't buy into them as a religion, those are the concepts that underlie most readable, maintainable, high quality code. Be able to speak the language to anyone who will listen.
    • Write Automated Unit Tests. Learn how a good test serves as documentation for calling a method. Learn how hard it is to write a good test unless the code is well written, and then you can see how easy it is to write a good test. Start your code reviews by following the calls from the unit tests. But AUT are really hard to write if you've never done it before, or if you're trying to add tests to existing bad code. I highly recommend Michael Feathers' book Working Effectively With Legacy Code.
    • Use Test Driven Development. TDD forces you to think of your methods' testability first, which drives you to make decisions that keep your code tightly cohesive and loosely coupled. You think in terms of interface, and dependency injection, not in giant displays of ladder logic and inherited functionality. Besides, your valuable automated unit tests will fall by the wayside unless you keep them up. TDD is how you encourage teams to keep them current.
    • Use code reviews. Your code reviews can look at the output of the static code analysis tool, and make sure they're cleaning up the egregious errors like null pointers or off-by-one arrays. The reviewers can look at the quality metrics for identifying problem code. They can look at the automate unit tests to see if they're effectively proving the code works. And you can use the review as a time to pass on the wisdom they are missing.
    • Use management for good instead of evil. Get their focus on software quality. Get them to agree that software quality is a problem, and that you have a plan to do something about it. Get them to agree that producing good code now is more important than meeting arbitrary deadlines with bad code. Get them to agree to spend a bit more on projects so you can do TDD and AUT. And get them to push that message down to the developers.

    If it's just you, and you don't have strong management support, you'll have to start small and build up a group of allies who think as you do. Demonstrate how quality code is written instead of just asking for it. Mentor people to help improve their skills, and spread it. If you need the quick and showy splash of a new initiative, hire a new software engineer from outside the company who already does these things, and who is willing to help you implement them.

    --
    John
  117. Yeah by Safety+Cap · · Score: 2

    I used to work for a company that produced avionics software. Obviously, we had to write solid code.

    The On-Board Shuttle group is (was) even more bad-ass than that. For them, 5 9s (99.999% failure rate) was unacceptably lax.

    FTFA:

    But how much work the software does is not what makes it remarkable. What makes it remarkable is how well the software works. This software never crashes. It never needs to be re-booted. This software is bug-free. It is perfect, as perfect as human beings have achieved. Consider these stats : the last three versions of the program -- each 420,000 lines long-had just one error each. The last 11 versions of this software had a total of 17 errors. Commercial programs of equivalent complexity would have 5,000 errors.

    --
    Yeah, right.
  118. Process is about religion not logic by drew_eckhardt · · Score: 1

    The fundamental problem is that this is a religious issue for both engineers and managers. People generally don't believe until they personally witness the miracle of rapid development with predictable schedules and low customer visible defect rate.

    Working solutions in order of increasing time + difficulty:

    1. Quit and either start a new team or join an existing one with decent development practices (I insist on a code and test process walk through of every company I consider joining to avoid unpleasant surprises. Obviously this fails for groups yet to build a product, and sometimes teams panic when pivoting and abandon reasonable practices).

    2. Get promoted to a leadership role while you remain hands on. Tell every one else to do the right thing like you're doing - getting people to buy in is easiest when you're not making them do something you won't like the case would be with a non-coding manager. Most people fall into line with direction from above. Peer pressure works for most hold-outs. Any one not getting with the program can be replaced.

    3. Do the right thing on your code. With your process producing a faster more predictable release cycle you'll have higher productivity and can take over an increasing fraction of the product so the bad people with bad process have less impact.

    Applying test driven development variants to new features/subsystems/products helps a lot here because it makes shipping without good test coverage and short predictable cycle times impossible because no product code exists without the necessary infrastructure. While a "code complete" milestone may be farther into the future depending on how that's defined the total time to deliver the project will be lower and ultimately it's the ship date that matters.

    Do the same for bug reports. Every reproducible bug gets an automated test case (if it broke the first time it's complicated enough to break again).

    After a couple years you should be in good shape with enough infrastructure that the cost to add test cases is effectively zero before their benefits are considered (Perhaps most notable is that the requirement for incremental testing leads to cleaner interfaces which make complexity more linear with respect to project size. That in turn produces a lower defect rate, faster turn around time on repairs, and makes defect rate/time to repair more constant and predictable) and you don't have to worry about new people (or old people who haven't touched a piece of code in a while) breaking things accidentally.

    Here are some things which don't work:

    1. Talking to your co-workers about doing the right thing

    2. Providing anecdotes (personal and otherwise) from other companies about the benefits

    3. Buying everyone a copy of a book like

    _The Clean Coder: A Code of Conduct for Professional Programmers_ by Robert C. Martin

    http://www.amazon.com/The-Clean-Coder-Professional-Programmers/dp/0137081073/

    Quote:
    The jury is in!
    Te controversy is over.
    GOTO is harmful
    And TDD works

    in their choice of print or Kindle edition with the direction to read it on "company time."

    4. Doing the right thing and providing metrics on things like defect rate, time to repair certain classes of bugs, number of release candidates for a feature, etc. This can be very striking - memory corruption bugs made reproducible by the test environment so you fix them in 30 minutes versus three weeks for co-workers' similar bugs, a major subsystem with no QA or customer visible bugs or just one of each, etc.

    Logical people would get on board after seeing such evidence, but this is about religion not logic.

  119. Lean from others' mistakes by sbjornda · · Score: 1

    Have a regular chin-wag about the ugly stuff seen on thedailywtf.com

  120. Get out at a time of YOUR choosing by Anonymous Coward · · Score: 1

    I hate to admit it, but it is true. You probably won't find a way to fix this company. Work hard while there, but find another job. Soon.

    Once a company gets into the downward spiral, the bean counters say they can't afford 1 minute or 1 dollar that doesn't produce direct revenue. Management and bean counters set the features and delivery dates too tightly, quality slips further, and it just gets worse and worse.

    Before the crash and before I was forced into early retirement by yet another round of management hired in to try the latest whiz bang development paradigm I described it to management thus: We are being shot at with BB guns. One hit won't kill us, but 100,000 will, and it is a very painful death.

    What was once a 200 man company now exists as a one man fire fighting shop trying to keep customers, inside what was a fortune 500 company who's capialization has shriveled to insignificance.

  121. Been there, .. by Mr2cents · · Score: 1

    I used to work on a project that shows some similarities. Ad-hoc coding, feature creep, heavy time constraints, overly complex code, ... Don't expect miracles. If you start with a heap of dung, it is never going to smell good.

    I sent an e-mail to my manager detailing 4 of the most critical problems. Fortunately, he was wiling to hear them, and we made some changes that improved the situation. But when I left there was still a scheduler (to start and stop machines at specific times) that was never rewritten. It was funny, the day I left I found the e-mail again, and then I heard a fellow-engineer had been assigned to make a trivial change to it. Expected amount of work: two weeks.

    If the problems lie deep, it is wishful thinking that you can simply fix it. In a perfect world, you would start over again. In reality, there are all sorts of constraints. Here are some tips:

    Analyze the project history: try to discover what files are changed the most, what kind of changes are mostly requested, are there modules that produce a spray of bugs whenever they are touched etc. (you do have a bug tracking system, right? If not, get one now!).

    With that analysis, try to isolate some pieces of problematic code. Remove all sharp objects from your desk while doing this, because you might want to poke your eyes out. Focus on a part that changes a lot and see how you may fix that. To give an example: every time new menu options had to be added, the guy who wrote that became pale and mumbled something and went off to implement it. A few days later it became available, with some bugs like wrong menu's popping up. So when I tried to find out what was the problem, it turned out that every goddamn menu-item had a hand-coded position ID. so if a new item had to be inserted, all the next menu's needed their id's to be incremented, and all references to those id's updated. Using some rather advanced macro's (including concatenations), I managed to clean that up. It's not cleanest solution, but it only took me 2-3 days to implement, and after that, new menu's could be added in no time and without bugs. Also, anyone could add them.

    What I want to say with this: you may improve the situation without making extremely drastic solutions. If you make just a couple of such changes, these can already have a drastic impact on development time. More importantly, it will not go unnoticed, and change the dynamic of the team and management. People will start asking the right questions: how can we further improve the situation? At that moment, your voices will be heard much louder.

    If there are no test cases (as was the case for me too), you have to reconcile with the fact that it's too late. Try to add test cases for new modules, but realize that retro-fitting unit tests to a large project with low-quality code is not realistic. The next best thing might be adding assertions wherever you encounter bugs. Also adding sanity checks (e.g. testing if large object trees contain valid data) may prove helpful in debugging.

    I hope that helps, and best of luck.
    Any further criticism/advice is always welcome.

    --
    "It's too bad that stupidity isn't painful." - Anton LaVey
  122. Re:You don't by Mr2cents · · Score: 1

    +1 for the Hungarian Notation. It only creates problems, if you don't know a variable's type you just use the code editor to find out. HN is only possibly useful if you use notepad for writing code, and even then I'm being generous.

    --
    "It's too bad that stupidity isn't painful." - Anton LaVey
  123. Public Code Reviews and Named Bug List by obscuro · · Score: 1

    Your team members are clearly not feeling the cost of their failure or the benefit of better practices. Schedule a 1.5 hour meeting where you go over the worst code that week and the best code that week. When bugs show up in a release track them back to the developer(s) involved and rename the bug to include their names.

    Identify WHAT DEVELOPERS NEED TO LEARN OR CHANGE during each code review and provide the resources for them to learn the better practice.

    Pay bonuses for good code and good practices. If you're afraid that some people will quit... don't be.

    --
    Every rule has more than one consequence.
  124. Change jobs or transfer by carys689 · · Score: 1

    Been down this path many times and all it does is cause endless self-grief and hopelessness, primarily due to lack of upper management support and resistance from peers. I will tell you what has worked: get in on the ground floor of a project as the tech leader, establish and ENFORCE "good" quality and process standards. You may not become "best buds" with the others because of this, but they'll either toe the line or move to another project or company. Either way, the project will be better for it.

  125. What about bad code that works? by eap · · Score: 1

    I agree, code reviews are the best way to identify shitty code. What if the code is bad, but the bugs aren't really provable? Let me give some examples.

    I've seen this happen, especially in old code. The code works, but it's full of 2,000-line God Classes, dangerous half-objects, and doThisThatAndTheOther() void methods. Young developers are happy with it because it works and they continue writing the same kinds of idioms.

    Arguing for change in code this bad will require a rewrite, which is hard to justify if you can only find potentially dangerous behavior vs. real bugs. Your only argument comes to, "Yes, the code works, but down the line this catch Exception block could result in unpredictable results." Folks who don't have years of answering to customers when these problems manifest don't see the danger.

    Shirley, someone else must have been in this situation before.

    1. Re:What about bad code that works? by swillden · · Score: 1

      Rule #1: Do no harm.

      Rewriting code because it's ugly and nasty is almost always a bad idea. Leave it alone. Focus your code improvement efforts on new code, preventing more of the badness from being created. And even there, if the ugliness is deeply ingrained in the culture you have to start small. If you're given a huge pile of ugly code to review, start by asking for small improvements. Extract a set of subroutines from a 400-line method. Factor a God class into a Lesser Deity class plus a couple of support classes, that sort of thing.

      If you're the lone voice of experience among a group of young developers, you may have to teach by example, at least to begin with. Have them review your code -- because yours can also be improved -- and along the way they'll learn some things.

      You can also start to develop a culture of code excellence. Organize some lunch study sessions in which you study some good books as a group -- Design Patterns, Refactoring, Test-Driven Development, etc. Don't make these mandatory (assuming you're even in a position to do so), but it's very likely there are a few developers who are interested in improving their skills and learning cool new things. See if you can organize a committee of people who are interested in better code to propose other ideas to create a culture of healthy code.

      This is all a lot easier if you're in a bigger shop, of course. If there are only three of you and the other two think you're interest in code quality is silly, and management doesn't care, your best bet is to suck it up and live with it or find a new job.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
  126. Good Code is independently tested and reviewed. by Summitlake · · Score: 1

    Writing good code isn't just writing clean elegant code with state of the art tools. Programmers have to be fundamentally convinced their code works. Quality assurance people have to be fundamentally convinced they can break the code. If your company is willing to take formal QA/QC seriously, QA needs to be established independently. Set up a small QA operation, make sure they are trained to learn how the code and interface should work better than the end users, send them to a quality assurance refresher course if needed, and give them "teeth." The CEO has to be enthusiastically involved and supportive if you're going to get a healthy and productive balance between two independent departments.

  127. Re:From today's TheDailyWTF by Bengie · · Score: 1

    I was going to say.. Around here, 6 months is "fast", 1 year is more typical.

  128. Feedback by cwsumner · · Score: 1

    Tell them that if the code fails, they will be the one to have to fix it at 3AM.

    Having a separate group fix the bugs, is a Bad Thing. 8-)

  129. Generate numbers to share your concern by ArunSaha · · Score: 1

    I fully understand what you mean, but unfortunately, "code is complex" is a very subjective statement. Something complex to you may not be complex to your team member. So, everyone need to arrive on a common ground on what is considered "complex."

    One widely accepted metric to measure is complexity is the cyclomatic complexity or McCabe complexity. [http://en.wikipedia.org/wiki/Cyclomatic_complexity]

    There are free and open source tools to compute cyclomatic complexities of your code base. Using a tool, you can find out complexities of functions, files, directories (by adding that of files) etc. Then find the top-10 in each category. My favorite is the top-10 complex functions.

    Install a cronjob to perform this computation every day.

    Track which functions are increasing complexity.

    Have all this information readily available in a intranet website and share that link to the team (couple of times!).

    I am pretty confident (have done it myself) that this will bring some improvements (may not be as much as you want).