Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: allow currently mandatory, but syntactically redundant, braces to be optional #208

Closed
6 tasks
DavidArno opened this issue Feb 28, 2017 · 7 comments
Closed
6 tasks

Comments

@DavidArno
Copy link

DavidArno commented Feb 28, 2017

  • Proposal added (draft created at Redundant-brace-removal.md, pull request #207)
  • Championed
  • Discussed in LDM
  • Decision in LDM
  • Finalized (done, rejected, inactive)
  • Spec'ed

This proposal pulls together a couple of related proposals around removing the need to use {}, rather than ; to terminate a declaration, along with one new opportunities to do so, in the following areas:

Please note, this proposal is a replacement for #181, which included removing braces in properties. This was an unpopular suggestion, so it was closed and that suggestion removed for this proposal.

@DavidArno DavidArno changed the title Feature Request: allow currently mandatory, but syntactically redundant, braces to be optional Proposal: allow currently mandatory, but syntactically redundant, braces to be optional Feb 28, 2017
@iam3yal
Copy link
Contributor

iam3yal commented Feb 28, 2017

I wouldn't mind having a namespace statement which can really help reduce nesting in some cases but I think that having namespaces as part of the type is a bit too much, at least for me. :)

Overall, I like the suggestions.

@DavidArno
Copy link
Author

@eyalsk,

I personally feel that having the namespace as part of the type name offers a good way of combining the two pieces of closely related information into one. I'd be interested to know therefore, the details behind you not being keen on it. Is it a gut feeling/style thing for you, or is there practical reasons to not like it too?

@iam3yal
Copy link
Contributor

iam3yal commented Feb 28, 2017

@DavidArno

Is it a gut feeling/style thing for you

This. :)

@alrz
Copy link
Member

alrz commented Feb 28, 2017

namespace directives do not belong to this category as it's not just removing braces from the declaration. All the following types would belong to that namespace and it wouldn't be empty.

Removal of braces from classes and structs is a part of the record proposal.

So this is just about removing braces from empty interfaces and constructors which is very similar to already closed dotnet/roslyn#8985.

Also, from comments in that thread:

Really? A language proposal to save one character?

@MgSam
Copy link

MgSam commented Feb 28, 2017

While superficially somewhat similar, do these proposals really belong in a single issue? I think they are and should be separate discussions / units of work (if they ever make it that far).

@scottdorman
Copy link
Contributor

Still not a fan of the namespace declaration bits, but definitely think dotnet/roslyn#17306 has merit. Shouldn't that be pulled over as it's own proposal? By combining them, I think there's too much risk that it becomes an "all or nothing" sort of thing.

@DavidArno
Copy link
Author

I'm planning on closing this proposal as the prevailing view seems to be that these three suggestions should not be bundled into one, but should exist as separate proposals. Please speak up if you disagree, otherwise I'll close this tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants