3 ms·
Versioning doesn't have anything to do with this piece of code.
by dchest 13y ago
Versioning doesn't have anything to do with this piece of code.
- _sabe_ 13y agoWhy would you commit this code? If it's a test, put it in a branch and once the problem is solved, merge it in?
- dchest 13y agoHave you read the comment? This disabled part of code is used for communication: "If someone is able to circumvent this problem, please email me". When someone reads the code to discover why it works in a certain way, they'll instantly learn that the developer thought about this, and tried to do something, but discovered that an external bug prevents him from enabling this code. It's also common to include TODO, FIXME, or BUG comments into code. Sure, you can put them into issue tracker, but having them directly in code gives more context.
- dreen 13y agoI think the point is that the developer should stash it or use a branch or something, instead of having code in master that never runs. The technique itself is useful for debugging, but not much else.
- chris_wot 13y agoYeah, but it does tend to highlight to anyone reading the code that this code should work, but to look at the comment before the if statement. I'd very rarely use this sort of thing, but in this case I'd say it's OK.