3 ms·
Not .NET developer here but the usual way is to use some sort of linting tool to "disable" the esoteric features.
by cjalmeida 10y ago
Not .NET developer here but the usual way is to use some sort of linting tool to "disable" the esoteric features.
- flukus 10y agoThese tend to become cargo cult practices, "thou shalt never" that get in the way of those few places where they are useful.
- snaky 10y agoI don't think so. The purpose of compiler warnings, lint-like tools, static analyzers and such is to bring developer attention to some block of code. Not 'Hey, you should not do it this way', but 'Hey, is this thing here as intended by you or just a typo or mistake?'. I like the way its implemented in Perl. Use 'use strict' by default, and guard the block where you really need something unusual by 'no strict something' - refs, vars, subs - so neither compiler nor people reading your code never being confused whether is it a mistake or author's intention.
- cema 10y agoIn C# one can always #pragma warning disable ${list of warnings} and #pragma warning restore ${list of warnings} https://msdn.microsoft.com/en-us/library/441722ys.aspx https://msdn.microsoft.com/en-us/library/441722ys.aspx Although frankly the list of warnings to disable and restore consists of warning numbers, not names, which is not super convenient.