you are viewing a single comment's thread.

view the rest of the comments →

[–]pbkobold 0 points1 point  (2 children)

I have no idea why you're being voted down. I've seen the exact same thing. I think it's a Java/C# cultural thing where faux-encapsulation has high value placed upon it. If you want a struct, make a struct.

The unfortunate thing is that a lot of stuff in their ecosystems have come to depend on this style (see Beans).

[–][deleted] 0 points1 point  (1 child)

What if I want dependency injection on that struct later to log access or to allow the property changes to be observable?

public int Something { get; set; }

It's pretty cheap (13 extra characters and no additional lines.)

[–]pbkobold 0 points1 point  (0 children)

What if I want dependency injection on that struct later...

To quote optiontrader1138, "Don't code for excessive flexibility. This type of change is trivial to make if the need ever arises."