Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×

Comment Re:Dependencies? (Score 1) 279

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.

Comment Re:Because I'm lazy (Score 1) 279

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

Comment Re:Because I'm lazy (Score 1) 279

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.

Comment Re:Because I'm lazy (Score 1) 279

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.

Comment Re:Because I'm lazy (Score 5, Insightful) 279

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.

Comment Re:Eighteen THOUSAND engineers?! (Score 1) 279

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.

Comment Re:Because I'm lazy (Score 1) 279

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?

Comment Re:Here's a concept to prevent this crap - UNIT TE (Score 2) 279

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

Comment Re:Wind chill on a solar collector (Score 1) 110

Incidentally, I should point out that wind chill, as it's measured in the US, tries to incorporate effects other than just an increase in the rate at which the warmed air is swept away from something warm by the wind. Those effects, e.g. facts dealing with the fact that your skin is wet and the air is dry, will not apply to solar panels.

Comment Re:Wind chill on a solar collector (Score 1) 110

Wind chill does not affect inanimate objects. Yes they might cool down to the ambient temperature faster but they will never go lower than the ambient temperature regardless of the wind speed.

The second half of the second sentence doesn't imply the first sentence. If you have something heated to above ambient (e.g. a structure meant for living), a wind chill absolutely will cause you to spend more heating it.

"Wind chill won't cool thing below the actual temperature" is (almost) a solid statement. "Wind chill does not affect inanimate objects" is a BS way of overgeneralizing that into falsehood.

Comment Re:Credit rating databases aren't new (Score 1) 294

She was told 'no' because she went through a carefully thought out and vetted process designed to deal with a very limited supply of a very important item (an organ). The parents decided to escalate the issue and brought the courts in - which was completely inappropriate (if understandable). This was a 'think of the cute little child' moment and had nothing to do with 'death panels' or rationing.

Exactly. The courts got involved, and saved the girl's life. But what about the person who they thus killed who otherwise was going to get that organ? (Or maybe person #4 on the list, who was going to get the organ that #3 wound up getting because person #2 wound up getting the organ that #3 was going to get because #1 got the organ that #2 was gonna get because the girl got the organ that #1 was gonna get.)

If your example is meant to be illustrating how the courts were correcting the "death panels" taht set the guidelines by which she was denied... how does that not make the courts just the new death panels?

Comment Re:Credit rating databases aren't new (Score 1) 294

I'm not going to Bush's fault you. What I will say was that all the "omg death panels" nonsense was presented as if there was some change from the current status quo, or at least without saying "omg this moves the death panels from the companies to the gov't! oh noes!" It was presented as if the death panels were an argument against gov't health care, while that argument would then equally (or, arguably, more, as private health care has a direct profit motive and government health care can at least pretend to not) apply to "we should scrap the current system."

Slashdot Top Deals

Scientists will study your brain to learn more about your distant cousin, Man.

Working...