Weirdest bug ever

Started by
21 comments, last by ordered_disorder 17 years, 7 months ago
It seems some people has misinterpretted this discussion as being about 'good code' or 'bad code', when in fact it's about 'any code'. If you change the code being compiled, you can get better results. But that's not the compiler's job. If you take the exact same piece of code and write it in assembly, you will find it neigh on impossible to beat the compiler's assembly. I'm not advocating writing slow code and relying on the compiler to make it fast. I'm advocating letting the compiler do it's job. If your code is bad, the compiler's optimizations won't magically make it good.

Quote:They blindly rely on their tools and choose to do no investigations into how their tools or hardware function. Evidence being statements like "You cannot beat the compiler. Period."
Actually; that statement on my part has come from experience and investigation. I know how my compiler functions, and I know how my CPU functions. I'm by no means an expert, but I know enough to understand how they fit together - and to understand that until I am an expert, with as much experience in and knowledge of my particular CPU as the people who designed it, I won't be able to beat the compiler. Yeah, you can beat the compiler. But you'll waste more time in development than you'll ever get back from the execution speed gain.

[edit]
Also, when one makes absolute statements, it is often meant with the implied gotcha that 'exceptions to this rule are so rare as to be inconsequential'.
I find your literalism tedious.
[/edit]
Advertisement
Quote:Original post by ordered_disorder
What are you talking about Deyja? I was giving some good trivia on what to do if DON'T want your compiler to butcher your variables, modify and or remove your code in it's optmization zeal.


What the hell compilers have you been using? Let me know so I can avoid them at all costs, because a compiler should NOT butcher your code like you describe. However, I have had some math butchered by a certain compiler (That shall not be named), but those aren't par for the course at all, and they're bugs that should be reported. By the way you're talking about them here, it sounds like you get them every 5 minutes.

Quote:
It should be noted that the compiler can fail in more cases then just macro optimizations. Another example would be Systems programming, where compiler can disrupt and cause failure and undefined behaivor on all levels from the driver to low level userland coding.


Sounds to me like you've been trying to run processor-specific optimisations for code that runs on a different processor.

Quote:
The compiler is a great tool, but if you believe it's all you need to be a good programmer, please don't program in any mission critical sectors, or program my favorite games. I am tired of waiting for patches to fix bugs that should have never been, or having to buy 800$ video card hardware because you think the lastest in 3d technology is best programmed in c#.


I really, really, really doubt that a compiler would cause the kinds of bugs you seem to be talking about. 99% of game bugs are caused by logical errors, not compiler errors. Unless you're calling other programmers that enable optimisations incapable, which is beyond the scope of this discussion.

Quote: On my last comment, what I mean is programmers these days are getting Lazy. They blindly rely on their tools and choose to do no investigations into how their tools or hardware function.


Really, blanket statements like that aren't going to help your rating.
Quote: On my last comment, what I mean is programmers these days are getting Lazy. They blindly rely on their tools and choose to do no investigations into how their tools or hardware function.


Really, blanket statements like that aren't going to help your rating.

You took what I said out of context, the rest my quote is:
Quote:Evidence being statements like "You cannot beat the compiler. Period."


Lol. I love this shit. fuck you. I am done with this community. Enjoy conforming viewpoints and be an average programmer forever.

This topic is closed to new replies.

Advertisement