5 ms·
What's the point of not using stable language features? I don't get it.
by romanovcode 9y ago
What's the point of not using stable language features? I don't get it.
- weavie 9y agoNeither did I.
- Cakez0r 9y agoI've (unfortunately) had to work with this rule before. The justification was that it makes the code more readable. I can understand banning SQL style linq and allowing only functional style, but I guess that's more of a personal preference.
- JustSomeNobody 9y agoWhile it shouldn’t be banned, it should be used appropriately. We have some areas of our project that communicate with hardware where we cannot use it because of the performance hit.
- romanovcode 9y agoYeah, I agree. You can make some seriously shitty unreadable code using LINQ just to look smart. But that's what code reviews are there for.
- btschaegg 9y agoI agree. That, and not using LINQ often enough doesn't resolve that problem per se. Rethinking the problem (or the way you attempt to solve it) might very well improve the code much more. One of Kevlin Henney's talks references a really neat quote by Poul Anderson on this subject: > I have yet to see any problem, however complicated, which, when you looked at it in the right way, did not become still more complicated.
- emodendroket 9y agoSometimes ReSharper makes some seriously wild, unreadable suggestions for converting code to Linq.
- romanovcode 9y agoYeah, but IMO after Roslyn I don't see the benefit of ReSharper, definitely not for the 100 dollar price per year.
- emodendroket 9y agoThat happened right when I started a new job so I haven't touched it that much. R# used to be absolutely essential though.
- tigershark 9y agoWhy on earth? It is resolved by the compiler, there is absolutely no performance difference between using var and explicitly specifying the type.
- ambulancechaser 9y agoundoubtedly that person was talking about LINQ and not var usage
- JustSomeNobody 9y agoYes, LINQ not var.
- btschaegg 9y agoWell, that on the other hand does indeed make sense, depending on the context. The only question there could be if it's a good idea to use a garbage collected language to directly[1] interact with hardware. [1]: Well, at least directly enough for LINQ performance to be a problem.
- JustSomeNobody 9y agoWe're not real time, but we do have some time constraints. Yes, all this was kicked around and argued about.
- dbattaglia 9y agoOr possibly confusing "var" and "dynamic"?
- tigershark 9y agoUndoubtedly he didn't read properly then. The banned feature was var, linq was just heavily frowned upon.
- lightbyte 9y agoAre you talking about "var"? Because that shouldn't affect your performance, this generates equal IL code: var x = 10; int x = 10;
- kylereeve 9y agoI used to work in a company with a similar policy. Never got a satisfactory answer, I think there's just lots of FUD around any language feature that looks different than what people are used to.
- recursive 9y agogoto is a stable language feature.