0

When we can achieve all the OOP concepts using classes and objects then why C# still support structures.

  • 2
    OOP has little to do with value vs. reference semantics. Instances of C# `structs` **are** still "objects", just always passed by-value instead of by-reference and have other limitations for practical reasons. – Dai Mar 16 '21 at 04:05
  • 2
    "Achieve all the OOP concepts" isn't the only thing you are trying to do when you write code... – Sweeper Mar 16 '21 at 04:05
  • Also, OOP itself needs to die (or at least stop _getting in the way_ of my expressiveness). Immutability and FP is the future :) – Dai Mar 16 '21 at 04:06
  • Can you please brief the Immutability and FP @Dai – Furkhan Shaikh Mar 16 '21 at 04:19
  • @Dai sounds like you need to get into F#? – Caius Jard Mar 16 '21 at 06:47

0 Answers0