Skip to main content
9 events
when toggle format what by license comment
Mar 9, 2016 at 5:21 comment added Matthew +1 for the first point. That is probably the most relevant point - the answer will be read by people who aren't the OP and any assumption about the OP may not apply to them.
Mar 8, 2016 at 21:12 comment added notbad I have updated the question, You will find why I ask this question.
Mar 8, 2016 at 17:04 comment added Martin James If some dev wishes to blow themselves up by trying to defuse UB, fine. What I can't support is posting on SO, asking about detonator removal, instructions on using wire-cutters and which colour wire to cut:(
Mar 8, 2016 at 16:30 comment added Nicol Bolas @Rob: I want to add to what Code Gray said: "There is very little that you can learn from studying the behavior of code exhibiting undefined behavior, except perhaps understanding some of the quirks/implementation-details of the compiler." That is perhaps the most dangerous thing about trying to learn purely from undefined behavior. You think that you have some idea of what's going on, but you really don't. What you have is an incomplete understanding based on an arbitrary decision made by compiler developers that can be changed in the future. "Learning" this way is highly dangerous.
Mar 8, 2016 at 14:42 comment added MSalters @Rob: The problem with that approach is that you have to really understand optimizing compilers. Once you go off the rails, so will they, and the result may be impossible to explain without understanding the compiler internals. For instance, calling a function with invalid arguments will tell todays compilers that the call is in fact unreachable, and quite a bit of code around it can then be transformed.
Mar 8, 2016 at 11:40 comment added Cody Gray Mod I didn't say that "trying to learn something new" or "testing things out" makes someone a bad programmer. Far from it. I said that good programmers don't write code that exhibits undefined behavior on purpose without a really good reason. There is very little that you can learn from studying the behavior of code exhibiting undefined behavior, except perhaps understanding some of the quirks/implementation-details of the compiler. You would be far better off reading the compiler documentation to get that information. @rob
Mar 8, 2016 at 11:38 history edited Martin Tournoij CC BY-SA 3.0
I don't think that "you are what you vote" ;-)
Mar 8, 2016 at 11:36 comment added Rob Mod Good programmers don't write code that exhibits undefined behavior and then try to figure out why it is behaving in that way - I must absolutely disagree with this. Trying to learn something new, or testing things out doesn't make someone a bad programmer - quite the opposite, in fact.
Mar 8, 2016 at 11:07 history answered Cody GrayMod CC BY-SA 3.0