10

Just used the dynamic type in c#. Why does it feel so bad?

Comments
  • 4
    Because it goes against the usual strict rules of strongly typed languages. It is only natural that this happens.
  • 3
    var is still strongly typed as it has to be assigned at initialization and cannot be a return type. It makes LINQ so much easier to use.
  • 2
    @p100sch *statically typed
  • 0
    Because you knew the type beforehand? I used dynamic a couple of weeks ago and lived to tell the tale. If I'm being honest with you I think that Object would have done the trick... but it felt so right.
  • 0
    I sigh whenever I see Java code go a similar way. It makes it so hard to see what type is meant to be where, and introduces the potential for all kinds of bugs. Can't stand it.
  • 0
    It depends on your use case. It might be very well a good choice. But use it only if really really needed, never use it for convenience.
  • 2
    Shower. And don't do it again.
  • 1
    @NonImportant- sorry missed that
Add Comment