Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • I agree that I could only use classes instead of structs to get this behavior. But since the language permits it, if another programmer on my team uses a struct, I need to know additional information about his type. It's just "one more thing" to check. The issue that I'm getting at is that the language should allow me to know this by looking at my "local context" only. Commented Mar 30, 2016 at 20:02
  • You can hover over the variable in Visual Studio, and it will tell you if it's defined as a struct or a class. Commented Mar 30, 2016 at 20:03
  • I definitely agree with you that method chaining should always be approached from an immutable perspective. However, a beginner may make the mistake of accidentally mutating the reference in his implementation; and the caller can't know this until a bug occurs. Value semantics for parameters would allow the language to mitigate this. Commented Mar 30, 2016 at 20:05
  • I know, I do this all the time (hover over) and it doesn't cause any problems for me. I'm just interested in language design from a theoretical approach. Visual Studio is a tool that provides extra information. I was just wondering if the language, as a stand-alone entity should help more. Commented Mar 30, 2016 at 20:08