Slashdot Mirror


Why Software Builds Fail

itwbennett writes: A group of researchers from Google, the Hong Kong University of Science and Technology and the University of Nebraska undertook a study of over 26 million builds by 18,000 Google engineers from November 2012 through July 2013 to better understand what causes software builds to fail and, by extension, to improve developer productivity. And, while Google isn't representative of every developer everywhere, there are a few findings that stand out: Build frequency and developer (in)experience don't affect failure rates, most build errors are dependency-related, and C++ generates more build errors than Java (but they're easier to fix).

279 comments

  1. Because I'm lazy by OzPeter · · Score: 5, Informative

    Half the time when I'm working on any sort of non-trivial program (that is too large to hold in my head all at once) and I need to make a breaking code change (and one that is not easily managed with refactoring tools), I'll make the change where it is obvious to me and then let the compiler tell me where it broke and hence where I need to make my fixes.

    --
    I am Slashdot. Are you Slashdot as well?
    1. Re:Because I'm lazy by Z00L00K · · Score: 2

      The most important thing is not to avoid that the build fails but to avoid distributing software packages that can't be built.

      However if something can't be built due to a mistake it's often easy to find and correct. The big problems are often not that visible and it can take a while to figure them out.

      What really grinds my gears is that people release source code that is possible to build, but so full of compiler warnings that you can't be certain that it's going to work as intended.

      --
      If builders built buildings the way programmers wrote programs, then the first woodpecker would destroy civilization.
    2. Re:Because I'm lazy by Anonymous Coward · · Score: 0

      Half the time when I'm working on any sort of non-trivial program (that is too large to hold in my head all at once) and I need to make a breaking code change (and one that is not easily managed with refactoring tools), I'll make the change where it is obvious to me and then let the compiler tell me where it broke and hence where I need to make my fixes.

      That works until you throw in Spring or JSF or somebody's custom reflection code. Then there are developers who insist on passing everything around as strings or untyped arrays. Or XML. I've tagged other developers' code for that and been told, "That's what testers are for!" Ugh.

    3. Re:Because I'm lazy by mlts · · Score: 3, Interesting

      When in CS, I had a prof that had one rule that for release (not beta/alpha/dev) code, if the code had even a single warning, it was unshippable unless there was an extremely good reason (which would be part of the README) of why it happened. Yes, this was a PITA, but he was trying to teach something that seems to have been lost.

    4. Re:Because I'm lazy by 0123456 · · Score: 5, Funny

      He's the reason compiler writes invented pragmas to turn off warnings...

    5. Re:Because I'm lazy by turgid · · Score: 2

      When in CS, I had a prof that had one rule that for release (not beta/alpha/dev) code, if the code had even a single warning, it was unshippable unless there was an extremely good reason (which would be part of the README) of why it happened. Yes, this was a PITA, but he was trying to teach something that seems to have been lost.

      You should be compiling with warnings as errors as soon as you start coding, and you should fix each one as they occur before you move on to write the next line of code.

      Putting off fixing these problems leads to bloated and fragile code and wastes much more time debugging and fixing later.

    6. Re:Because I'm lazy by ShanghaiBill · · Score: 2

      What really grinds my gears is that people release source code that is possible to build, but so full of compiler warnings that you can't be certain that it's going to work as intended.

      Where I work, all builds are run with -Wall -Wextra -Werror. So if you check in code that produces a warning, the compiler turns it into an error, and you broke the build. Which means you get to be the build babysitter until someone else breaks it.

    7. Re:Because I'm lazy by Obfuscant · · Score: 1

      Yes, this was a PITA, but he was trying to teach something that seems to have been lost.

      Yes, he was teaching you to turn off warnings for certain operations so that when the warning was really significant it wouldn't happen.

      Maybe if professor think your code is functional but not elegant maybe you should suggest professor write login page himself? Be crazy AND proud.

      There is a reason why they are warnings and not fatal errors.

    8. Re:Because I'm lazy by Anonymous Coward · · Score: 0

      So what you are saying is that you are better than the thousands of folks working on gcc?
      If your compiler issues a warning; chances are you should fix it as opposed to suppressing it.

    9. Re:Because I'm lazy by EvanED · · Score: 1

      Yes, he was teaching you to turn off warnings for certain operations so that when the warning was really significant it wouldn't happen.

      Is that better or worse than teaching someone to leave warnings on for those operations and then not noticing when a really significant one appears because it's buried in an avalanche of other output?

    10. Re:Because I'm lazy by geekoid · · Score: 1

      And turning off compiler pragmas are why software is such an amateur engineering field.

      --
      The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
    11. Re:Because I'm lazy by geekoid · · Score: 4, Insightful

      NO, he was teaching engineering practices, and a good one.

      People like you is why software is in such a terrible state as an industry.

      --
      The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
    12. Re:Because I'm lazy by geekoid · · Score: 1

      And it assume you can see the future and predict what will be really serious.
      There are many instances of failure becasue it didn't seem like a big deal at the time.

      --
      The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
    13. Re:Because I'm lazy by geekoid · · Score: 0

      "..build babysitter until someone else breaks it."
      Your QA/Build process is seriously broken if you don't have one person or one team in charge of the build at all times.

      --
      The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
    14. Re:Because I'm lazy by Obfuscant · · Score: 1

      Is that better or worse than teaching someone to leave warnings on for those operations and then not noticing when a really significant one appears because it's buried in an avalanche of other output?

      Worse, because when the significant one appears the code will be non-functional and there will be no compiler warning to help figure out why. It is harder to remember to go back and change the makefile (or other build script) to turn the warnings back on and then see a large number of irrelevant warnings appear (which you may think are relevant and waste time fixing without actually fixing the broken code). If you inherited the build from someone else (not a good idea in a programming class necessarily) you might not KNOW you need to go turn the warnings back on, you might just have a broken program and no warnings to tell you where to look.

      By the way, I define "significant warning" to mean "actually reports something that is going to make the program malfunction". For example, "incompatible declaration of function printf" when I forget to include stdio.h is not a significant warning because I don't care what printf returns and nothing depends on it. Should I decide to turn that one off, and then do something that actually does depend on the return value and it doesn't work, it becomes a significant warning and I want to see it. I'm reasonably competent, so I can recognize a warning that refers to a line of code I've just changed, even if there are other warnings.

      I get to deal with lots of code that has lots of warnings. I can handle it.

    15. Re:Because I'm lazy by Z00L00K · · Score: 1

      It's not a question of turning off warnings, it's a question of correcting the code to get rid of the warnings.

      If you turn off the warnings you turn off the warnings for all occurrences in the code, and that is really a dangerous thing to do. In most cases warnings are harmless but in some cases the warning is an important explanation to why something behaves in an erratic way.

      Ignoring compiler warnings is stupid, dangerous and can cause serious problems to become hidden.

      --
      If builders built buildings the way programmers wrote programs, then the first woodpecker would destroy civilization.
    16. Re:Because I'm lazy by UnknownSoldier · · Score: 1

      Why do you assume all warnings are useful?? Some of the compiler warnings are just pedantic and are "noise" such as "variable declared but not used", etc.

      There is a balance between no warnings and pedantic warnings, namely the useful ones.

    17. Re:Because I'm lazy by Z00L00K · · Score: 1

      There are even a few warnings that at least with gcc won't show up unless you use the plain "-W" flag, and even cases where they won't show up at the "-O0" level but only at "-O2". And there are a few that you have to enable explicitly.

      Add a run of "splint" and/or cppcheck to make sure that the code is as good as it can be. Then execute the binary under Valgrind to make sure that there are no memory leaks. The remaining errors should be those caused by a bad system design rather than plain coding errors. In a few cases the errors might be in third party runtime libraries, but that's hard to protect against and outside the scope here.

      --
      If builders built buildings the way programmers wrote programs, then the first woodpecker would destroy civilization.
    18. Re:Because I'm lazy by EvanED · · Score: 5, Insightful

      I'm a fan of warnings as much as the next guy, but there are plenty of times that's not practical. Even if you accept nothing else I say, there are plenty of times where third party code (say, for example, Boost...) has warning-producing stuff in it. Do you fix it and maintain your own branch? Submit it upstream, hope it gets accepted, then wait a month for the new release, then demand everyone upgrade to the latest bleeding-edge? That's often (maybe usually) not feasible, which means it should probably just disable it. Fortunately, GCC finally got around to adding #pragmas that sometimes let you disable and re-enable warnings for just the offending headers.

      But beyond that, there's also a reason that compilers have most warnings off by default. And why -Wall doesn't turn on anything close to all warnings. And why even -Wall -Wextra isn't all warnings. Because there's a gradation of false positive/false negative tradeoffs, and what's appropriate for you isn't appropriate for everyone. Do you really compile with all warnings, or do you suppress some? Because I can almost guarantee it's the latter, even if you're suppressing them through inaction.

    19. Re:Because I'm lazy by RabidReindeer · · Score: 3, Insightful

      You should be compiling with warnings as errors as soon as you start coding, and you should fix each one as they occur before you move on to write the next line of code.

      Putting off fixing these problems leads to bloated and fragile code and wastes much more time debugging and fixing later.

      What you should be doing outside the CS class and in the so-called "Real World" is "being productive". That usually means screw the warnings, it has to be completed ASAP or we'll find someone "more productive" than you are.

    20. Re:Because I'm lazy by UnknownSoldier · · Score: 2

      Generally I recommend leaving most warnings on. But sometimes compiler writers go completely over board.

      When you use MSVC you have to do stupid stuff like this

            #define _CRT_SECURE_NO_WARNINGS // WIN32:MSVC disable warning C4996: This function or variable may be unsafe.

      The following compiler specific header suffices to compile code using without warnings, at highest warning level.

      #pragma warning( disable: 4061 ) // enum value is not *explicitly* handled in switch
      #pragma warning( disable: 4099 ) // first seen using 'struct' now seen using 'class'
      #pragma warning( disable: 4127 ) // conditional expression is constant
      #pragma warning( disable: 4217 ) // member template isn't copy constructor
      #pragma warning( disable: 4250 ) // inherits (implements) some member via dominance
      #pragma warning( disable: 4251 ) // needs to have dll-interface to be used by clients
      #pragma warning( disable: 4275 ) // exported class derived from non-exported class
      #pragma warning( disable: 4347 ) // "behavior change", function called instead of template
      #pragma warning( disable: 4355 ) // "'this': used in member initializer list
      #pragma warning( disable: 4505 ) // unreferenced function has been removed
      #pragma warning( disable: 4510 ) // default constructor could not be generated
      #pragma warning( disable: 4511 ) // copy constructor could not be generated
      #pragma warning( disable: 4512 ) // assignment operator could not be generated
      #pragma warning( disable: 4513 ) // destructor could not be generated
      #pragma warning( disable: 4610 ) // can never be instantiated user defined constructor required
      #pragma warning( disable: 4623 ) // default constructor could not be generated
      #pragma warning( disable: 4624 ) // destructor could not be generated
      #pragma warning( disable: 4625 ) // copy constructor could not be generated
      #pragma warning( disable: 4626 ) // assignment operator could not be generated
      #pragma warning( disable: 4640 ) // a local static object is not thread-safe
      #pragma warning( disable: 4661 ) // a member of the template class is not defined.
      #pragma warning( disable: 4670 ) // a base class of an exception class is inaccessible for catch
      #pragma warning( disable: 4672 ) // a base class of an exception class is ambiguous for catch
      #pragma warning( disable: 4673 ) // a base class of an exception class is inaccessible for catch
      #pragma warning( disable: 4675 ) // resolved overload was found by argument-dependent lookup
      #pragma warning( disable: 4702 ) // unreachable code, e.g. in header.
      #pragma warning( disable: 4710 ) // call was not inlined
      #pragma warning( disable: 4711 ) // call was inlined
      #pragma warning( disable: 4820 ) // some padding was added
      #pragma warning( disable: 4917 ) // a GUID can only be associated with a class, interface or namespace

      Reference:

      * http://alfps.wordpress.com/201...

    21. Re:Because I'm lazy by RabidReindeer · · Score: 1

      Why do you assume all warnings are useful?? Some of the compiler warnings are just pedantic and are "noise" such as "variable declared but not used", etc.

      There is a balance between no warnings and pedantic warnings, namely the useful ones.

      One of the things that's nice about the Eclipse IDE is that you can select the importance of selected messages, all the way from "ignore" to "fatal", depending on shop standards and personal paranoia.

      However, the offline builders such as Maven and Ant cannot adopt those preferences, so it's not uncommon for a production build to spit out dozens or hundreds of warnings about things that don't actually matter.

      Working with C/C++ I almost never had clean builds, since even if I managed to clean one up, it either was because I'd created non-portable code or had satisfied the quirks of one particular brand and version of a compiler. Meaning that using any other brand or version would just cause the build to break out in a rash again.

    22. Re:Because I'm lazy by ShanghaiBill · · Score: 1

      Your QA/Build process is seriously broken if you don't have one person or one team in charge of the build at all times.

      Everyone should be familiar with the build system, and a "you break it, you babysit it" rule means that everyone rotates through the responsibility, while also providing an incentive to double check their work. I got the idea from Joel Splotsky's blog post 12 Steps to Better Code.

    23. Re:Because I'm lazy by QilessQi · · Score: 4, Informative

      I've spent many decades in that Real World. Ignoring compiler warnings and failing to write automated unit tests for edge cases can cause production defects and database corruption crises that will eat many, many more hours of productivity than simply addressing all compiler warnings. Not to mention causing poor end-user perception and increasing the workload up and down the software support and delivery chain.

      Developers whose coding habits cause such situations in real world enterprise or commerce systems are ultimately "less productive" than having no developer at all. :-)

    24. Re:Because I'm lazy by Imagix · · Score: 1

      Yep. Compile with -Wall -Werror. All warnings are now errors. If the compiler is warning you about something, it is likely that you're not telling the compiler a consistent message. "Do not try to outsmart the compiler, it will get its revenge." Rework the code so that it doesn't warn. Also, gcc has a compiler flag to tell the compiler that certain directories are "system" includes, and not to warn about stuff in them.

    25. Re:Because I'm lazy by EvanED · · Score: 1

      Actually I've had "variable declared but not used" catch mistakes on multiple occasions. I'll grant you that it generates a ton of false positives, but I'd definitely not say it's pedantic or noise.

    26. Re:Because I'm lazy by Imagix · · Score: 3, Informative

      That one's quite useful. You've declared a variable and now whomever is reading the code now has the additional cognitive load to try to figure out why that variable exists.

    27. Re:Because I'm lazy by Anonymous Coward · · Score: 0

      What about hostile co-workers who like to throw out accusations? Damn it Obfuscant! You broke the damn industry again. Your build warning are why we can't have nice things (and you smell like chicken nuggets).

    28. Re:Because I'm lazy by PhloppyPhallus · · Score: 1

      Aaaaaaah! How hard is it to include "stdio.h" from the get go? "Trivial" warnings are usually trivial to fix--and they should be fixed so that the serious warnings stand out. If you let your code develop with all warnings suppressed, than I can see how you can end up in the position where turning them on leads to hundreds of "insignificant" warnings appearing. Don't let that happen. The compiler writers and designers of the language thought long and hard about what should and should not be a warning--and most warnings are indicative of a problem that had ought to be fixed, even if it doesn't happen to cause a "significant" problem on this platform, on this data, and in this context. If you start out with warnings enabled, you learn pretty quickly how to write warning free code and it never becomes a problem. If you don't; well, then you end up with the completely avoidable and entirely self-made problem you describe!

    29. Re:Because I'm lazy by turgid · · Score: 1

      What you should be doing outside the CS class and in the so-called "Real World" is "being productive". That usually means screw the warnings, it has to be completed ASAP or we'll find someone "more productive" than you are.

      I'm having a sense of humour failure at the moment, so apologies if this was not taken in the spirit it was intended but: that sort of attitude tends to get you eaten by the Real World for breakfast.

      I've very recently found myself working for a company that has gone in that direction due to incompetent management and greedy VPs. I and my colleagues have been pressure into fixing bugs with no proper bug report, no access to the production hardware and no integration and test facilities "by lunch time" with all the corner-cutting that implies.

      The company is now paying for it, and I am on the verge of accepting a new job with another company.

    30. Re:Because I'm lazy by CastrTroy · · Score: 1

      My favorite example of this is warnings about using a variable without it being assigned a value which can usually be made to disappear by assigning a value of null to the variable. The variable is null in either case, but explicitly assigning null makes the warning disappear. A null reference exception would occur either way. Also, the warning still appears even if the use of that variable is an if statement checking if the value is not null.

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
    31. Re:Because I'm lazy by bythescruff · · Score: 1

      "Variable declared but not used" isn't noise. If you declared a variable, that means you thought you'd need it. If it turns out you didn't need it, then your understanding of your code evolved while you were writing it, and you didn't clean up your code to match. If you missed one loose end, there's a good chance you may have missed others as well.

      Also, unused variables reduce readability.

      --
      Chuck Norris: Socialism == a thousand years of darkness.
    32. Re:Because I'm lazy by chis101 · · Score: 3, Informative

      If you are talking about C/C++, the variable is *not* null in either case. If you assigned null to it, then it is null. If you never assigned any value to it, then it is whatever happened to be in memory at that location. It's a pretty good warning to let you know you are using a variable without it being assigned a value.

      int* ptr;
      if( ptr != NULL )
      {
      *ptr = 0;
      }

      This code will at some point crash. Maybe not on the first run, but at some point ptr will not be null, but will not be a pointer to valid memory.

    33. Re:Because I'm lazy by EvanED · · Score: 1

      I'm reasonably competent, so I can recognize a warning that refers to a line of code I've just changed, even if there are other warnings.

      My counterargument would be that I think this sounds very error-prone. I don't think it's a matter of "competence", I think it's a matter of "I just changed a header and now it's rebuilding 100 files and so noticing a new warning requires scanning thousands of lines of output."

      The one thing I'll grant is that there's an opposite direction you can go. Instead of disabling warnings you don't like, if you -Werror those that you [i]do[/i] like, that's also sufficient.

      Let me ask this: do you have on all warnings when you build? Unless, on GCC for C++, you're passing -Wall -Wextra -Wabi -Wctor-dtor-privacy -Wnon-virtual-dtor -Weffc++ -Wstrict-null-sentinel -Wold-style-cast -Woverloaded-virtual -Wno-pmf-conversions -Wsign-promo -Wformat=2 -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wsync-nand -Wtrigraphs -Wunused -Wstrict-overflow=5 -Wfloat-equal -Wundef -Wshadow -Wunsafe-loop-optimizations -Wcast-qual -Wcast-align -Wconversion -Wlogical-op -Waggregate-return -Wno-attributes -Wmissing-declarations -Wmissing-noreturn -Wmissing-format-attribute -WWnormalized=nfkc -Wpacked -Wpadded -Wredundant-decls -Wunreachable-code -Winline -Wno-invalid-offsetof -Winvalid-pch-Wdisabled-optimization -pedantic? (Possibly there are a couple redundant ones there, but GCC has lots of warnings included in neither -Wall nor -Wextra.)

      If you're not passing those to GCC, what that means is that you have, implicitly or not, decided that the cost-benefit ratio of the warnings you are not enabling is not in favor of enabling them. Well, saying "there are too many of these warnings, I'll disable them" is making the exact same decision: that the cost-benefit ratio of leaving that warning enabled is not in your favor.

    34. Re:Because I'm lazy by Anonymous Coward · · Score: 1

      #pragma warning( disable: 4355 ) // "'this': used in member initializer list
      #pragma warning( disable: 4505 ) // unreferenced function has been removed
      #pragma warning( disable: 4510 ) // default constructor could not be generated
      #pragma warning( disable: 4511 ) // copy constructor could not be generated
      #pragma warning( disable: 4512 ) // assignment operator could not be generated
      #pragma warning( disable: 4513 ) // destructor could not be generated
      #pragma warning( disable: 4610 ) // can never be instantiated user defined constructor required
      #pragma warning( disable: 4623 ) // default constructor could not be generated
      #pragma warning( disable: 4624 ) // destructor could not be generated
      #pragma warning( disable: 4625 ) // copy constructor could not be generated
      #pragma warning( disable: 4626 ) // assignment operator could not be generated

      Those ones are actually useful if you actually know C++.

    35. Re:Because I'm lazy by Obfuscant · · Score: 1

      Aaaaaaah! How hard is it to include "stdio.h" from the get go?

      Who cares? How is it relevant to the issue? That was an example, not an exhaustive list of all possible sources of warnings.

      "Trivial" warnings are usually trivial to fix--and they should be fixed so that the serious warnings stand out.

      I deal with code that has thousands of trivial warnings, and I can tell you that trying to fix them all is NOT trivial. I'm guessing that many of those warnings come from using a different compiler, but I don't know. I have enough to deal with fixing sloppy code that was written using a compiler that silently ignores some ridiculous parameter values but is now being compiled on one that doesn't validate them at all. (gfortran vs. PGI fortran. One compiler designed to support novice programmers, one designed to run as fast as possible. One ignores a -1 when told to copy a string, the other copies MAXINT characters...)

      The difficulty, or ease, of changing code to remove a warning message has nothing to do with the fact that it is a warning and not an error for a reason.

      If you let your code develop with all warnings suppressed, than I can see how you can end up in the position where turning them on leads to hundreds of "insignificant" warnings appearing. Don't let that happen.

      So don't create an environment where is it beneficial to disable warnings. If you notice, I'm arguing against the disabling of warnings. I said it was worse than leaving them.

    36. Re:Because I'm lazy by EvanED · · Score: 1

      If you start out with warnings enabled, you learn pretty quickly how to write warning free code and it never becomes a problem.

      "Never" is strong, because compiler writers release new versions that change things that get warned about. You can have software that works wonderfully now, but next compiler upgrade generates 20 bazillion warnings. If you compile with -Werror, now you've got a big effort getting to the point where you can use that compiler.

      Not that I disagree with your overall message. :-)

    37. Re:Because I'm lazy by Obfuscant · · Score: 1

      It's not a question of turning off warnings, it's a question of correcting the code to get rid of the warnings.

      There are two ways of getting rid of warnings. You can either change (potentially a lot of) code, or you can turn off the warning. The fastest way to get rid of them is turn them off. Then you never have to deal with or explain them again.

      If I had a boss that said I had to justify and document every warning in the code I work with, and I couldn't turn them off, I'd never get anything productive done. I'd be spending days pouring over someone else's code, making significant changes, and then have to do it all again when the next version or patch comes out. What a waste of time, for code that runs perfectly fine.

      If you turn off the warnings you turn off the warnings for all occurrences in the code, and that is really a dangerous thing to do.

      Why do people keep wanting to lecture me that turning off warnings is a bad thing to do when I haven't said it is a good thing to do? I think I said that I'd rather see the warnings than not. Pretty sure I said that. Yep.

      Ignoring compiler warnings is stupid, dangerous and can cause serious problems to become hidden.

      No, ignoring specious warnings is a reasonable thing to do, and it is turning them off that makes them become hidden, not ignoring them.

    38. Re:Because I'm lazy by Obfuscant · · Score: 2
      Is "software" a science, and engineering practice, or is it an industry?

      People like you are what gives people who say "people like you" a bad name.

    39. Re:Because I'm lazy by Forever+Wondering · · Score: 1

      I prefer the warnings and use -Werror for my code.

      However, adding -Werror to a library/whatever that the you don't [intend to] control/maintain that has lots of "benign" warnings just causes the headaches that you suggest. But, it leaves the code fragile/open to a bug that the compiler could help with.

      But, it's the upstream developer's responsibility to fix the warnings which usually involve less hardship than not fixing them. You never know when it's trivial vs. uncovering a genuine bug. If all the trivial warnings are fixed, it allows more eyes on the problem. If I take over responsibility for a code base, the first thing I will do is fix the warnings [usually takes just a few hours]. By doing so, I've found genuine bugs. Otherwise, these get lost in the noise of the false positive warnings.

      Case in point. I had some code that wasn't working. Built clean with gcc using -Wall. Couldn't see it visually despite several goings over. Finally recompiled with clang [thinking it might be an optimizer bug of some sort]. clang has some warnings that are default on with -Wall that gcc doesn't turn on. The code that was wrong, from several thousand lines, and trivial to see by inspection if you're zeroed in:

      if (foo);
          bar = 5;

      clang flagged this as an "empty if" clause. I've since added the explicit -W option for gcc builds.

      --
      Like a good neighbor, fsck is there ...
    40. Re:Because I'm lazy by ILongForDarkness · · Score: 1

      Exactly. I routinely break a build to find errors. Want to refactor something? Remove the code it depends on and try to build. Now fix the compile errors. Much easier than trying to make all the dependent code not need the dependancy and then removing it especially when playing with >500k lines of code as I do routinely (you just can't remember to fix everything reliably even when it turns out you did know the full set of places where it was used).

    41. Re: Because I'm lazy by LocutusOfBorg1 · · Score: 1

      "null" is just a set of '0' in the value. the probability is really low (1/sizeof(ptr)) but it can randomly be null

    42. Re:Because I'm lazy by Archangel+Michael · · Score: 1

      Before I start, I am not a coder. Never really wanted to be one, but I do understand the principles.

      If "int* ptr;" returns any value that is inconsistent it is a problem IMHO. This command should return the exact same value every time, even if it is (empty or zero or whatever).

      But then again, there is probably a valid reason why it is inconsistent, and that is why I hate programming. :-P

      --
      Agent K: A *person* is smart. People are dumb, stupid, panicky animals, and you know it.
    43. Re:Because I'm lazy by bberens · · Score: 2

      This doesn't work well if/when you do something like upgrade you compiler version and code that was previously non-warning producing now produces warning. For example, I work on an older Java system that has a few million lines of code. Most of the older code does not use generics, however the modern Java compilers will throw a warning for all that old code. The old code works just fine and there's nothing wrong with it. It would be nice if it used generics but there's not a lot of sense in going back and updating millions of lines of code, some of which may not even work properly with generics. So for that entire codebase we suppress the warnings about generics.

      --
      Check out my lame java blog at www.javachopshop.com
    44. Re:Because I'm lazy by NormalVisual · · Score: 2, Interesting

      Rework the code so that it doesn't warn.

      The problem is that sometimes that's not an option. For instance, a few weeks ago I was working with some code in VS 2010 that used named enums. Even though Intellisense was smart enough to recognize the enum without the explicit name ("enum" instead of "name::enum"), the compiler kept throwing "unknown symbol" errors if the enum was left as-is, and it would throw a warning indicating that the syntax given was only valid under C++11 if I explicitly scoped the enum, which failed the build because we compile with warnings equating to errors. Changing the enum itself to be enclosed in a class or at least a namespace probably was the right way to do it, but it would end up affecting a lot of other code, which in turn meant an extra regression pass for the QA guys. So, the only practical solution at the time was to disable the warning for that block of code, and re-enable it afterwards with a comment explaining the reason.

      --
      Please stand clear of the doors, por favor mantenganse alejado de las puertas
    45. Re:Because I'm lazy by UnknownSoldier · · Score: 1

      It is noise while you are writing the function, but yes, I agree, it should be addressed once the algorithm has settled down.

    46. Re:Because I'm lazy by NormalVisual · · Score: 1

      Your QA/Build process is seriously broken if you don't have one person or one team in charge of the build at all times.

      We do have someone that owns the responsibility for the build system, but we also largely subscribe to the "you break it, you fix it" philosophy, and all of the devs have the tools to see when something breaks on the CB system right then and there. Social pressure among the devs ("Awesome job breaking the build, Bob. Did you even compile it before checking it in?") tends to help keep the builds clean, although there still are a couple of guys on the team that can be counted on to break the build a few times a week. 9 times out of 10 our busted builds are because someone didn't take the time to build all of the required configurations on their own machine before checking something in.

      --
      Please stand clear of the doors, por favor mantenganse alejado de las puertas
    47. Re:Because I'm lazy by Anonymous Coward · · Score: 0

      In order to balance things out I could describe the company I worked at which was writing version 2 of their package. Plenty of documentation, lots of diagrams, huge amount of code written to spec and tested and debugged until it was the cleanest smoothest code ever written.

      Trouble was that it took too long and used up all the companys cash before it was completed.

      Knowing when to go into detail and when to skip is an important part of project management which often gets overlooked.

    48. Re:Because I'm lazy by Anonymous Coward · · Score: 0

      Science, industry - or is it really an art?

    49. Re:Because I'm lazy by RabidReindeer · · Score: 1

      I've spent many decades in that Real World. Ignoring compiler warnings and failing to write automated unit tests for edge cases can cause production defects and database corruption crises that will eat many, many more hours of productivity than simply addressing all compiler warnings. Not to mention causing poor end-user perception and increasing the workload up and down the software support and delivery chain.

      Developers whose coding habits cause such situations in real world enterprise or commerce systems are ultimately "less productive" than having no developer at all. :-)

      Tell that to the people who equate the time you spend parked in your chair in their offices with productivity.

      They're called "Management" and they know that the longer you take the more you're cheating them of their hard-earned bonuses, er profits.

      After all it's a simple job that a child/subminum-wage offshore coder/monkey can easily to in short order. All You Have To Do Is...

    50. Re:Because I'm lazy by tomhath · · Score: 1

      That's true. But if you get in the habit of allowing (and ignoring) warnings you won't see the important ones.

    51. Re:Because I'm lazy by Anonymous Coward · · Score: 0

      And it's a great rule. The compiler is trying to find bugs for you - for free. Take its advice. Even if it's only a courtesy to others, don't ship with warnings.

      Everywhere I've worked the last decade has turned off or ignored warnings. It's not the only shitty practice afflicting the industry, but it's the most avoidable.

      One place, Japanese and purportedly obsessed with quality, had 100k+ warnings in its code base. The engineers there turned all warnings off. If you turned them back on and checked the project in, you were accused of causing 100k+ warnings, because "obviously", they weren't there before. Yet, they'd spend millions on hundreds of test engineers to look for bugs during testing. They're out of business now.

      Other two places had them turned off, but were at least amenable to improvement. They had thousands of warnings, a handful of which represented deadly bugs. Slowly picked my way through them and fixed several stability problems in each product. Problems were solved before customers even knew they existed. Win.

      Bang for buck, it's one of the simplest ways to improve software.

      Of course, different compilers will find different problems (even gcc vs g++). It's good to build with different compilers to shake these out. GCC is great for shaking warnings out, whereas Keil or VC++ - eh - not so much.

    52. Re:Because I'm lazy by Anonymous Coward · · Score: 0

      C/C++ opts for "efficiency"; if that "int* ptr" is a local variable it takes time to set it's value every time the variable is declared. Otoh if it's a global variable it gets set exactly once so it gets the default value of it's type.

    53. Re:Because I'm lazy by TapeCutter · · Score: 1

      That's a laudable policy but totally impractical outside of greenfield development, especially if you use OSS or some other third party code in your product. In my world, if you can persuade developers not to add more warnings to the existing spaghetti ball you're doing well. I currently manage and maintain a large cvs repository and automated build system for ~25 developers. When a developers chooses to use (say) sqlite, they do not spend days trying to rid sqlite of compiler warnings and neither do I. Doing so would be a waste of time, it does nothing for quality and it would make regular updates to the latest version of (say) sqlite much more expensive than need be.

      If it is code written by an in-house developer and the first iteration is warning free then you have an opportunity to set "warnings as errors" and keep that one binary warning free. Keeping everything warning free is a good coding habit to teach students, I used to do it myself when I taught C to 2nd year uni students back in the 90's, but let's not pretend that's how the real world operates.

      So let's face it, the "unshippable" rule is an academic exaggeration that is aimed at teaching good habits, a concept any competent "drill sergeant" would recognise, but the real world is a "messy place" and applying the same rule to a commercial software house is at a minimum, financially irresponsible dogma.

      Re:Title: It's rarely got anything to do with laziness, if you use the same source for windows and a couple of flavours of *nix, then more often than not the original code was written using a different compiler/linker that had a different set of "lint" rules and an arbitrary warning level setting.

      --
      And did you exchange a walk on part in the war for a lead role in a cage? - Pink Floyd.
    54. Re:Because I'm lazy by Darinbob · · Score: 1

      Most of the times I break something it is in some build for a platform I forgot to try. As in I think this change only affects one product, I build that product and it seems ok, so I check in the code but then later get a build failure email. There are maybe 15 build combinations where only 5 really make a difference, and I'll actually build only 1 or 2 of them locally.

    55. Re:Because I'm lazy by Tanktalus · · Score: 1

      Clang warns about bad variable names? I need to switch!

    56. Re:Because I'm lazy by Darinbob · · Score: 1

      And some of those warnings are just ridiculously stupid warnings. But if you use -Wall plus -Wextra then you've got to deal with the lunacy.
      Ie, complaints about unused function parameters; so what if they're unused, the parameter must be there because of the API and it's ugly code to fix (adding an attribute, cast the paramter to void somewhere in the function, etc). So it makes sense to be able to turn some of these off.

      The other big problem is that these warnings are added in later versions of compilers. So if you have a "no warnings" rule then it will seriously slow people down from upgrading to later versions of compilers. Either you fix all the thousands of new warnings that popped up in hundreds of files, or you stay with the old compiler, or you start adding command line options to turn off more and more warnings over time. I think this is the primary reason that people learn to ignore warnings.

    57. Re:Because I'm lazy by Darinbob · · Score: 1

      Often with third part products you can't submit it upstream easily, or integrate new changes. Sure that's fine if you're doing open source and have lots of volunteers, but when you have to ship your product in a month you can't waste time integrating newer releases of third party code. So people routinely suppress warnings for third party code.

    58. Re:Because I'm lazy by Darinbob · · Score: 1

      Sometimes the compiler is just being a pedantic bastard. Especially the newer versions of GCC. I honestly think that -Wextra was not intended to be used in practice since so many of those are all highly subjective opinions.

      We've got over 2000 source files in our product, not counting header files, so just upgrading the compiler will generate a massive amounts of new warnings. Which means that only the person who's advocating for upgrading away from the archaic compiler is the one forced to modify all those source files (ie, me). Meanwhile the company is still running blindly at full speed and won't tolerate one developer being out of action for a month or two fixing up mere warnings.

    59. Re:Because I'm lazy by Darinbob · · Score: 1

      I think there is an attitude at times that everyone writes code from scratch, no one deals with legacy code. So why not add several more warnings in this release of the compiler, if no one is affected? Problem is, that variable is indeed used, only it's inside of an ifdef, so now we have to stick in even more ifdefs to hide the variable declaration.

      I can understand the idea that perhaps someone had a typo in a variable name. That's possibly worth pointing out. However this gets in the way of "real" warnings perhaps, indicators that something really is wrong (variable used before initialization). So if a project uses the "must have no warnings" rule then they've got to deal with legitimate warnings as well as warnings that have no effect code correctness. Other projects without that rule soon has developers who've learned to mentally filter out all warnings because 99% of them are meaningless so that they overlook the 1% that matter.

      But it's all easy if you start a brand new project with a brand new compiler, since you can write all the new code to avoid all the warnings, no matter how pedantic they are.

    60. Re:Because I'm lazy by Darinbob · · Score: 3, Insightful

      Why is one reason why no one should ever use Microsoft's code or tools as exemplars. I've got a theory that the first thing Microsoft has a new intern do is write example code to give to customers, and the second thing the intern is asked to do is read the coding guidelines.

    61. Re:Because I'm lazy by Darinbob · · Score: 1

      Which is fine if you're writing new code as you can fix the warnings right then. But for legacy code to get many thousands of warnings merely by upgrading your compiler, it is incredibly frustrating. Just because there is one blip of data in there does not mean that the rest of it is not noise!

      The compiler may as well say "Warning: there's a problem with your code" with every file, because there probably is a problem. But that message does not help you find the problem and it will just annoy everyone. What is more useful is a very specific warning that is very likely to point to a real defect. Whereas "variable declared but not used" is perfectly benign 999 times out of 1000.

    62. Re:Because I'm lazy by QilessQi · · Score: 1

      Tell that to the people who equate the time you spend parked in your chair in their offices with productivity. They're called "Management"

      I don't need to tell it to them: I am them. As well as being a developer who is, coincidentally, writing some JUnit tests at this moment for my team's current delivery. Time well spent, seeing at the automated tests I wrote earlier today caught an error in our service layer, and our code freeze (for a high volume public-facing website) is in a matter of days.

      If you're a software developer and your managers and/or customers don't understand that a basic degree of CM and QA is needed, then you either need to educate them or change companies. Or you will end up very, very bitter.

    63. Re:Because I'm lazy by Darinbob · · Score: 1

      The person reading the code will see things the compiler can't. Like the variable actually is being used, inside some conditional compilation, or that the variable is just a place holder used for debugging (as stated in the comment), and so forth.

      But the compiler's job here is to point out possible defects, it is not the compiler's job to provide value judgement on coding style.

    64. Re:Because I'm lazy by Darinbob · · Score: 1

      However this does not work either! There's a later version of GCC that will see "a=null" and warn "variable 'a' set but not used".
      Similarly, code that does "a=a;" used to work for removing this warning in the past, but newer compilers will claim that 'a' is being used before being initialized.
      The correct fix apparently is to do "(void)a".

    65. Re:Because I'm lazy by Darinbob · · Score: 1

      What about warnings that parameters are unused? There are many legitimate reasons for that and yet GCC complains about it. If the API is written that there must be 3 parameters but you don't need the third one, then the programmer should not be forced to have some workaround for this.

      As for unused variables, I have seen many legitimate reasons for this, again requiring workarounds to shut up the compiler when there is nothing wrong with the code. Ie, the variable is indeed used but is used inside an ifdef (and in C you can not portably move your declaration to the point of first use like you can with C++).

      Now if you have a command line option that says "please warn me about places where you think I may not understand my code" then maybe such warnings are useful. Ie, a "lint" style tool would be good for that. However by default most programmers expect the compiler to be warning about possible defects in the code, and a declared but unused variable is not a defect in the code.

    66. Re:Because I'm lazy by Darinbob · · Score: 1

      The problem is that the set of warnings grows over time. Code that has been good for years suddenly has warnings because a later compiler release starts to gripe about it. Frustrating when the warning is not actually a warning. And this causes teams to delay upgrading compilers for years, because they need to ship the code more urgently than they need to coddle a compiler with the colic. Another thing that some teams do in this case is start ignoring the warnings, and they're forced to ignore the warnings because again they must ship the code by a deadline.

      The annoyance is that many of these new warnings are not pointing out defects in the code and they generate tons of false positives. Too many false positives and programmers learn to ignore the warnings or turn them off.

    67. Re:Because I'm lazy by Anonymous Coward · · Score: 0

      Shitty languages like C++ and Java make it effectively impossible to write a non-trivial program that has warnings that can be fixed, rather than silenced.

    68. Re:Because I'm lazy by Anonymous Coward · · Score: 0

      Sometimes it is impossible to " Rework the code so that it doesn't warn."

      If you don't understand that simple truth, you haven't done anything of significance.

    69. Re:Because I'm lazy by Anonymous Coward · · Score: 0

      Tell that to Python's compiler.

    70. Re:Because I'm lazy by Anonymous Coward · · Score: 0

      "..build babysitter until someone else breaks it."
      Your QA/Build process is seriously broken if you don't have one person or one team in charge of the build at all times.

      And your process is broken if only on person or one team is in charge of building at all times.

      In reality, your QA/Build process is broken if you can't pick any dev from your group to be your build manager at any given time.

    71. Re:Because I'm lazy by kwbauer · · Score: 1

      maybe you should find better managers to work for.

    72. Re:Because I'm lazy by kwbauer · · Score: 1

      And just think if those OSS projects had also exercised some discipline with warnings and fixed them, then maybe using OSS wouldn't have to be an excuse for turning off warnings.

    73. Re:Because I'm lazy by Anonymous Coward · · Score: 0

      Not an art.

      Programming is trivially mathematics, which definitely makes it not an art.

      People who claim it is an art are dumbfucks that don't really understand programming. Just fuckwads enamored with shoving as many design patterns into the smallest space possible.

    74. Re:Because I'm lazy by Anonymous Coward · · Score: 0

      You are not enabling all the possible warnings, not even close. Which means that you accept a high number of warnings in production code and are a piece of shit hypocrite.

      How about you stop reading dumb shit from a bad coder and read the compiler manual?

      That's what you get by copying a guy whose greatest achievements are a mediocre bug tracker and a web front end to mercurial and git. Oh yeah, he is also responsible for many of the security flaws in excel macro bullshit.

    75. Re:Because I'm lazy by Anonymous Coward · · Score: 0

      The reason: it's faster. If you're always going to assign a value to the variable, then it would be a waste of time to first set it to zero. If you want to depend on it being initialized to 0 (or some other constant value), C has you do that yourself, rather than automatically doing it in places where it's not needed.

    76. Re:Because I'm lazy by Anonymous Coward · · Score: 0

      Some of these are valid, for instance--

      #pragma warning( disable: 4061 ) // enum value is not *explicitly* handled in switch

      Apple also has this one, so I ended up just giving in so that Xcode didn't complain (it seems like we had it off on VC) but I actually like it. It's easy enough to fix with:

      switch( foo )
      { ...
      default: // other values ok to ignore
      break;
      }

      switch( foo )
      { ...
      default:
      FAIL("Unexpected value");
      break;
      }

      #pragma warning( disable: 4099 ) // first seen using 'struct' now seen using 'class'

      This is a problem. You should be using struct and class consistently for readability, even if the compiler allows you to interchange them.

      #pragma warning( disable: 4127 ) // conditional expression is constant

      This usually happens in a very limited number of cases, mainly when you have something that can be turned off in debug but is always on in shipping. I would just disable it or use the C4217-safe false ( 0,0 ) in the case of do { } while blocks for macros.

      #pragma warning( disable: 4250 ) // inherits (implements) some member via dominance

      I generally don't use multiple inheritance that often, but it seems like you would want to be very explicit in that case so you know which function you are calling.

      #pragma warning( disable: 4275 ) // exported class derived from non-exported class

      Seems like something that should be resolved or turned off on a specific case, unless the class is using private inheritance. Otherwise, some members from the base class would be accessible but not linkable.

      #pragma warning( disable: 4347 ) // "behavior change", function called instead of template

      The usage case here is confusing as you have an explicitly defined overload but are now calling the templated version instead. I would either disable on a per-usage basis (with a comment) or just rename the explicit defined function for clarity.

      #pragma warning( disable: 4355 ) // "'this': used in member initializer list

      This is against the C++ standard. I would not use this in an initialize list since the behavior can be undefined on other platforms.

      #pragma warning( disable: 4510 ) // default constructor could not be generated
      #pragma warning( disable: 4511 ) // copy constructor could not be generated
      #pragma warning( disable: 4512 ) // assignment operator could not be generated
      #pragma warning( disable: 4623 ) // default constructor could not be generated
      #pragma warning( disable: 4625 ) // copy constructor could not be generated
      #pragma warning( disable: 4626 ) // assignment operator could not be generated

      Just be explicit that the class is not default constructable/copyable/assignable by defining the functions but not implementing them:

      class MyClass
      {
      private:
      MyClass(); // disabled
      MyClass( const MyClass& ); // disabled
      void operator=( const MyClass); // disabled
      };

      #pragma warning( disable: 4513 ) // destructor could not be generated
      #pragma warning( disable: 4624 ) // destructor could not be generated

      Seems like a valid warning. Just declare an empty one or one that does the amount of cleanup that is possible.

      #pragma warning( disable: 4610 ) // can never be instantiated user defined constructor required

      Under what

    77. Re:Because I'm lazy by Anonymous Coward · · Score: 0

      We usually had to return our work via an automated system... it would actually check that there were no warnings, sufficient amount of comments and newlines etc. Only after passing those tests would it even try running the program against functionality tests.

      Most warnings, though not errors, tell you that you're on the fine line between functional and broken; it's just a question of good coding practices.

    78. Re:Because I'm lazy by Jeremi · · Score: 1

      If "int* ptr;" returns any value that is inconsistent it is a problem IMHO.

      Ah, but in C++ that 'problem' is considered a feature. The reasoning is that if you know you're going to assign a value to that variable later on (without reading its value beforehand), then there is no point in having the program waste CPU cycles writing a never-to-be-used default value to ptr's memory location every time the function runs. So instead the compiler leaves ptr's memory location alone unless/until you explicitly request that it be set to a particular value, and thus its uninitialized value will depend on whatever bits happened to be already present at that location in RAM beforehand.

      It's design decisions like that that make C++ so efficient -- and so easy to shoot yourself in the foot with.

      --


      I don't care if it's 90,000 hectares. That lake was not my doing.
    79. Re:Because I'm lazy by Jeremi · · Score: 1

      Problem is, that variable is indeed used, only it's inside of an ifdef, so now we have to stick in even more ifdefs to hide the variable declaration.

      A potentially less messy approach:

      int some_variable; // might generate warning if left unused!

      #ifdef DEBUG
      some_variable = 5;
      #else
      (void) some_variable; // avoid compiler warning
      #endif

      --


      I don't care if it's 90,000 hectares. That lake was not my doing.
    80. Re:Because I'm lazy by Anonymous Coward · · Score: 0

      Which is exactly why people really shouldn't ignore warnings (unless you believe half the people here who are obviously above just trifling endeavours).

    81. Re:Because I'm lazy by Jeremi · · Score: 1

      Code that has been good for years suddenly has warnings because a later compiler release starts to gripe about it.

      I've seen it go the other way too -- code that has been buggy for years (but nobody noticed because the bug's symptoms were too subtle to easily detect, or because that particular code path was seldom exercised) -- suddenly gets warned about, and (if the developer is paying attention) fixed.

      --


      I don't care if it's 90,000 hectares. That lake was not my doing.
    82. Re:Because I'm lazy by Wootery · · Score: 1

      So what you are saying is that you are better than the thousands of folks working on gcc?

      If compiler warnings were a 100% reliable way of indicating that something's awry, they'd be errors. They're necessarily broad generalisations. That's not to say they're useless, but saying no compiler-warning should ever be permitted is hardly self-evident.

      I've worked on a large codebase where we were required to build with no compiler-warnings, so it's certainly possible. (Well, I guess that depends on how pedantic your compiler is, really.)

    83. Re:Because I'm lazy by Anonymous Coward · · Score: 0

      Yes, sometimes compiler warnings can be ignored, but why on earth you would leave an unused variable to your code?

    84. Re:Because I'm lazy by TheRaven64 · · Score: 1

      In Clang, we also try to make sure that warning messages for things that have a reasonable chance of being false positives have a little hint telling you how to suppress the warning. For example, we'll warn on if (a = b), but tell you that if you really meant this you can write if ((a = b)) and the compiler won't warn again. I think gcc has also started doing this recently.

      As you say, the point of warnings is to tell you when you've done something that is probably wrong. The point of errors is to tell you when you've done something that is definitely wrong. Sometimes the correct response to a warning is to read the code, realise that it's doing something that should be permitted, and tell the compiler to suppress the warning next time.

      --
      I am TheRaven on Soylent News
    85. Re:Because I'm lazy by Anonymous Coward · · Score: 0

      Then your professor had never work with real software.

      Take a program that compiles without any varnings, wait 5 years and try to compile it with a newer compiler.
      Wow, it generated alot of warnings?

      Why? Cause our field is a mind game, and the game is changing, what was okey 5 years ago is not okey anymore, and warnings will be added to the compiler.

      Maybe it's not as bad as I describe here, but try compile a 10 or 15 year old program, and I bet, you will get a lot of warnings. If it even compiler correctly.

    86. Re:Because I'm lazy by TheRaven64 · · Score: 1

      Last time I did this exercise, Clang generated enough warnings that it took me a few days to fix them all. Most of them were undefined behaviour, which were probably safe unless the compiler is clever enough to exploit them (i.e. turn on LTO and your code won't work). A few of them were security vulnerabilities. If you don't fix the relatively benign ones, then it's hard to find the rest...

      --
      I am TheRaven on Soylent News
    87. Re:Because I'm lazy by TheRaven64 · · Score: 1
      Actually, it's not faster for any compiler made in the last 20 years. There are two cases:
      • You're explicitly assigning a value to the variable in every code path
      • You're not explicitly assigning a value to the variable in every code path

      In the first case, redundant expression elimination will just delete the initial zero store. A local value that is written and never read is easy to track. Once it's in SSA form, it just becomes a value with no uses and gets deleted trivially.

      In the second case, the result changes. It's now potentially a lot faster, because the compiler will propagate the undefined value through all arithmetic in the code paths where it is not assigned, eventually get to the end and you'll find that a big chunk of your code has now been optimised into an undefined value (the compiler will just pick any register, or if you're lucky will emit an illegal instruction so that you can catch the trap in the debugger).

      Initialising to zero is nice for pointers, because it guarantees that you have a trap value, so if you try to use it then you'll get a hard error, rather than memory corruption. For integers / floats, it's less clear. It would be nice for floats to be initialised to a NaN value, but most processors have no trap representation for ints.

      --
      I am TheRaven on Soylent News
    88. Re:Because I'm lazy by TheRaven64 · · Score: 1
      It's fairly common to have a definition like this in code:

      #ifndef NDEBUG
      #define DEBUG(...) __VA_ARGS__
      #else
      #define DEBUG(...)
      #endif

      You can then write:

      DEBUG(int some_variable;)
      ...
      DEBUG(some_variable = 5;)
      ...

      If you've got code that's only used for debugging, then strip it out with the preprocessor, don't just strip half of it...

      --
      I am TheRaven on Soylent News
    89. Re:Because I'm lazy by TheRaven64 · · Score: 1

      For example, "incompatible declaration of function printf" when I forget to include stdio.h is not a significant warning because I don't care what printf returns and nothing depends on it.

      Actually, this means that your code is relying on undefined behaviour and, while it might not bite you in this particular compiler/OS, a number of ABIs have different calling conventions for variadic and non-variadic functions and so you can end up writing code that just doesn't work with the next compiler/OS/architecture. If you're lucky. If you're unlucky, you'll write code where the compiler can detect that it's undefined behaviour and optimise it all away.

      --
      I am TheRaven on Soylent News
    90. Re:Because I'm lazy by TheRaven64 · · Score: 1

      I call BS on the grandparent. In FreeBSD, we have a codebase that dates back to 1977 in parts. We compile the whole thing with -Werror. We compile most of it (i.e. anything that isn't architecture specific) with gcc and clang, both with -Werror. Every time that we import a new compiler, we end up finding a load of warnings and fixing them. About the only place in the entire tree that we turn them off is gcc 4.2.1, which has a crazy number of warnings but is slowly being removed from default builds so no one can be bothered to invest the effort required to fix it just before it's killed. Everywhere in the base system, we fix the warnings. We're also slowly working through the clang static analyser results and Coverity scan reports. If we can do it as a volunteer-run project with a huge codebase that's getting on for 40 years old, no one else has any excuse.

      --
      I am TheRaven on Soylent News
    91. Re:Because I'm lazy by disambiguated · · Score: 1

      This is a holdover from C where you have to declare all your variables at the beginning of the scope. In C++ (and IIRC now in C) you can wait until you have the initializer before you declare the variable. Uninitialized variables should almost never be used, and always commented.

    92. Re:Because I'm lazy by Anonymous Coward · · Score: 0

      If you get the majority of these warnings in your code, they are 'code smells' that probably need addressing. You have to do some pretty hairy code to mean the compiler can't generate a default constructor or destructor!

      Personally, I wouldn't disable ANY of these warnings by default. Perhaps in individual cases you might need to (with a comment as to why), but that is on an issue by issue case.

    93. Re:Because I'm lazy by bingoUV · · Score: 1

      However by default most programmers expect the compiler to be warning about possible defects in the code, and a declared but unused variable is not a defect in the code.

      It is a possible defect.

      If you want proven defect, only a compilation error is a proven defect, so just turn off warnings while compiling.

      --
      Bingo Dictionary - Pragmatist, n. A myopic idealist.
    94. Re:Because I'm lazy by angel'o'sphere · · Score: 1

      I don't kniw where you work, but usually where I work the person who caused the build to fail is responsible to fix it.
      First, why should someone else 'waste' his time an second how should the responsible one learn to avoid that in future?

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    95. Re:Because I'm lazy by RabidReindeer · · Score: 1

      maybe you should find better managers to work for.

      Contrary to the opinions of some, the labor/hiring market is rarely symmetrical (100% employment). That gives management the whip hand, and it means that one has to think long and hard before shopping for new managers.

      Especially since you won't know if the grass really was greener until too late.

    96. Re:Because I'm lazy by AmiMoJo · · Score: 1

      This is called "technical debt". By doing a half-arsed job now you just save up the pain for later, with interest.

      --
      const int one = 65536; (Silvermoon, Texture.cs)
      SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
    97. Re:Because I'm lazy by RabidReindeer · · Score: 1

      The world is full of bitter employees. Because changing companies is often not a good option and management figures they know better than you do or you'd be management.

      I've had good managers, but it's a crap shoot.

    98. Re:Because I'm lazy by Anonymous Coward · · Score: 0

      If you have a variable declared, but not used, you just remove the variable, no warning generating.
      Leaving that variable in the code is a dodgy practice.

      Another reason to remove all warning is that many times warnings help finding actual errors. If you let the warning spam accumulate, you may miss THE important warning. In a build with many warnings the programmer just ignores warnings.

      So, maybe sometimes the warnings are pedantic. In any case a worthy programmer will remove that warning just to avoid the noise. Getting warnings when building is just a bad smell.

    99. Re:Because I'm lazy by Anonymous Coward · · Score: 0

      I think everyone develops like that... but I think (open source primarily does this, closed source probably has different rules for different types of software) the critical problem is that developers ignore warnings from the compiler with an attitude of "I'll fix it later" rather than "fix it now before it's a permanent"

      The average OSS package on FreeBSD blows by hundreds of warnings unless the software explicitly turns the warnings off. Many software packages on FreeBSD and Linux don't compile out of the box because they have dependency issues, or basically dll-hell for open source. So when that one dependancy fails, you are stuck trying to fight the binary package manager and the source ports for control of how the software is built. Linux binaries almost never work out of the box, and FreeBSD binaries don't always either. Yet MacOS X and Windows binaries always do. WHY is that?

      People should avoid Java because of Oracle (previously Sun) breaks the "Write Once, Run Anywhere" that Java is supposed to be. You can't get software writting for Java 1.0 to run on a current JRE, nor can you get software written against any current JRE work on any previous JRE. It's broken. Compare this with just straight up compiling a C89 application that has no dependencies and having it work on everything including DOS.

      The polite middleground really needs to be compiling to a middle language and then compiling the middle language to native upon first run so all the dependencies are fulfilled. Like simply a process of
      Does OS have X library, If true dynamically link to OS version if library version > current . If system library older or not compatible, static compile in the version of the library from the middle language that worked at initial compile time.
      If OS has marked X library version as dangerous, recompile at next run. There literately should not be a fail from the middle language. Certain classes of software like videogames should actually statically compile all libraries in to avoid tampering.

      Right now what happens on Linux and FreeBSD is you get these massive autoconf, automake scripts that spend several minutes just making decisions on how to build, when these decisions should be made at initial compile time.

      Of course the entire reason for this bullshit is the the licences for certain software is prohibited from being statically compiled in. So every time a dependency changes, the more closer to the core, more shit needs a recompile. OpenSSL heartbleed? Damn near everything that listens to a TCP/IP socket needed a recompile, and platform binaries were delayed by weeks, not hours.

      Dear internet, please stop releasing updates to software unless the bugs being fixed are critical, everything else can be rolled into those updates. The amount of fragility in an OS like FreeBSD or Linux is caused by changing the ABI needlessly. (FreeBSD changed the ABI between 8 and 8.4 despite them not supposed to, to add a built in decompress library, and changes to POSIX functions, and stuff just won't compile on an 8.4 OS that would on 8.3 if it uses either of those functions because the auto* utilities think the OS has these functions when it doesn't.)

    100. Re:Because I'm lazy by Anonymous Coward · · Score: 0

      #pragma warning( disable: 4061 ) // enum value is not *explicitly* handled in switch

      That's a damned useful warning. If I add a new enum value, then the IDE will immediately tell me where the enum is used so I don't miss any place that I have to change.

      In those cases where I really want to use default handling, I will suppress the warning for that particular switch, but I can't remember any occasion from the last five years where I wanted to do that.

    101. Re:Because I'm lazy by david_thornley · · Score: 1

      I wanted to do that when I was teaching C. Unfortunately, gcc on the University-provided systems would warn on the lack of use of a function return, and I didn't have the heart to force the students to write "(void)printf(....".

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    102. Re:Because I'm lazy by david_thornley · · Score: 1

      Assuming you mean an unused variable in C or C++ code, to be specific.

      Suppose you've got a base class and a derived class. There's a function in the base class that is overridden in the derived class. It has to have the same signature, which means that if there's a parameter in the Base:: function it has to be the same in the Derived:: function. It may be that the Derived:: function has no use for that value. This is a case where there's basically no choice.

      Also, it's possible to have conditional complication in a source file, and a variable will only be used in one version that's being compiled. The correct thing may be to conditionally compile the variable definition as well, but that can be awkward.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    103. Re:Because I'm lazy by kwbauer · · Score: 1

      And that is a Good (TM) thing. I was not trying to comment on the state of OSS just trying to point out that just because others are doing it does not make it a good thing to do. Sometimes parents are correct.

    104. Re:Because I'm lazy by Darinbob · · Score: 1

      Anything is a possible defect. Maybe the compiler should warn on every line "are you sure this is what you wanted?"
      Maybe I should have said "likely defects in the code".

    105. Re:Because I'm lazy by david_thornley · · Score: 1

      Different languages have different philosophies. C and C++ were designed on the principle that the fundamental language constructs should be as fast as possible. If you have unsafe but fast language constructs, you can make safer and slower equivalents by adding error-handling code, but you can't do the reverse. C and C++ are intended to be fully usable for applications that require maximum execution speed, such as systems-type programming.

      They were also designed to be useful on a great variety of computer architectures, most of which are obsolete by now. Except possibly for embedded programming, the world has pretty much settled on 8-bit bytes, signed integral values being two's-complement, signed arithmetic wrapping around, IEEE floating point, flat address spaces, that sort of thing. When C was introduced, you couldn't count on any of these. Therefore, there's a lot of stuff that's simply undefined, including things I think they'd have better made implementation-defined.

      There are languages based on the philosophy that all behavior is nailed down and consistent, which would seem to be more to your taste. They aren't necessarily good for some of the things C and C++ are good at, but they can be extremely useful regardless.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    106. Re:Because I'm lazy by bingoUV · · Score: 1

      Maybe I should have said "likely defects in the code".

      Exactly. Like I noticed you missed the adjective "possible" for defective in the second instance. I concluded not only a possible defect in your argument, but I concluded a likely defect in your argument. And I was right.

      An unused declaration is very similar to this situation, and not only points out a possible defect but a likely one. Compiler could very well be right in his situation too.

      --
      Bingo Dictionary - Pragmatist, n. A myopic idealist.
    107. Re:Because I'm lazy by Z00L00K · · Score: 1

      Just be aware that your job resume may be on the bottom half when you decide to change employment.

      --
      If builders built buildings the way programmers wrote programs, then the first woodpecker would destroy civilization.
    108. Re:Because I'm lazy by Wootery · · Score: 1

      Riiight... nothing to do with the fact that programming is hard.

    109. Re:Because I'm lazy by ConceptJunkie · · Score: 1

      "Automated unit tests"... I thought those were just a myth. Are you sure you're in the Real World?

      And don't get me started on "enterprise" software. I've almost never seen "enterprise" software that was worth the disk space it took up. We can complain all day about how bad Windows or Office, etc., is but compared to "enterprise" software, those products are amazingly good and user-friendly.

      --
      You are in a maze of twisty little passages, all alike.
    110. Re:Because I'm lazy by ConceptJunkie · · Score: 1

      Science, industry - or is it really an art?

      I've been doing it for more than 25 years... I consider it a vice.

      --
      You are in a maze of twisty little passages, all alike.
    111. Re:Because I'm lazy by ConceptJunkie · · Score: 1

      Programming is math, I agree. But doing anything productive with code someone else has written is most definitely an art.

      --
      You are in a maze of twisty little passages, all alike.
    112. Re:Because I'm lazy by Obfuscant · · Score: 1

      Just be aware that your job resume may be on the bottom half when you decide to change employment.

      Bottom half of what? And if the place I was applying was overly worried that I had ignored a specious compiler warning when compiling a large open source project written by someone else, I'm pretty sure I wouldn't want to work there. Would you?

    113. Re:Because I'm lazy by QilessQi · · Score: 1

      Curiosity compels me to ask what you do for a living, and who you work for. :-)

    114. Re:Because I'm lazy by ConceptJunkie · · Score: 1

      I'm a developer. Honestly, I've never worked anywhere that did much in the way of automated testing. It's something that's always bugged me and something I've always pushed for.

      --
      You are in a maze of twisty little passages, all alike.
    115. Re:Because I'm lazy by turgid · · Score: 1

      C and C++ were designed on the principle that the fundamental language constructs should be as fast as possible.

      C was designed to be as simple (and flexible) as possible. It (the compiler) had to run on tiny machines, by modern standards. Speed (of the object code) is a consequence/coincidence of the simplicity of the language and the fact that simpler languages tend to produce tighter (and faster) object code when compiled.

      C's simplicity can be summed up by the following rule of thumb: if something can be calculated at compile time, the language usually supports it. Everything else (like handling array dimensions and strings) are left up to the programmer.

      When computers were small and slow, C was ideal for programming them when FORTH wasn't big enough.

    116. Re:Because I'm lazy by QilessQi · · Score: 1

      I suppose it depends on the size of your shop, the language you work in, and how much is at stake if bad stuff goes out the door. :-)

      I'm fortunate enough to work on a mature project with ~50 applications, ~60 developers, ~5 architects, dedicated CM and QA staff, and a continuous build system that sends out emails if the build breaks or if the tests don't pass. Not everyone is disciplined enough to write unit tests, of course, but the senior developers here try to set an example.

    117. Re:Because I'm lazy by ConceptJunkie · · Score: 1

      We have all that, but not the automated tests for the stuff I'm involved with (other departments probably do). It's something my manager has been making a push for in the past few months (and I'm totally on board with), but it's going to take a lot of time because of the sheer amount of legacy code.

      --
      You are in a maze of twisty little passages, all alike.
    118. Re:Because I'm lazy by Forever+Wondering · · Score: 1

      Clang warns about bad variable names? I need to switch!

      I guess I should have used:
          if (a_simple_boolean_expression_variable.that_is_automatic_scope.and_therefore_on_the_stack);
              yet_another_simple_integer_variable.that_is_automatic.and_likewise_on_the_stack = 5; // set value to five

      Or, if you [yikes!] prefer camel hump notation:
          if (aSimpleBooleanExpressionVariable.thatIsAutomaticScope.andThereforeOnTheStack);
              yetAnotherSimpleIntegerVariable.thatIsAutomatic.andLikewiseOnTheStack = 5; // set Value To Five

      I can be flexible when needed ...

      --
      Like a good neighbor, fsck is there ...
    119. Re:Because I'm lazy by QilessQi · · Score: 1

      We began with lots of (untested) legacy code too. My advice: forget the mountains of existing code, and focus only on the task at hand. When you're implementing a new backend service, write a test. When you're fixing a bug, try out TDD and write a test which detects the existence of the bug, then fix the bug and watch the red light turn green. And remember, even 1% coverage is better than 0%, especially if the 1% is covering the new stuff that people care about anyway.

    120. Re:Because I'm lazy by gbjbaanb · · Score: 1

      1. your OO is wring in this case. IF you have an addition parameter used in a base class that is only used in derived classes, then you should have a base class that has a pure virtual method. You then provide implementations in your derived classes, as before.

      2. If you are conditionally compiling, conditionally exclude this variable too. Then you'll get errors for the places where you accidentally used that variable outside conditional sections.

      Or just use the pragmas to disable the warning, but modifying the bad code that raises them is a better choice.

    121. Re:Because I'm lazy by david_thornley · · Score: 1

      Using pure virtuals solves nothing here. In order to override a function in C++ so it's properly polymorphic, the signatures have to match, and that applies whether one function is pure virtual or not.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
  2. It's usually a computer problem by Russ1642 · · Score: 1

    We've found that builds fail for three reasons: coding errors, dependency issues, command line argument mistakes. If you're a developer you should check these three things when your builds fail and you'll likely find the issue.

    1. Re:It's usually a computer problem by matthiasvegh · · Score: 4, Insightful

      Oh coding error? Well thats helpful. Misplace a semicolon in a non-trivial meta-program or dsl in C++, and just watch the errors that the compiler spits back at you. None of which, will have anything to do with semicolons. I suppose this is why the C++ errors are considered to be easy to fix. Mistype a word, and you get 15000 lines of errors. I suppose it's easy to fix all those errors too. Yes, but figuring out what exactly the coding error was is kind of the point.

    2. Re:It's usually a computer problem by aliensexfiend · · Score: 4, Insightful

      When I see the error avalanche the first place I check are the first few error messages and that is usually enough to spot the problem. Typos still make c++ compilers barf way too much crap.

    3. Re:It's usually a computer problem by Anonymous Coward · · Score: 5, Insightful

      Please, give up the C++ slander.

      Like any compiler output, read the first error. If you are a developer of any calibre, having a few pages of errors shouldn't phase you and it's not unique to C++ to generate a few erroneous errors. All it requires is a basic level of competence and if you don't possess that then any programming
      language that facilitates you generating anything that compiles is doing noone any favours.

    4. Re:It's usually a computer problem by Anonymous Coward · · Score: 0

      GCC is better then LLVM/Clang...

    5. Re:It's usually a computer problem by Anonymous Coward · · Score: 0

      while I agree with almost everything you say; I have reservations about the following claim

      it's not unique to C++ to generate a few erroneous errors

    6. Re:It's usually a computer problem by frank_adrian314159 · · Score: 0, Troll

      Please, give up the C++ slander.

      Why? It deserves it. And I speak as one who has been using it since cfront 1.0 and used it for 15 years or so professionally. Basically, its two reasons to exist - its performance and its small (-ish) runtime library are dwindling in importance. You can now get as good performance writing C primitives in a decent high-level languages. And RT minimalism has only been an issue in the embedded world for the last 20 years or so.

      Yes, it was once the mainstay of the engineering software world. Let it go and let it drift away to its end as the COBOL of the embedded world.

      --
      That is all.
    7. Re:It's usually a computer problem by geekoid · · Score: 1

      what? You can't tell a missing semi colon from the error messages? or a misspelled word? you're not very good, are you?

      --
      The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
    8. Re:It's usually a computer problem by geekoid · · Score: 0, Troll

      c++ is great. I'm sorry you're not very good and never mastered it, but that isn't the languages problem.

      --
      The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
    9. Re:It's usually a computer problem by matthiasvegh · · Score: 1

      Don't get me wrong, I use C++ both at the workplace and for hobby projects and love it, the point I'm trying to make is that the types of errors encountered during developing in C++ are very different to those encountered in say Java. So the comparison that C++ errors are easier to fix seems to be apples to oranges.

    10. Re:It's usually a computer problem by turgid · · Score: 2

      c++ is great.

      Keep repeating it often enough and people will believe you.

    11. Re:It's usually a computer problem by Anonymous Coward · · Score: 0

      If it were a language of any caliber, it would know well enough not to keep trying to compile the program after a syntax error.

      Maybe our software would be better if we blamed it for being alienating to humans instead of blaming the humans for not adapting themselves to bad software.

    12. Re:It's usually a computer problem by Anonymous Coward · · Score: 0

      Please, give up the C++ slander.

      Or learn Python. It'll tell you what line has the error and usually suggests the fix.

    13. Re:It's usually a computer problem by TheRaven64 · · Score: 1

      The difference with C++ is that the error often doesn't appear where you made the mistake. You'll get an error saying something like type T (and a long string of indirections telling you what T really is in this context) in some standard library header doesn't implement a specific operator. You then need to peal back multiple levels of template instantiations to get to the place where it's actually causing the error. The last line in the first error will tell you the bit of your code that is instantiating the template, but the bug may be that one of the implicit arguments to a template two invocations later picks a value that is incompatible with one of your explicit arguments. This is nontrivial to debug.

      --
      I am TheRaven on Soylent News
    14. Re:It's usually a computer problem by ConceptJunkie · · Score: 1

      > Misplace a semicolon in a non-trivial meta-program or dsl in C++

      Well, I see one obvious problem here...

      --
      You are in a maze of twisty little passages, all alike.
    15. Re:It's usually a computer problem by ConceptJunkie · · Score: 1

      I've been doing C++ on and off (mostly on) for 20 years. I'm on the fence about whether or not it's great. I definitely like it, and I think the right subset of C++ is great, but the right subset changes over time (e.g., you couldn't have paid me to use templates and STL 12 years ago), but now I couldn't live without them, and it definitely changes for different people.

      In fact, it really is the language's problem. C++ in its entirety is just too complex, and therefore, depending on the code, it can be way too hard to deal with. Of course, Java is a much simpler language and you can hardly do a Google search without seeing someone complain about how so much Java code is like dealing with the Soviet bureaucracy (an accurate description in my experience). I guess C++ makes good developers better and bad developers worse... and that is because of the language.

      My language of choice these days would be Python and if I do anything for fun, it's with Python. I think Python is a far more elegant language, as well as simpler than C++, but doesn't lack the ability to be really expressive, usually with much less code. There are obviously issues with Python, too, it's not my intention to start a flame war, but as much as I like C++, I think a lot of its problems _are_ the fault of the language.

      --
      You are in a maze of twisty little passages, all alike.
    16. Re:It's usually a computer problem by ConceptJunkie · · Score: 1

      Heh. I'm tempted to say that with C++ you can get a huge unreadable mess of error messages, but with Java, the huge unreadable mess you get is the code, but that's not fair to the language.

      --
      You are in a maze of twisty little passages, all alike.
  3. I don't get it.... by Anonymous Coward · · Score: 0

    How is C++ / Java build error comparison related to the actual study in any way?

    But then again.... I'm dumb.

  4. LaTeX never fails by Extremus · · Score: 2

    My LaTeX builds rarely fail in MiKTeX. The compiler itself seems to be able to download packages and classes from a common repository (CTAN and its many mirrors).

    1. Re:LaTeX never fails by Anonymous Coward · · Score: 0

      Wait until you run into the hilarious error 87. A compiler error so insidious no one even knows what causes it for sure.

  5. Here's a concept to prevent this crap - UNIT TESTS by SirGeek · · Score: 2

    If GOOD/Complete unit tests for code exist and this change would break it, How freaking tough is it to run the unit test before committing your change to source code control ?

  6. Detecting missing dependencies by Anonymous Coward · · Score: 0

    most build errors are dependency-related

    If *only* there was a way to tell which dependencies were missing before I start an hour-long build process... perhaps a ./configure script, or a README file...

    But more seriously, I'm currently trying to compile various source packages for MinGW and/or MSYS. MinGW is missing various unix-based headers (no surprise), while MSYS is missing ANSI-C headers (including stdint.h). They also have a habit of breaking well into the compilation process, even after ./configure seems to indicate that everything is okay. While trivially fixed, it's something that needs to be fixed in the source repository rather than on a per install basis.

    I'm considering forking MinGW/MSYS on that alone.

    1. Re:Detecting missing dependencies by Anonymous Coward · · Score: 0

      Try Cygwin.

    2. Re:Detecting missing dependencies by Anonymous Coward · · Score: 0

      Cygwin is licensed under the GPL, which makes it impossible to do distribute anything other than GPL software if compiled using Cygwin. (e.g. any attempt at commcercially-sold software, needed if you want food in your belly if you can't be otherwise sponsored.)

      Also, Cygwin is yet again different from MinGW/MSYS, in that it's more strictly designed for Unix-like systems. If you want to be able to use windows, you need to install X11 (not installed by default or in core), or manually import Windows header files.

      And switching to Cygwin doesn't fix the issue that MinGW/MSYS is still broken.

    3. Re:Detecting missing dependencies by Anonymous Coward · · Score: 0

      (e.g. any attempt at commcercially-sold software, needed if you want food in your belly if you can't be otherwise sponsored.)

      No worries, brah, Obamacare will fix everything! You can live to program and pay for your food with welfare checks, like Stallman intended.

    4. Re:Detecting missing dependencies by Anonymous Coward · · Score: 1

      http://scp-wiki.wikidot.com/scp-504

    5. Re: Detecting missing dependencies by Anonymous Coward · · Score: 0

      What do you think you are doing? You have to cross-compile mingw to build it. It doesn't build itself at all. Only a *nix GCC can build GCC.

  7. Simple answer by slapout · · Score: 1

    Complexity

    --
    Coder's Stone: The programming language quick ref for iPad
  8. Surprise, surprise by Anonymous Coward · · Score: 0

    Strongly typed languages catch more errors during compilation.

  9. Re:Here's a concept to prevent this crap - UNIT TE by Anonymous Coward · · Score: 1

    How does a unit test prevent a build error?

  10. Dependencies? by Anonymous Coward · · Score: 3, Insightful

    Dependencies just magnify all other problems. If your code depends on nothing then it won't break unless the compiler changes. Unfortunately such programs don't exist because you can never depend on nothing and do anything useful. In reality if you depended on nothing you'd end up writing your own console, your own I/O, pretty much your own CRT. This sounds great until you realize your dependency is now the hardware itself and it's likely your code won't be portable in any useful sense. That's why we have kernels.

    The problem with C++ is that dependency management is usually file-level and developers 'rarely' care about any file-level constructs (and nor should they, it's an abstract packaging concept). As a result you try to drag in one enum and end up with 100 #includes and 500 new classes you don't care about. This causes bigger object files to be emitted, vastly slower linkage and lots of dependencies you don't expect. All it takes now is for one of those includes to #define something unexpected and BOOM...the house of cards comes crashing down.

    Also, did I mention? The C preprocessor causes a lot of grief when it's abused.

    1. Re:Dependencies? by Anonymous Coward · · Score: 0

      A huge contributor to this problem is that for a long time including header files in header files was considered acceptable practice. I personally didn't change this practice until I read about how to do it better in the latest version of Effective C++

    2. Re:Dependencies? by EvanED · · Score: 1

      Errr... what?

      Care to give a quick summary of what the alternative is?

    3. Re:Dependencies? by Areyoukiddingme · · Score: 1

      Care to give a quick summary of what the alternative is?

      Forward declarations. Which may be in the latest Effective C++ but I read that two years ago so I'm not sure, but anyway it's been in every advice about C++ (and C) programming book for about twenty years now.

      Or possibly the coward was referring specifically to the fact that forward declaring enums is now legal, since C++11, when it wasn't before (though Microsoft's compilers have tolerated it for years).

    4. Re:Dependencies? by EvanED · · Score: 1

      If I were to pull a number out of my ass, I'd guess forward declarations suffice... maybe a third of the time? You can't forward declare types you want to return or pass as parameters (i.e., not by reference/pointer). You can't forward declare types you want as members in a class you're declaring. You can't forward declare types you're using (beyond having just a pointer/reference) in a function's implementation, which you "need" to have in a header if it's actually a template and you may need to have in a header if you want it available for inlining.

    5. Re:Dependencies? by EvanED · · Score: 1

      You also can't forward declare objects you are making a typedef to for now but think you may replace with a full-blown class or whatever at a future point. (Or if you do, not via making a "blah_fwd.hpp" file, then sucks to be whoever is doing maintenance when they go and make that switch.)

  11. Re:Here's a concept to prevent this crap - UNIT TE by Anonymous Coward · · Score: 1

    It's hard to run a unit test on a program that doesn't build.

  12. Re:Easy fix... Offshore it by Anonymous Coward · · Score: 0, Funny

    Deng Zhang commit untested code to repository again. Now compiler error, build box idle, that not good. I need you write script recompile code until it work. You have five minutes finish job now before you laid off.

  13. Questionable by Anonymous Coward · · Score: 0

    I agree it's usually about dependencies, and also with their C++/Java conclusions. However, I find it hard to accept that there is no correlation between developer experience and build failures.

    Maybe it's because even experienced devs often suck completely at proper build structure and dependency checks.... I certainly get that where I work - the "experienced" guys are just as likely to break builds, but some of the "experienced" guys are also fucking useless and counter-productive and are only considered "experienced" because of how many years they've been writing useless code.

    I'm the "build guy" at my shop, because few are OCD enough to do it properly.

  14. Dependencies Problems = "It builds on my machine" by Virtucon · · Score: 5, Insightful

    Once code is checked in and goes through the standard build process, that's where this is expected to occur because in my experience it's the local environment where the developer does the coding that's the root problem. Why? Developers don't refresh their build environment because of the potential for other problems it may create. I had one gig to unfuck some code at a company a couple of years ago and found out that in order to set up a Dev environment in this place could take two weeks or more depending on what team you were on. You had to go through a script, download this, install that, change this.. A nightmare. Updating dependencies on a local desktop created panics amongst the developers who were reluctant to ever change anything they had which "was working" because you could spend days trying to fix what was broken. Naturally any time they migrated code into test or production (there was no build system) things failed there because of dependency related issues. Also depending on who the developer was, they naturally felt that bypassing the Test/QA cycle was a job perk.

    I found dozens of dependencies on desktops that were out of date, deprecated or had major vulnerabilities and that went for the production systems as well. It was bad all the way around from a best practices perspective. Daily production crashes were the norm, the VP of Dev had a monitor on his desk so he could "troubleshoot" production problems it was that bad.

    Yes there's shops like this that are still out there.

    --
    Harrison's Postulate - "For every action there is an equal and opposite criticism"
  15. Go and dependencies by Anonymous Coward · · Score: 1

    The designers of Go talk a lot about dependency management (Go bans cyclic or unused dependencies, and in another sense of "dependency" the compiler links in all the runtime/stdlib it needs, so no external libraries need to be installed on the target machine). I found it interesting because I'd never thought of dependencies as an important focus for a language; maybe it's because of this experience at Google.

    1. Re:Go and dependencies by BitZtream · · Score: 1

      Static linking isn't unique to Go. It's telling that you just discovered it, and further more don't realize what it is that you've discovered.

      --
      Persistent Volume manager for Kubernetes - https://github.com/dwimsey/openshift-pvmanager
  16. Re:why greed fear ego based 'societies' fail? by Anonymous Coward · · Score: 0

    re-enter mom

    incest is best

  17. so true by slashmydots · · Score: 1

    As soon as you rely on someone else's 3rd party code module, you're screwed. You're in for 10 years of constant nightmarish problems. So yes, decencies are the problem.

    1. Re:so true by mlts · · Score: 1

      Of course, said code module can change, so even if your deps are right now... it might be that the black box code library that does some essential functions might not work the same after it gets updated. In some ways, this is easy to find (if you do a library upgrade and things break, with no other changes.) However, if there are other confounding variables, this might be a fairly difficult task.

    2. Re:so true by Anonymous Coward · · Score: 0

      So yes, decencies are the problem.

      Fuck yeah your damn right motherfucker. Nigga keepin it real! Real indecent and shit.

    3. Re:so true by Anonymous Coward · · Score: 0

      your

      GULDAM! Keep that shit on the low-down son. This here's a fucking CLEAN establishment! Got no time for that sorta shit-storm ya be brewin' right-there.

    4. Re:so true by Anonymous Coward · · Score: 0

      +1

      I'm responsible for compiling 3rd party modules from source . . . try doing a full compile on something that keeps updating dependencies.

      Then some asshat here say "well, just use maven/git/jenkins/my mom" --- nobody bothers testing the build on a 'clean' machine.

      "I TODE you Bobby Bourchier . . . dependencies is tha devil!"

  18. bad study by Anonymous Coward · · Score: 1

    from the article : " A build was defined as “a single request from a programmer which executes one or more compiles” and deemed a failure if any compile in the build failed."
    this is stupid .
    When I code , I often do a first or second compile only to see all the trivial error I have made and correct them fast. I do not expect zero error .

    1. Re:bad study by HeckRuler · · Score: 1

      This. I'm inherently suspicious if it actually compiles the first time if I make any sort of significant change.

    2. Re:bad study by Anonymous Coward · · Score: 0

      Obviously the answer is to turn warnings all the way to 0. ;) You laugh but I have seen it.

  19. Re:Dependencies Problems = "It builds on my machin by gstoddart · · Score: 2

    I had an experience which was somewhat opposite (though, in a lot of ways pretty much the same).

    At one point, the company went with a big giant universal build system.

    Every piece of software, every module, every final build ... was recompiled from scratch on a nightly basis. It took a massive server farm many hours to do this. Even if no changes had been made.

    What would happen would be someone would break a component. The build of that component, and every downstream dependency broke. The system had no concept of "this is a beta build, not for everybody" and "this is a release, and stable".

    The result was that sometimes you'd have literally dozens of things which were now suddenly broken. It was too stupid of a build system to use the last known good.

    So, all of a sudden you get one trivial change in some module about 4 steps removed from your stuff. But, it was all broken, and your stuff couldn't be properly built until someone fixed their stuff, and the build system went through at least one more cycle, often two.

    Sometimes, companies get themselves into such a borked state with their build system (or lack thereof) that it makes doing any work impossible.

    Some of us started keeping our own local copies, and writing local build scripts, because we couldn't rely on the company wide one to actually work much of the time.

    --
    Lost at C:>. Found at C.
  20. Re:Here's a concept to prevent this crap - UNIT TE by Anonymous Coward · · Score: 0

    Unit testing! The silver bullet for everything.

    If your parents had unit testing you never would've been born.

  21. Re:Dependencies Problems = "It builds on my machin by Sowelu · · Score: 1

    This, this, this. Dependency issues on a build server are so often things like "we added this dependency on a library locally, but didn't update the build server", or even "we checked in a change that makes it work on the dev box, but didn't make a change needed for the server". That plus forgetting to merge in stuff is really the only way I ever see build breaks (where checked-in code fails to compile, as opposed to compiles failing locally).

  22. Eighteen THOUSAND engineers?! by scottbomb · · Score: 1

    Maybe that's part of the problem. Too many cooks spoiling the broth? Perhaps I'm naive, but 18k seems a bit much for what they produce.

    1. Re:Eighteen THOUSAND engineers?! by rolfwind · · Score: 2

      Well if they won't make the beta programs today that will get discontinued tomorrow, who will?

    2. Re:Eighteen THOUSAND engineers?! by HeckRuler · · Score: 1

      At all of Google?
      Perhaps that'd be true if they were all trying to make the same pot of soup, but in this case it's more like all the cooks in the city with each group in their own kitchen sometimes serving entirely different ecosystems of consumer.

    3. Re:Eighteen THOUSAND engineers?! by Anonymous Coward · · Score: 0

      Not only that but with "over 26 million" builds over a period of 9 months is approximately 1 build per working hour per dev. Sounds kind of excessive.
      FWIW I hear from a friend who knows a few ex-google employees that claim google actively scoops up/hires talent and makes them spin a hamster wheel "so they don't compete with them", essentially burying all the codes/patents unless it's something they want to use for themselves.
      The more you know.

    4. Re:Eighteen THOUSAND engineers?! by EvanED · · Score: 1

      Not only that but with "over 26 million" builds over a period of 9 months is approximately 1 build per working hour per dev. Sounds kind of excessive.

      Really?! Not to me.

      Let's say you're only actually coding half the time you're at work. Now you're talking 2 builds per hour, or one every 30 minutes. I can't speak for everyone, but I start getting pretty antsy if I haven't at least built, let alone tested, what I've been working on for that long. And we haven't even gotten into things like dealing with the failures. It's easy to go through multiple builds in almost no time at all as you see a silly syntax error or whatever, fix, and rebuild. Or even in testing: hit an assertion, look into it for 2 minutes, see what's wrong, fix, rebuild, rerun, repeat.

    5. Re:Eighteen THOUSAND engineers?! by geekoid · · Score: 1

      they produce a lot of stuff. I mean 1000's of things.
      I'm not sure you know what they produce.

      --
      The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
  23. Re:Dependencies Problems = "It builds on my machin by Anonymous Coward · · Score: 1

    And I've worked in many of them. I call this effect "build pollution" and a common cause is simply not checking in files to SVN that were added.

    The #includes are referencing something on the local HDD that no other developer would receive if they resync the repo. End result: everyone else is now broken and you have to go poke the dev with a stick. The other problem is that far too few places have a presubmit test that can check if your code will build by the auto-builder *BEFORE* you submit your code. This means you have to break the build to see if the build would break which is bad practice and doesn't scale well to very large teams.

    The other problem is that many devs don't practice basic HDD cleanliness as you describe. When the instructions for building your code reach a certain size people stop repeating them because they're too complicated. This means bad builds and local tools can be polluting the local build environment in ways that will affect future builds (which usually results in panic, flapping and comedy). Telling people to tear down their machines to clean state won't work if the process to restore to build state is too complex - they'll ignore you and this circus just keeps coming back into town. This also ties in to build reproducibility: if there is no automation to set up the build state (a preconfigured clean HDD image or VM image) then it becomes really hard to know what the build dependencies are. People forget they installed "crapware bag-o-bolts toolkit" and forget to tell everyone else. The IT department won't know. Possibly the build engineer will know because they set up the build machine nodes but then a new dev joins with a fresh OS and BANG. They should probably ask the auto-build build engineer what's on that build box, but most new devs wouldn't know this detail to ask the right person. :)

    You need to know what's on your machine at all times, prune out, clean out, keep the build machine squeaky clean and pristine. Everything that goes onto the build box should be audited and maintained in fresh-boot-state ideally. A VM is extremely helpful in doing this but creating Windows VMs with the appropriate packages can be a painful manual clickfest process. In Linux this practice is rendered trivial and it's par for the course. ...and then there's that time I found build files included via network file share from a random guy's desktop. NOPE.

  24. Re:why greed fear ego based 'societies' fail? by HeckRuler · · Score: 2

    Is this some sort of cry for help? Are you ok? Do you need us to call someone?

  25. Build System? by aliensexfiend · · Score: 1

    The article doesn't mention what build system was used for the C++ code. GNU Autotools? CMake? Plain old makefiles? A build system can help you modularize your build so that a complete recompile does not occur after a syntax or linker error.

    1. Re:Build System? by turgid · · Score: 1

      A build system can help you modularize your build so that a complete recompile does not occur after a syntax or linker error.

      For C++? Are you nuts?!

    2. Re:Build System? by aliensexfiend · · Score: 1

      I am referring to previously built internal libraries and not the module that failed. Some home grown build systems that are basically just makefiles strung together with shell scripts have trouble with incremental builds. I use GNU autotools in case you are wondering.

  26. Re:Here's a concept to prevent this crap - UNIT TE by Anonymous Coward · · Score: 1

    TFA seems to be referring to local builds. I HOPE nobody is watching my local builds, because it would be embarrassing at times.

    That said, any developer who commits broken code to source control should be flogged. Unit tests help a lot, but it's rare that anybody wants to pay us to write unit tests.

  27. Oh oh! I got another one!! by Anonymous Coward · · Score: 0

    People not checking this:

    Installation A + Patch B = Installation B

    That is: the result of patching a known fresh installation results in 'exactly' another known fresh installation. I've seen this a lot with badly maintained Linux kernels in hardward development. People patching up development hardware sometimes results in chaff files on the HDD which interact and cause strange "works-for-me" bugs. This usually results in the hilarious "Downgrade from version 2 to version 1 then upgrade to version 3" debacle. Or you could just...y'know...fresh install version 3 (which no-one does because "it takes too long").

    Also: Things taking too long causes developers to get clever and shortcut things that are actually important. Try ninja-style machine maintenance out of office hours - e.g. cleaner bots, re-install bots, stuff like that. They'll never know you're cleaning house for them.

  28. Hands down, Simplicity of dependencies by EmperorOfCanada · · Score: 1

    Simplicity of dependencies are the only way I survive C++ development. For instance I was just playing with OgreSDK, and it depended on my having a specific version of CMake installed in a specific way, in a specific directory. That's fine, oddly enough I can live with that. But how long before I combine Ogre with something that requires something different about the CMake installation?

    So, for instance I like the Crypto++ library because I can cheat and just slam it into my multi-platform codebase without worrying about keeping it separate. And seeing that over 50% of my code needs to run on 4 platforms I have become very sensitive to this kind of crap. I consider a platform specific #ifdef's to be a personal failure (even though they are lightly sprinkled through my code).

    I somewhat like boost with its mostly header only stuff but that is not without some consequences. POCO is cool but I find that having a single codebase that is multiplatform is an IDE configuration nightmare.

    So what is my favourite solution? I would say that libraries have many virtues but that in the end any fights with them can be horrific. So I am going to go with my present favourite for multiplatform dependency goodness; and that is Cocos2d-x; it isn't perfect but the nice combination of it being a library and part of your code base results in some of the fewest compilation problems that I have ever had.

    I would say that its primary cost is when you go to upgrade to a much newer version of the library. Basically you have a fight on your hands. But that fight is once in a blue moon. Whereas I find some other libraries are a non-stop fight, sometimes with no resolution.

    1. Re:Hands down, Simplicity of dependencies by Anonymous Coward · · Score: 1

      I've seen nightmares in C++ APIs with something as simple as the max() function. Sometimes it's as simple as someone re-"#define"-ing the symbol to something else to fix a build issue, or putting it in a namespace. Since preprocessor directives don't live in namespaces they have global effects - those things can be dangerous because they're totally unexpected and pop up all over the place. It goes against orthogonality and encapsulation.

      Also: using namespace clauses in headers. LOL. NOPE.

    2. Re:Hands down, Simplicity of dependencies by EvanED · · Score: 1

      I've seen nightmares in C++ APIs with something as simple as the max() function. Sometimes it's as simple as someone re-"#define"-ing the symbol...

      *cough*<windows.h>*cough*

  29. Re:Here's a concept to prevent this crap - UNIT TE by turgid · · Score: 1

    How does a unit test prevent a build error?

    Because you have to build your code to run the unit test. The two are (should be) intimately linked. And you should always be building against the latest official working source from the upstream repo.

  30. I blame... by ThatsDrDangerToYou · · Score: 1

    .. Jones, the guy we let go last month. He's pretty much to blame for all build fails for the next few weeks. Then we can start blaming the marketing dept.

  31. Re:Here's a concept to prevent this crap - UNIT TE by OakDragon · · Score: 2

    If your parents had unit testing you never would've been born.

    I would still have been born, just not so buggy.

  32. Re:Here's a concept to prevent this crap - UNIT TE by EvanED · · Score: 2

    And of course everyone always builds with the same configuration, same compiler, on the same platform.

    (We have CI servers in our environment. They break not infrequently. Why? Because someone commits a change that builds fine on Linux, and when MSVC gets ahold of it, it produces a warning that GCC doesn't catch and so the build fails. Or MSVC accepts some piece of code that is not actually legal C++ because it's too loose, so when the Linux buildbots get ahold of it, they complain.)

  33. Build failure is just the beginning. by 140Mandak262Jamuna · · Score: 1
    Large distributed development. Multiple point check ins. (Our divisional build is around 100 execuables and 300 dlls. Corporate level build would easily exceed 1000 executables). Our build group will launch builds on every library every hour and immediately report compilation failures and link failures. But that is just the beginning

    Then comes the installation and packaging failures. The dynamic libs get out of synch, wrong dll gets packaged in, etc

    Then the build is good, it does not crash on every project. But it fails daily validation suite. After clearing that hurdle the build fails certification (same as validation but more detailed comparison with golden results).

    So typically our last daily build is about one day old, last validated build is two or may be three days old. Last certified build could be three to five days old.

    And this is a great improvement compared to the past.

    Biggest advancement that helped us were dirt cheap prices for storage. So we are able to keep multiple older working builds for the developers. Not all of them need the latest build. Second biggest thing was the multicore machines with enough horsepower to launch all the library builds simultaneously. Third was the drop in network bandwidth prices, we are able to consolidate and synch the source code repo with very small (for a developer I mean, not for a video watcher) latencies.

    --
    sed -e 's/Chuck Norris/Rajnikant/g' joke > fact
  34. Re:Here's a concept to prevent this crap - UNIT TE by Anonymous Coward · · Score: 2, Insightful

    Why not just say that you should always build against the latest official working source before checkin? It has nothing to do with unit testing.

  35. Dependencies? by Anonymous Coward · · Score: 0

    At any moment you can do:
    1) Take the enum definition out of its source file
    2) Add an include in the original, including the enum.
    3) Include just the enum in your code, do not include the whole mess.

    This would be easier if you would tell the compiler

    #include

    Of course if those symbols weren't in the include an error would occur, what would ensure that those symbols exist AFTER the include.

  36. Re:Here's a concept to prevent this crap - UNIT TE by Anonymous Coward · · Score: 0

    Your argument is a tautology: If I can detect the problem, then I should be able to detect the problem. Please say something of value instead.

  37. Re:Dependencies Problems = "It builds on my machin by Anonymous Coward · · Score: 1

    A couple of years back I worked on a contract project where the original developers had clearly not actually tried a clean build from scratch with someone who didn't know the system. The project had python, postgres, java, and ruby (at least) and each of those had dependencies - some of which were specific versions of packages, some of which could just use the latest. None of it was documented, of course, because the packages were all just there in the original developers' system.

    It was a nightmare to build and took maybe three weeks to build cleanly - half of this was because I was working on an old slow machine with only 500MB of memory - but then the company bought a new machine and a couple of packages that took an hour or two to build got down to only a few minutes.

    Once the build worked I had a shell script that would run on a clean OS install and required only about three prompts to the user. It was at least minimally documented :) Then I got to start on understanding enough of the code to make the required changes (kind of a problem in itself as the requirements were, at best, foggy and at worst contradictory). Just about the time I had the first real code for them, the contract ended.

  38. Re:Here's a concept to prevent this crap - UNIT TE by turgid · · Score: 1

    And of course everyone always builds with the same configuration, same compiler, on the same platform.

    Yes, they should, and it should be scripted so that it's trivial so that there's no excuse for not doing it every single time.

    Multiple compilers, multiple OSes and multiple binary architectures should all be used and they should all be available to every developer on the network. There should be enough network, storage and CPU capacity to make the builds quick so that there is no excuse for not doing them.

  39. hamster wheel by Anonymous Coward · · Score: 0

    It sounds like like are borrowing Hollywood's playbook. The entertainment industry always wants to keep a buffer of talent available, so they maintain stables of screenwriters whose scripts will never be filmed, an uncountable number of actors waiting to make it big, and then there are all those doomed pilots and straight-to-video movies that keep entire production crews happy and employed.

  40. Re:Here's a concept to prevent this crap - UNIT TE by Anonymous Coward · · Score: 0

    I don't think you understand the study or c++ or unit testing.
    You need to build to run a unit test, and that would have counted as a build error. In fact, with this study unit tests would have increased the build failures.

  41. Gentoo by aliensexfiend · · Score: 0

    I really admire how Gentoo manages the build of so many packages from ebuild. I think the authors of this paper should study this project.

    1. Re:Gentoo by aliensexfiend · · Score: 0

      Because as far as I know, BSD ports is about just package management and not managing the compilation (and configuration of that compilation) of thousands of packages with many of those packages using different build systems themselves like ebuild does.

  42. Re:Here's a concept to prevent this crap - UNIT TE by Anonymous Coward · · Score: 0

    From the study:
    Developers may build with the IDE’s own compiler during development, but must ensure the code successfully builds with the centralized build system before committing.

    They are building before they commit and that is what is being measured.

  43. Thinking about the problem not the syntax by Anonymous Coward · · Score: 0

    When I code, I am thinking at a high level about the problem I'm solving. My builds fail because I make some trivial mistake, like using the wrong method name for the language I'm coding in, or forgetting a semicolon, or forgetting an import statement. Yes, the compiler catches it for me. I'd rather do that than switch from my high-level mental state in the problem domain to a low-level state of compiler and syntax trivialities. I'm solving a problem.

  44. Re:Here's a concept to prevent this crap - UNIT TE by turgid · · Score: 1

    Why not just say that you should always build against the latest official working source before checkin? It has nothing to do with unit testing.

    It does. You shouldn't be putting in new logic bugs with your deliveries. The code should compile cleanly and you should do due diligence to avoid putting in new bugs.

    Bugs are expensive to fix, in terms of debugging time and refactoring of broken code to change additional changes built on top of the broken code.

    It's amazing how much real progress you can make if you follow these simple rules.

  45. Re:Here's a concept to prevent this crap - UNIT TE by turgid · · Score: 1

    I don't think you understand the study

    I didn't RTFA because I could tell from the summary that it was a lot of nonsense.

    or c++

    I understand enough about C++ to know to avoid it wherever possible. I freely admit that my brain isn't big enough to fight against C++ with enough perseverance to get it to do anything useful correctly. I'll stick to C and scripting languages thank you very much.

    or unit testing.

    *cough* Test Driven Development *cough*

    To become half way good at C++ you either need to devote you entire life to it over decades (somewhat like a monk) or have an IQ of at least 200. Life's too short and my IQ is miles too low.

  46. Re:Here's a concept to prevent this crap - UNIT TE by Anonymous Coward · · Score: 0

    It is fair to say there might have been a "unit" being tested and that is why he was conceived.

  47. This excerpt says it all... by Anonymous Coward · · Score: 0

    This excerpt says it all in my opinion: "Almost 65% of all Java build errors were classified as dependency-related, such as cases where the compiler couldnÃ(TM)t find a symbol (the most common one, 43% of all build errors), a package didnÃ(TM)t exist or Google-specific dependency check failed."

  48. Their failure rate is absurdly high! by Anonymous Coward · · Score: 0

    "The study found that the median build failure rate for C++ code was 38.4%, while the median for Java was 28.5%."

  49. Dependencies suck by TheSync · · Score: 1

    "Similarly, almost 53% of all C++ build errors were classified as dependency-related. The most common such errors were using an undeclared identifier and missing class variables."

    OK, why can't a compiler just Google for the dependency?

    Identify everything with a unique ID. When you need to reference it, your system searches all your code (and any other code repositories) for the unique ID.

    Why hasn't this been solved?

    1. Re:Dependencies suck by Anonymous Coward · · Score: 0

      we're not too far from that; someone needs only write the google2easybuild section,
      because easybuild has totally automated the business of multiple builds, dependencies, patching and what have you:

      https://github.com/hpcugent/easybuild/wiki

      Actually, what is really surprising is how small number of software developers have discovered environment-modules (Tcl, C, Lmod); this is the only way you can sanely test your building environments across multiple contexts, for maximum compatibility.

    2. Re:Dependencies suck by tepples · · Score: 1

      And watch someone use that unique ID to refer to code with a backdoor.

  50. Re:Here's a concept to prevent this crap - UNIT TE by Anonymous Coward · · Score: 0

    > run the unit test before committing

    Apparently it's impossible for the typical CONservative. Those Republicans refuse to run unit tests. I have fourteen developers working for me, and nine of them are those religious, racist morons. Their kind refuses to either compile or run unit tests before pushing their changes. That is the way of their kind. They are so entitled they expect others to fix the problems they create. Many(most?) of the problems in this industry could be fixed by not allowing religious or racist people into comp sci programs in college. I know nearly 99% of the problems I have at work are created by those Republicans. They just can't work with others.

    The only thing I've found so far that works is that I have Jenkins (formerly known as Hudson, a continuous integration server) send them a dozen SMS messages every time they break the build. After receiving a $100+ SMS bill for the first month, many of them stopped fucking us over so often by knowingly pushing broken changes. Of course that didn't stop their kind for imposing on the rest of us to fix their garbage, but it helped.

  51. fail often by Anonymous Coward · · Score: 0

    I like to push my code to the repo to get the build server to run checkstyle and fail. At some point someone is going to take that stupid checkstyle out

  52. The more builds fail the better by Esben · · Score: 1

    With C++ I try to make the type system catch errors, for instance by using units for length different from time (boost units). And I often set up make to not only build binaries but also run unittests. Thus if unittests fail, the build fails. It is a lot better that the build fails for the developer, than later on during the release test, and must worse if the program is shipped with an error.

  53. Google Knows Why... by um.yup. · · Score: 0

    "Why do your builds fail? You're not using our platform, languages, framework, or other technologies."

  54. Re:Here's a concept to prevent this crap - UNIT TE by Anne+Thwacks · · Score: 1

    I have often wondered why it seems that most C++ is written by people who would appear to be less than half good.

    --
    Sent from my ASR33 using ASCII
  55. why women don't code also a solution by globaljustin · · Score: 4, Insightful

    I know this is "offtopic" but stay with me and I'll bring it around on-topic...

    A big question that people are throwing Billions of dollars & millions of internet comments about is "How can we get more women into programming/coding?"

    Ok...b/c our industry is by default very complex, it's not unreasonable that to really drill down to an answer to that question might be fairly complex...the answer can be summarized, sure, but to really get at the problem it involves learning a bit.

    Here, in this thread, we find out why...and it affects us **all** not just woman coders, or coders...it affects how the whole company works and the perception of value...witness:

    Why do you assume all warnings are useful?? Some of the compiler warnings are just pedantic and are "noise" such as "variable declared but not used", etc.

    There is a balance between no warnings and pedantic warnings, namely the useful ones.

    One of the things that's nice about the Eclipse IDE is that you can select the importance of selected messages, all the way from "ignore" to "fatal", depending on shop standards and personal paranoia.

    However, the offline builders such as Maven and Ant cannot adopt those preferences, so it's not uncommon for a production build to spit out dozens or hundreds of warnings about things that don't actually matter.

    Working with C/C++ I almost never had clean builds, since even....

    Here we have a central thesis:

    "There is a balance between no warnings and pedantic warnings, namely the useful ones."

    Parent agrees, and describes how using a **proprietary software** (Eclipse) which adds an **extra abstraction layer** to an already ridiculous process...a process which we all know theoretically should be able to be done on a text editor

    the fact that coding, the act of developing, software engineering, the 'real work' has such obtuse solutions, solutions to problems based on...

    PEDANTIC choices...overkill...the lack of discretion...there are many reasons for this but that's another rant

    it's alienating to new people regardless of gender...the only reason many people work jobs as coders is **for the money**

    until we address these fundamental issues, the problems that arise only because some compiler programmer was overly pedantic due to lack of empathy skills will destroy any attempt to get non-traditional types into coding

    right now, you basically have to be a bit autistic, or be able to think that way on command, in order to code...part of it is genetic, but part of it is deliberate...you have to train your mind to think in a "code" instruction manner...why would a woman do all this given other options?

    the solution to pedantic, tone-deaf coding choices is, of course, a fresh perspective that can help get rid of problems from abstractions...

    we need women in coding to help make coding more appealing to women

    so, to make this on-topic, I think **more women in coding** is a long-term solution to problems in TFA

    --
    Thank you Dave Raggett
    1. Re: why women don't code also a solution by Anonymous Coward · · Score: 1

      Eclipse is actually free as in FSF approves of the license.

      http://en.m.wikipedia.org/wiki/Eclipse_Public_License

    2. Re:why women don't code also a solution by tomhath · · Score: 1

      why would a woman do all this given other options?

      For the same reason men do...there's a deadline to be met. In my experience there are very good female programmers, and very bad female programmers, and many in between. Same as men. Your generalization has no basis.

    3. Re:why women don't code also a solution by Anonymous Coward · · Score: 0

      Your post is just one gigantic non-sequitur.

    4. Re:why women don't code also a solution by Anonymous Coward · · Score: 1

      Oh FFS.

      You think the industry as a whole would get better if our tools encouraged the mindset plaguing our current education system? "I can't make any sense of what you wrote and it's probably incorrect (for some value of "truth") but hey, I see you put a lot of effort in it so let's grade you an A anyway."

      The LAST thing we need is for our compilers to give up and say "well this code dereferences uninitialized pointers but hey, I'm sure you meant well and you have better things to do." Ship it!

  56. regression tests and compiling after rewrites by TheBilgeRat · · Score: 1

    People just forget to do these things, then wonder why the nightly breaks.

    Builds fail due to engineer error.

  57. Wouldn't this be expected? by medv4380 · · Score: 1

    Java was made to relieve some of the complexes of memory management and the coding that went with it. Less code in an error prone stage of coding that was inherent in C++.

  58. Clarifications by Afty · · Score: 5, Informative

    Hi, I'm one of the authors of the paper and an engineer at Google. I wanted to clarify some points that have come up in the comments.

    First, we don't believe that failing builds are bad. We wanted to study the typical edit-compile-debug cycle that all developers (at least those writing in compiled languages) use to write code. It's perfectly fine to do something like change the signature of a method, compile, then use the compiler errors to find all places where you need to fix your code. We were interested in what kinds of compile errors people run into, how long it takes them to fix the errors, and how we can help you go from a failed to a successful build more quickly. For example, for one particular class of dependency error, we saw that people were spending too much time fixing it. So we created a tool to automatically fix the error and included the command to run the tool in the error message emitted by the compiler. After that we saw the fix time for that class of error drop significantly.

    Second, this work is not related to checking in broken code. The builds we looked at are work-in-progress builds from Google developers working on their projects, so it's code in intermediate states of development, not code that has been checked in. It's possible that broken code may be checked in, but our continuous build system will catch that quickly and force you to fix the problem. So for all intents and purposes, all of the code checked into our depots builds cleanly.

    Third, by dependency issues we probably don't mean what you think we mean. Within Google we use a custom build system with a custom build file format. Source code is grouped into build targets, and build targets depend on each other, even across languages. You can assume that code checked into the depot builds successfully, and that generally engineers are editing only code in their project and not in their dependencies. The dependency errors we describe in the paper usually result because someone added a source-code-level dependency without adding a matching dependency in the build file, resulting in a "cannot find symbol" error. For example, in a JUnit test you might write the code:
    Assert.assertTrue(foo);
    But if you don't add a dependency on JUnit to the build file, then you will get a compile error because the build system doesn't know where to find the Assert class. We would count that as a dependency error.

    Finally, at Google there is no distinction between "builds on my machine" and "builds on someone else's machine." Our build system requires that all dependencies be explicitly declared, even environmental dependencies like compiler versions and environment variables, so that a build is reproducible on any machine. This is how we are able to distribute our builds. So it's impossible for code to build on a developer's local machine but not on the continuous build system.

    I'm happy to answer further questions if people are interested.

    1. Re:Clarifications by starseeker · · Score: 1

      I am intrigued by these statements:

      "Within Google we use a custom build system with a custom build file format."

      "...at Google there is no distinction between "builds on my machine" and "builds on someone else's machine."

      I'd be curious (if you can say much about it in a public forum) how your build system compares to the approachs used by tools such as CMake and Autotools in terms of introspecting into systems to determine what headers, functions, etc. are available. We use CMake and try to detect all of the characteristics we need to know about the host operating system environment at configure time. How does Google's system tackle the problem of cross operating system portability? Say, for example, someone needs to add Haiku to the operating system targets for their project? What is the process?

      --
      "I object to doing things that computers can do." -- Olin Shivers, lispers.org
    2. Re:Clarifications by Anonymous Coward · · Score: 0

      I have not used CMake, and I've only used Autotools as a consumer, but my impression is that the complexity of those tools come from trying to determine what environment they are running in and configure the build to work in heterogeneous environments. We don't have that problem at Google because (a) our systems are homogeneous and we control all the software running on them (for both building and production), so we know exactly what is available on each system, and (b) because *all* dependencies are encoded in the build file (our equivalent of a makefile). That includes what would be implicit in other build systems, such as preinstalled headers and even the compiler you're using. In our build system the compiler is just another file checked into source control, and your target depends on the source control path to the compiler. When we update the compiler we just check a new binary into source control, and when you sync to head you get it automatically. Simple. :)

    3. Re:Clarifications by zisel · · Score: 1

      To sum it all Google are more concern in what kinds of compile errors people run into, how long it takes them to fix the errors, and how we can help you go from a failed to a successful build more quickly.

    4. Re:Clarifications by Anonymous Coward · · Score: 0

      Thanks for the interesting study and the further info!

    5. Re:Clarifications by geggo98 · · Score: 1

      Which kinds of dependencies do you track?

      Out of my head I can think of run-time libraries, compile time libraries, compile time tools (code generator, etc.), test libraries, test tools (e.g. dummy applications).

      Are you tracking any others?

    6. Re:Clarifications by Anonymous Coward · · Score: 0

      As far as I can remember off the top of my head, that pretty much covers it. It's basically all the stuff you would need to replay a compilation.

    7. Re:Clarifications by ardeez · · Score: 1

      This is why continuous integration is such an important (and great!) thing.

      The old mantra of 'works fine on my machine' - something I used to hear a lot in the days of WINNT 4,SP1,2,3,4,5,6, ADO 1, 1.5, 2, ... IE4.x MSVC runtime version x.xx (so lots of varieties) - really isn't what you want to hear when you're pushing out a release that's been only built on one particular developer's machine and then an email patch rushed out to you.

      When you're at the customer site and they're all looking at you wondering,
        'General Exception 0xC00005'
      'what does that mean' ??!
      'It means I'm going to go back to the office and kill somebody'

      --
      don't be a spelling loser
  59. What is the most common cause of builds failing? by MouseTheLuckyDog · · Score: 1

    Developers checking in code that won't compile. There case closed.

  60. Re:Here's a concept to prevent this crap - UNIT TE by NormalVisual · · Score: 1

    Multiple compilers, multiple OSes and multiple binary architectures should all be used and they should all be available to every developer on the network.

    That's fine for something that's intended to run cross-platform, but not so much for something targeted to a specific operating system - code that's hooking Windows drivers isn't going to fare too well under Linux, for instance. As regards the unit tests, it's trivially easy to have code that runs fine in the unit tests but won't build for production because the test project contains the needed dependencies, but the coder forgot to put those dependencies into the production project. That's not an excuse for broken builds, but it does happen.

    --
    Please stand clear of the doors, por favor mantenganse alejado de las puertas
  61. Re:Here's a concept to prevent this crap - UNIT TE by NormalVisual · · Score: 1

    Developers may build with the IDE’s own compiler during development, but must ensure the code successfully builds with the centralized build system before committing.

    Which is fine if you have the good fortune to have a mirror of the build system on your own machine, but in a lot of situations that isn't the case. Where I work we of course have the raw build scripts that we're expected to run locally before committing, but the CB system we use (Jenkins) occasionally just doesn't behave the same way because it has to do additional processing that we can't do locally, and sometimes will flag spurious errors that can only be fixed by clearing the workspace. Yay for incremental builds.

    --
    Please stand clear of the doors, por favor mantenganse alejado de las puertas
  62. Re:Here's a concept to prevent this crap - UNIT TE by NormalVisual · · Score: 1

    On the flip side, we usually get bitched at if there are no unit tests for new code.

    --
    Please stand clear of the doors, por favor mantenganse alejado de las puertas
  63. Why Software Builds Fail by Anonymous Coward · · Score: 1

    Its the language you use!
    Nicklaus Wirth has spent his life developing software "as simple as possible, but not simpler" (A. Einstein).
    I program in Component Pascal (a super set of Oberon-2).
    If I can get past the compiler I am 80% finished whereas with C++ if you can compile you are only 50% of the way there.

    Strongly typed language.
    Garbage collection (yes, Java pattern theirs based on Oberon).
    Modules that are units of compilation and units of execution.
    Everything is hidden within a module unless you explicitly export it.
    "Header files" are automatically generated by the compiler.
    Commands, procedures that can be executed in any modules without a main program.

    Component Pascal is a lovely language.

  64. Here's a concept to prevent this crap - UNIT TESTS by m1ss1ontomars2k4 · · Score: 1

    Did you read the article? At all? This is about build breakages during development, while you are still writing code, before you are even committing it. This has nothing to do with submitted code whatsoever.

  65. Re:Here's a concept to prevent this crap - UNIT TE by tepples · · Score: 1

    code that's hooking Windows drivers isn't going to fare too well under Linux

    Of course it will, so long as you run Windows under Linux. All you have to do is have your test process spin up a Windows VM on a Linux machine and hook the driver there.

  66. Re:Here's a concept to prevent this crap - UNIT TE by tepples · · Score: 1

    Then run the unit test on the subset of the program that does build.

  67. Re:Here's a concept to prevent this crap - UNIT TE by NormalVisual · · Score: 1

    And the benefit of this extra step is...?

    --
    Please stand clear of the doors, por favor mantenganse alejado de las puertas
  68. Good luck automating a dual boot by tepples · · Score: 1

    As I understand it, it's a lot easier to automate starting a VM than to automate a dual boot. So the benefit is that developers' machines don't have to dual-boot for a pre-checkin automated smoke test.

    1. Re:Good luck automating a dual boot by NormalVisual · · Score: 1

      Okay, there's the misunderstanding - I hadn't understood you were talking about automated pre-checkin testing. I still am not seeing the need for "multiple compilers, multiple OSes, and multiple binary architectures" mentioned by the original poster for a product that is intended for a single platform. I frankly don't care whether my code builds and how it runs under Clang when we're a Visual Studio shop. Of course it's different for an open-source organization or a library vendor that needs to support multiple build/run environments, but those are rare exceptions. For most, we're talking about adding a lot of complexity, time, and maintenance costs to get a common code base for a number of different build environments that will never be used in production, particularly when there's a full-time QA department available.

      --
      Please stand clear of the doors, por favor mantenganse alejado de las puertas
    2. Re:Good luck automating a dual boot by EvanED · · Score: 1

      In addition to the other response, I have a couple others.

      First, having a code base that will compile under two disparate compilers (e.g. GCC + MSVC) will help you have cleaner code. Each compiler will find things (whether they be real problems, latent problems, or completely spurious non-problems) that the other won't, and your code will be better for having done it.

      And sometimes those differences matter; e.g. MSVC is (slowly) moving toward better standard compliance with C++. I'm not sure what the deal is with flags when it comes to whether you need to explicitly request the conforming behavior or what, but those changes could, in edge cases, silently change the behavior of your code. Building with GCC as well as you go would reduce the probability of that, as well as mean that you make required changes to get it to compile under a conforming compiler gradually instead of all at once when you decide to upgrade to the new version.

      Now, worth it if you're as sure as you can practically be that you're sticking on one platform? Up to you to decide. But there's a pretty big benefit.

    3. Re:Good luck automating a dual boot by EvanED · · Score: 1

      Also, with regard to "Of course it's different for an open-source organization or a library vendor that needs to support multiple build/run environments"... it's not an edge case to support multiple platforms. There are lots of closed-source programs that run on multiple platforms you know; possibly more than single-platform ones. (At least if you look at software you can actually buy, as opposed to stuff developed for in-house use only.)

    4. Re:Good luck automating a dual boot by turgid · · Score: 1

      Okay, there's the misunderstanding - I hadn't understood you were talking about automated pre-checkin testing. I still am not seeing the need for "multiple compilers, multiple OSes, and multiple binary architectures" mentioned by the original poster for a product that is intended for a single platform

      Different compilers on the same platform find different bugs (warnings, errors).

      Different static analysis tools also find different defects.

      Different numbers of CPUs/Cores find different timing bugs, deadlocks, race conditions, corruption etc. on concurrent code.

      Different binary architectures show up endianness bugs and subtle corruption bugs due to alignment of data in memory.

      Different OSs find different run-time behaviour problems and dependency problems. They also find problems in any OS abstraction code.

      The more compilers. analysers, machines, architectures and OSs you use, the more bugs you find, and the more bugs you find and fix, the higher the quality of your product.

      It's always easiest to develop on top of a high-quality code base. That's when you're fastest.

      You don't need a QA department. Automation can get you 80-90% of the benefit.

      You don't need to do everything all at once. Start adding new tests, builds and platforms as you go, a bit at a time. You should see your velocity increase very soon.

  69. Re:Here's a concept to prevent this crap - UNIT TE by Darinbob · · Score: 1

    But if you do the build that does not mean that the official build will work. Many of my build failures came because I forgot one less frequently used build option (ie, we build for several different boards across two architectures with a set of options, plus a simulator and set of regression tests). As in the code change looks entirely innocuous, no way it would work on one build but break another build, until I check in in and discover there's a conflict with someone else's code that's only in a configuration I forgot to build...

    So solution seems simple, just build all the possible combinations on the local machine, every time, before checking in your one line change. Except that it may take well over an hour for those builds to finish and everyone's waiting on me to stamp the release and send it to QA, or it's 7:30 at night and I want to go home. So people make shortcuts. (and really, it's not a disaster if the daily build fails, you just submit the fix and go again)

  70. Re:Here's a concept to prevent this crap - UNIT TE by Darinbob · · Score: 1

    Excuse is that it takes one to two hours for the all the combinations to build. We do have an automatic test build kicked off whenever any code is checked in though, which means that if there is a problem it gets found and fixed quickly before the real daily build is started at night. So only drawback to a failed test build is the embarrassment of emails being sent to coworkers.

    And do you know how hard it is to get all the equipment necessary to do the job? It's not like I can just go grab this stuff off the shelf. Even getting vmware was a huge nightmare for awhile (most devs didn't need it). We can demand that the build servers get faster but it takes real political clout to make it happen (and I don't have any). For a smaller startup the resources may be far too scarce to get decent equipment.

  71. Fragile base class by tepples · · Score: 1

    I think turgid might have intended to allude to the fragile base class problem, where anything that derives from or instantiates the class needs to be recompiled whenever a field or a method signature is added to, changed in, or removed from the class. Apparently C++ suffers from it more than other languages.

  72. Re:Here's a concept to prevent this crap - UNIT TE by Darinbob · · Score: 1

    That's why people should use the official compiler used in the build and use exactly the same makefiles as the build, and if IDEs are used then they should never count as having built before checkin (if the IDE user can't figure out a command line to type "make" then they need a simpler job).

  73. Re:Here's a concept to prevent this crap - UNIT TE by Darinbob · · Score: 1

    Because for awhile C++ was extremely popular. Which means lots of developers using it. Which means lots of dumb developers using it.

    Though everything will always have the below-median-proficiency developer, of course. But it seems that when you look across the board at all developers, regardless of language/system, that the less adequate developers migrate towards the popular languages and systems. It makes sense, as it's good job security, the laid off inept COBOL programer will have a really tough time finding another COBOL job, but an inept Java programmer will have a much easier time finding a new Java job.

    But practically speaking, C++ is a strange hybrid. It is simultaneously a high level language and a low level language, and it mixes together several different programming paradigms, and it prefers to add keywords to allow variations on a feature rather than put its foot down and disallow an option. So there's a LOT to learn to become proficient relative to say Java or C.

  74. Re:Here's a concept to prevent this crap - UNIT TE by Darinbob · · Score: 1

    Unit testing is like XML. If it's not solving the problem then you're not using enough of it.

  75. Because platform requirements change by tepples · · Score: 1

    I still am not seeing the need for "multiple compilers, multiple OSes, and multiple binary architectures" mentioned by the original poster for a product that is intended for a single platform.

    Because platform requirements change.

    Some changes are foreseen The "timed exclusive" is a common practice in the video game industry. Some developer programs with Sony Computer Entertainment include a financial incentive for a studio to release on PlayStation 4 several months before other platforms. At that point, the studio will want to have all its bug fixes and DLC in place for the big relaunch on Steam 52 weeks later. So the studio will want it building and running on PC and PS4 as soon as possible. Some changes are not Practically, all video game studios need to start on Windows or mobile unless they are staffed by veterans of a well-known studio. But in some cases, a startup studio's debut on PC might become enough of a hit that Sony offers the developer a devkit for PS4 and PS Vita to make a port and/or an exclusive game. Or an app originally intended for BlackBerry might have to be ported to Android and iOS after the popularity of BlackBerry itself fails to meet expectations.
  76. Re:Dependencies Problems = "It builds on my machin by Darinbob · · Score: 1

    At a previous company we had a build that could take 8 to 16 hours or more on a developers PC. Slower/cheaper PCs, inefficient build system (visual studio using third party compiler), and a very very slow compiler. I fixed all this by migrating to gcc+cygwin+make and got builds down to 20-40 minutes. But in the meantime everyone was extremely nervous to change things that might cause a long build for everyone. So there were some big bugs in a major header file that people left alone and instead worked around, because changing it meant every file had to be rebuilt. There were typos that no one fixed (I used to think saclingFactor was a medical term until I realized it was as typo). And no one ever did a clean build except for the build master for the daily builds.

  77. Re:Dependencies Problems = "It builds on my machin by Darinbob · · Score: 1

    Ha, that would be bad. One company we had multi-hour builds for some large FPGAs, but that's an inherently long process, and it was always done by the hardware devs and never by the build master. They also had a mult-hour set of calculations on matlab to generate needed components for the system. So it would just run overnight when needed and then verified the next day (and those guys always got the best PCs compared to the hand-me-downs used to write software).

  78. Re:Here's a concept to prevent this crap - UNIT TE by EvanED · · Score: 1

    That pretty much reflects our situation, except that "one to two hours" can easily be higher even if all your platforms are going at once, depending on how much hardware you want to throw at it. Getting everything set up so that everyone can easily build on all platforms before submitting would provide relatively little benefit (especially when you consider that running the full test suite on all of those platforms pre-commit is basically completely unfeasible) and cost a tremendous amount of money in hardware. Meanwhile, like Darinbob's setup, if you check in something that borks the build, you get an email a couple hours later (ok, sometimes several hours later) telling you to fix it.

  79. Build System? by Anonymous Coward · · Score: 0

    Google has a custom build system. The specification is not particularly groundbreaking but is used consistently across the codebase for all languages, which is nice. The main magic is a distributed storage and compilation system. Yes it is incremental, and caches all sorts of things. Dependency analysis is even used to prune tests which don't need to be re-run. As a result I compile & test a lot more than I would working on a similarly large system elsewhere. This is very helpful if you are doing test-driven-development.

    http://google-engtools.blogspot.com/2011/06/build-in-cloud-accessing-source-code.html
    http://google-engtools.blogspot.com/2011/08/build-in-cloud-how-build-system-works.html
    http://google-engtools.blogspot.com/2011/09/build-in-cloud-distributing-build-steps.html
    http://google-engtools.blogspot.com/2011/10/build-in-cloud-distributing-build.html

  80. Code changes by paulo.ortolan · · Score: 1

    Everybody knows that code changes and mistakes are made. Then, every fix is an opportunity to make it better, stronger and reliable. When this happens developers loses compatibility and such. There is no way to keep code building everytime without errors. Building is a continuous process that the maintainers will keep code up for the rest of the software's life. Good luck and thanks for all the fish.

  81. you are scared of competition by globaljustin · · Score: 1

    you're pissed that i'm right...that all the stupid Dungeons/Dragons bullshit of the world of coding is both the cause of "failure of software builds" and "lack of women in coding"

    it's two symptoms of the same problem

    the fact that you think a solution means this:

    The LAST thing we need is for our compilers to give up and say "well this code dereferences uninitialized pointers but hey, I'm sure you meant well and you have better things to do." Ship it!

    proves you are just being obtuse for no reason

    ***OF COURSE*** i'm not advocating shipping inferior products or making a compiler that is not effective for its intended purpose

    you're an idiot...solving these problems will only help you...

    unless you're scared of the competition

    --
    Thank you Dave Raggett
    1. Re:you are scared of competition by david_thornley · · Score: 1

      If you can propose something to avoid some of the BS, do so. We've had the concepts of "essential complexity" and "accidental complexity" around since, IIRC Fred Brooks (could be Gerald Weinberg, though). (The combination is much like Einstein's "Make things as simple as possible, but no simpler.".) It may have a disproportionate effect on women, vs. men, but I don't see why more women in programming would change anything here.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
  82. Metrics.... by Anonymous Coward · · Score: 0

    I read the first few paragraphs. They've *got* to be kidding - novice vs. experience is the number of builds in the last three months?

    Let's try this: divide the programmers up into "people with > 1 yr, 3 yrs, and 5yr experience programming, and those with 1 yr. *Now* count the number of builds per group, and the failure rate.

                      mark

  83. Magic Builds! by Slashdot+Parent · · Score: 1

    Ugh, I hate magic builds. You know, the kind that only build on a single developer's workstation using code that's not pushed to the central git server. Unacceptable. The only solution is to insist that all software be buildable on a vanilla machine, but most cowboy devs don't like edicts too much.

    The way to fix the cowboys is to give them a gift. A gift that takes away their goddamn high horse. That gift is an automated build tool that automatically builds and deploys their pushed changes to the dev environment. That way, their laziness can override their egos and they accept the tool, but in order to use the tool, they have to spend the extra few minutes scripting their builds properly and an extra few seconds pushing their code.

    The effects at my current client have been awesome. No more, "Oh, Bob has to do a build because he's the only one who can do it." Or "only Frank has the latest changes." Or "Oh, the build script is this word doc that might be up to date, but then, it might not be." Or "Oh, the production code isn't quite committed to git yet. It's on Chuck's laptop."

    Yuck.

    --
    They don't grade fathers, but if your daughter's a stripper, you fucked up. --Chris Rock
  84. Re:Metrics.... Experience Not by petervandervos · · Score: 1

    Indeed. Experience if you did "at least 1,000 builds in the previous nine months". That's not experienced, try 10,000 builds in the last 10 years.

  85. WTF? by carys689 · · Score: 1

    Sounds like a weak excuse for a research project.

  86. Re:Here's a concept to prevent this crap - UNIT TE by david_thornley · · Score: 1

    I used to work at a company that supported pre-standard C++ compilers on Sun, HP, and DEC, and some of the stuff was also supposed to be compilable with VC++ 6. The build was never clean. Never. When they wanted to add AIX to the mix, some of us pushed back and said we should convert to C++98, which at least gave us a chance of a clean build.

    --
    "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
  87. Re:Here's a concept to prevent this crap - UNIT TE by david_thornley · · Score: 1

    The gap between (amount of time needed to compile and run at least the faster unit tests) and (amount of time between somebody else committing changes that can potentially interact with yours) seems to be closing around here. I don't have a solution yet.

    --
    "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
  88. scared & you dont understand by globaljustin · · Score: 1

    I don't see why more women in programming would change anything here.

    so you just "dont get it"

    no detail...just "i don't see it"

    after 3 comments....if you were interested in discussion you'd have engaged with my points by now

    you're just trolling now

    also, new words to describe "do the best thing"...whether it be called "essential complexity" or "user-centered design" or whateverthefuck...those are just new words...same concept since humans first made fire...

    it's about ******why its not happening*******

    which is all addressed in my post...which you haven't discussed except to say

    "i don't see it"

    that's what i'm going to do to any more of your comments on this thread btw...

    --
    Thank you Dave Raggett
    1. Re:scared & you dont understand by david_thornley · · Score: 1

      FWIW, this was my first comment in the thread. You seem to be confusing me with other people.

      What I am saying is that computer languages have variable amounts of unnecessary complexity, and that this is generally bad. It's bad for men, it's bad for women, it's bad for the autistic and the non-autistic. The reason it is there is not that men don't care, but that people really don't know what to do about it. It may affect women more than men, but I've seen no evidence that women are inherently better at language design than men, and no evidence that men wouldn't want programming languages with less unnecessary complexity. If you can coherently explain why the number of women in programming affects this, please do.

      Programming language design isn't magic, and doesn't automatically change to be nice to women.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
  89. Who broke the build? Shoot a nerf missle at them by WhiteDragon · · Score: 1
    --
    Did you mount a military-grade, variable-focus MASER on an unlicensed artificial intelligence?
  90. b/c you suck at coding maybe? by globaljustin · · Score: 1

    ok fine...looks like you want an actual discussion

    The reason it is there is not that men don't care, but that people really don't know what to do about it

    "people really don't know" my ass...you're giving up without a fight

    **bad design is fixable**

    just look...at...microsoft...virtually all their shitty design elements can be changed and FIXED

    again, anything that is designed is able to be improved

    The reason it is there is not that men don't care, but that people really don't know what to do about it

    again, you're trying to 'straw man' me...nowhere did i indicate that I thought any of these things

    no evidence that men wouldn't want programming languages with less unnecessary complexity....If you can coherently explain why the number of women in programming affects this, please do.

    damn you...my whole post was started by me explaining how it's hard to give this kind of concrete evidence and that the conversation i quoted was a window into understanding a complex situation

    also, men made all the shitty programming languages in existence right now....ALL MADE BY MEN...so at least ***some*** men will at least tolerate shitty programing language design

    the reason for women not being "in coding" right now is...complex...its not **one thing** and it spans millenia

    you have to stop over simplifying without understanding the context

    I've seen no evidence that women are inherently better at language design than men

    there is plenty of evidence to suggest women are ****better communicators****

    which is ***all coding is***

    humans communicating instructions to machines

    you need to remember that when you analyze this situation

    i'm still pissed at you for being so abstract with your replies

    find a way to state your objection clearly in one thesis statement

    --
    Thank you Dave Raggett
    1. Re:b/c you suck at coding maybe? by david_thornley · · Score: 1
      Thesis statement: Looking at programming language design as a man/woman thing isn't useful.

      Programming language complexity is partly an abstract problem. The problem is how to get things as simple as possible, but no simpler. Programming languages are comparable to mathematical notation, and that advances slowly. A particularly simple language, like a good redesign of C, may require more complicated constructs than is desirable. A language with very powerful constructs, like Lisp or C++, may have other issues. It seems to me you're describing things as "fixable" far too glibly. Every problematic feature in every programming language is there for good reasons, and while some things are easily fixable, other things may not have a good solution anybody's figured out.

      Fundamentally, a large computer program will be complex. Part of it is that it has to model the problem in great detail, and the problems are likely to be complex. This we can call "essential complexity". Part of it is that our programming languages and design processes aren't ideal, and this is "accidental complexity". There's different approaches here, such as the Unix "make the simple stuff easy and the hard stuff possible" or Microsoft's "make it easy to do the Microsoft way, and let's not worry too much about people who aren't".

      As a general rule, women are better at communication than men, although it's a rule with all sorts of exceptions. Again as a general rule, men are better at understanding what is to be communicated here, again with all sorts of exceptions. For this purpose, it doesn't really matter whether these tendencies are biological, sociological, or produced by mind control lasers. Are you holding COBOL up as some sort of exemplar (because of Grace Hopper)?

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
  91. i agree! by globaljustin · · Score: 1

    haha no I totally see where you are coming from.

    Looking at programming language design as a man/woman thing isn't useful.
    Programming language complexity is partly an abstract problem. The problem is how to get things as simple as possible, but no simpler.

    this is a good way to summarize it

    also, you do a good job of explaining 'complexity' in regards to making a large computer program

    As a general rule, women are better at communication than men, although it's a rule with all sorts of exceptions. Again as a general rule, men are better at understanding what is to be communicated here, again with all sorts of exceptions. For this purpose, it doesn't really matter whether these tendencies are biological, sociological, or produced by mind control lasers

    see, I agree here too, but I'm not trying to fool you by agreeing with you

    the 'general thrust' of my call for more women is programming is to create balance...this is a more abstract concept than what you are elucidating

    i want to "deal them in" so to speak...you might even think of my comments coming from the perspective of a tech company owner...the person who sets hiring policy...than from one of the coder guys

    thanks for the response...as I said I'm not a full-time coder guy but i like to think i get the concepts...i have a 'systems science' background and a dbase mgmt stint...my coding started with FORTRAN type stuff on huge data sets & massive data transfers between systems

    --
    Thank you Dave Raggett