Well written thoughts on C#12 primary constructors. Sadly they are not really useful. At least for now.

  • MihiesOP
    link
    fedilink
    arrow-up
    1
    ·
    23 days ago

    Yep, I know I could assign those manually to readonly fields or such. But then I don’t profit much and also risk of field duplication (as described in article). Also I use CodeRush to auto generate constructors for me (after manually typing all readonly fields) - that way I have less typing to do than using primary constructors. I guess CodeRush could do it the other way round as well, but still, there is problem with duplication at least. I don’t know, perhaps is subjective, but I’m avoiding primary constructors for now.