Quantcast
Channel: for vs. foreach vs. LINQ - Software Engineering Stack Exchange
Browsing all 6 articles
Browse latest View live

Answer by Michael Brown for for vs. foreach vs. LINQ

While there are some great expositions already on the differences between for and foreach. There are some gross misrepresentations of the role of LINQ. LINQ syntax is not just syntactic sugar giving a...

View Article



Answer by Timothy Baldridge for for vs. foreach vs. LINQ

The difference between LINQ and foreach really boils down to two different programming styles: imperative and declarative. Imperative: in this style you tell the computer "do this... now do this... now...

View Article

Answer by Arseni Mourzenko for for vs. foreach vs. LINQ

for vs. foreach There is a common confusion that those two constructs are very similar and that both are interchangeable like this: foreach (var c in collection) { DoSomething(c); } and: for (var i =...

View Article

Answer by Inverted Llama for for vs. foreach vs. LINQ

Can other developers in the team read LINQ? If not then don't use it or one of two things will happen: Your code will be unmaintainable You'll be stuck with maintaining all your code and everything...

View Article

Answer by AakashM for for vs. foreach vs. LINQ

but I can see the code becoming less and less readable Readability is in the eye of the beholder. Some people might say var common = list1.Intersect(list2); is perfectly readable; others might say...

View Article


for vs. foreach vs. LINQ

When I write code in Visual Studio, ReSharper (God bless it!) often suggests me to change my old-school for loop in the more compact foreach form. And often, when I accept this change, ReSharper goes...

View Article
Browsing all 6 articles
Browse latest View live




Latest Images