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

Disallow Empty Bodies in Control Flow Statements? #170

Closed
Ratstail91 opened this issue Jan 5, 2025 · 1 comment
Closed

Disallow Empty Bodies in Control Flow Statements? #170

Ratstail91 opened this issue Jan 5, 2025 · 1 comment
Labels
question Further information is requested

Comments

@Ratstail91
Copy link
Owner

Have you ever been weirded out by code? https://bsky.app/profile/selbstmut.bsky.social/post/3leyqquzkns2u

This is an extention of #152

//the good
if (cond) {
    doStuff();
}

//the bad
if (cond) doStuff();

//the ugly
if (cond) /* EMPTY */;

Should I disallow empty function bodies?

Should I require bodies to be enclosed in braces?

Should I add pass as an actual keyword?

@Ratstail91 Ratstail91 added the question Further information is requested label Jan 5, 2025
@Ratstail91
Copy link
Owner Author

//these are allowed
/* EMPTY */;
if (true) { }
if (true) pass;

//these are not allowed
if (true) /* EMPTY */;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant