The Dark Side of LINQ(developerzen.com)

submitted by tentacletentacle(115) 3 years, 9 months ago

I’ve been having mixed feeling for quite some time now regarding LINQ. Sure it can make working with data sources a lot easier and it can definately save a lot of code but it also has the potential of creating cryptic complex code...

10 comments |category: |Views: 614

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

posted by JudahGabrielJudahGabriel(814) 3 years, 9 months ago 0

While any technology can be abused, the author doesn't make a compelling case. The snippet he pasted is not very readable with or without LINQ.

Reply

posted by duckieduckie(150) 3 years, 9 months ago 0

Using a hammer on a screw....

linq = "language-integrated query".. not "language-integrated parsing"

Looks like only "ryan baldwin" makes a good comment..

Reply

posted by JjVvJjVv(122) 3 years, 9 months ago 0

The post itself is however an example of "the dark side" of LINQ. It can be "abused" in lots of ways, which only obfuscate things/make them harder to understand when used in an inapproriate context. Too much people seem to think LINQ is the solution for everything...

Reply

posted by duckieduckie(150) 3 years, 9 months ago 0

Sure it is, but the article does not point that out in a good way, making the writer look stupid IMHO.

And too many people thinking linq being the solution for everything.. Who are those people??? I haven't seen, talked or read posts from any abusing linq in this way (well some, but in the right context)

Reply

posted by dcarrdcarr(790) 3 years, 9 months ago 0

this article is now nothing as you speak. It's about putting linq in context.

Reply

posted by duckieduckie(150) 3 years, 9 months ago 0

Not sure if you are responding to my comments, but let me explain.

No where in his article does he mention, that linq was never supposed to do what he is using it for, and the introduction makes it seems like he is not aware of it.

Reply

posted by jaffarjaffar(0) 3 years, 9 months ago 0

Yep that code looks like fermented midichlorians...

Reply

posted by ekampfekampf(3195) 3 years, 9 months ago 0

Hi Duckie,
I never mention that in the article because that claim, that LINQ wasn't meant to do parsing, is questionable - and that's the debate it was meant to provoke.
In fact, I had a dozen far more hideous and longer LINQ statements that query a DB and I didn't include them because I wanted a relatively simple statement that people could easily run on their machines.
These statements are in the "right context", as you define, but they're still complex statement that makes the code much harder to understand and maintain than it should be.

On the other, the programmer sitting next to me in the office (who wrote) sees nothing wrong with them...
I've also heard responses from other programmers that complain that Microsoft just put SQL into C# as a quick solution instead of working on good ORM solution that'll avoid dealing with anything DB (and SQL).

LINQ provokes all sort of opinions and responses from different programmers and the post's purpose was to get such a discussion going.
I think the comments I got are far more interesting than the actual post...

Regards,
Eran

Reply

posted by duckieduckie(150) 3 years, 9 months ago 0

Good response, got to agree with you, except the parsing ;)

Of course some linq-queries are long, as would the sql-queries be. I like the features of link, but i am not sure, if i will ever use linq for sql.

Reply

posted by ekampfekampf(3195) 3 years, 9 months ago 0

Btw, why comment here and not on the post itself?

Reply

information Login or create an account to comment on this story