Should LINQ Be Banned from C#!?
Microsoft's AI Smart Components add clipboard-driven form filling, suggested combo-box options, and sentence autocomplete to .NET web interfaces.
Transcript 2 topics
Why LINQ is banned
0:00You may not be ready for this video and I'm not sure I am either. Can you imagine your boss banning link in your dot net code? I came across a Reddit post yesterday and was simply amazed. So many questions. No link in queries?
No extension methods? Is it linked to SQL? What are we talking about here? The original poster gave us some more context a little later and said that they primarily use extension methods but all link is banned. That's linked to SQL.
That's linked queries. That's linked extension methods. And probably the most shocking of the revelations was that they hard code their SQL with a custom error prone ORM. Holy free holy. Where to begin?
And now if they had been talking about link queries, I could maybe get on board because if it's a complex query, it can be sometimes hard to read. And the performance is sometimes less than stellar. But they mentioned they're specifically talking about extension method. And unless you're writing some really ugly queries in those extension methods, I just don't get this. Secondly, mentioned that link as a whole is banned.
And you know, this wasn't answered by the original poster but I'm dying to know if lambda expressions are banned because that's the same syntax. Now, I'm already troubled by this post But then I read the third point. SQL queries are hard coded using an old, ugly, error prone ORM. What the what? Let's let's just take a minute.
Hello. This is twenty twenty four calling. If you are still hard coding your SQL in your dot net code, you're doing it very very wrong.
Hard-coded SQL problems
1:43Now that we're done with the public service announcement, let's get back to it. Well, can chalk up having some personal vendetta against link where, you know, an error has happened in the past and you blamed link for it so it's banned from now on. I don't understand hard coding your SQL in your app. That's just just mind boggling. Two commenters had really good points.
Can you imagine telling a JavaScript developer you can't use reduce or split or map or filter or find? I can understand not using a for each for performance reasons, but I can't imagine telling a JavaScript person that you can't use all those array methods. One commenter had a really good point and I believe it's probably the truth and the root of this whole issue. At some point, someone had a problem, a production bug, they probably got yelled at and they needed a scapegoat, Hey, we used link. Link is the problem.
No more link. Which probably means, hey, you should have had unit tests and the original poster confirms we don't really use unit tests and our boss thinks they're just a waste of time. This is one of the I just my brain is gonna explode. The only thing I can tell the original poster is, hey, you might want to start polishing up the resume and getting things out there and maybe find a place that's gonna let you write code without one arm tied behind your back. I mean, really, have you ever had an employer restrict what dot net features you can use?
And I'm not talking about nougat packages or third party components. I'm talking about built in dot net features. Whew. What a ride. Until next time.
Sign in to join in. Reading needs nothing.