I work with C# professionally and I write code like this all the time.

private IEnumerable<Something> GetAlotOfSomething()
    if (somethingA.IsReady)
        yield return somethingA; 
    if (somethingB.IsReady)
        yield return somethingB; 
    if (somethingC.IsReady)
        yield return somethingC; 

    // ... More complex logic

var specialSomethings = 
    .Where(s => s.IsSpecial); 

Then one day I have to write a bit of VB6 or JScript and I end up writing so much boilerplate just to get things done. Anyone thoughts?

closed as primarily opinion-based by user40980, user22815, durron597, GlenH7, Dan Pichelman Aug 24 '15 at 15:47

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

  • No. I do not feel that way. – Paul Nathan Sep 14 '10 at 21:09
  • @Paul - Says the guy with 200 C++ tags. :) – ChaosPandion Sep 14 '10 at 21:12
  • I do say so. I have worked with upwards of 10-15 languages at this point. I do not feel that this is a must-have in a modern language. – Paul Nathan Sep 14 '10 at 21:13
  • 3
    I feel C# will soon discover macros... – P Shved Sep 14 '10 at 21:15
  • 1
    @Pavel - I know what macros are but I can't see the reason you posted that comment. – ChaosPandion Sep 14 '10 at 21:28

Iterators (generators etc) are certainly great features that I use a lot. I don't qualify them as necessary, but I will certainly choose languages that have them when I get a choice.

  • OK so maybe I am being a bit dramatic, but still they are a definite productivity booster. – ChaosPandion Sep 14 '10 at 21:13

They're... Handy.

But you can always just write your own if necessary. The big wins come from standard library / framework support.

  • 1
    Underneath the hood they are trivial to implement but writing your own doesn't read gain you much with out the syntax sugar. – ChaosPandion Sep 14 '10 at 22:24
  • 1
    @Chaos: consider the use of iterators in C++'s STL: no direct syntax support (prior to 0x), but fantastically useful because so many generic algorithms supported them. You implement your own iterator according to the pattern, and suddenly find the rest of your work done for you... (well, to a point) – Shog9 Dec 18 '10 at 3:52

Not the answer you're looking for? Browse other questions tagged or ask your own question.