Tagged Questions
20
votes
4answers
2k views
What's the difference between implementing an Interface explicitly or implicitly?
In Visual Studio I can right-click on an interface and choose to Implement Interface, or Implement Interface Explicitly.
public class Test : ITest
{
public string Id // Generated by Implement ...
6
votes
3answers
423 views
Is there a reason to prefer lambda syntax even if there is only one parameter?
List.ForEach(Console.WriteLine);
List.ForEach(s => Console.WriteLine(s));
To me, the difference is purely cosmetic, but are there any subtle reasons why one might be preferred over the other?
17
votes
5answers
2k views
A practical use of “yield” keyword in C#
After almost 4 years of experience, I haven't seen a code where yield keyword is used. Can somebody show me a practical usage (along explanation) of this keyword, and if so, aren't there other ways ...
5
votes
4answers
599 views
Shouldn't the lazy evaluation/execution be syntactically differentiated from eager evaluation/execution in C#?
We know about the deferred execution or lazy evaluation features introduced in C#. But at times, people become confused with them. Because there is no significant difference. You can only know if you ...
28
votes
22answers
5k views
Why is VB so popular?
To me, Visual Basic seems clumsy, ugly, error-prone, and difficult to read. I'll let others explain why. While VB.net has clearly been a huge leap forward for the language in terms of features, I ...