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

Add alias 'nonstandard_style' for 'bad_style' #41646

Closed
Manishearth opened this Issue Apr 30, 2017 · 82 comments

Comments

Projects
None yet
@Manishearth
Copy link
Member

Manishearth commented Apr 30, 2017

@ashleygwilliams mentioned this in her talk today; #[allow(bad_style)] is a rather rebuke-y shame-y annotation on code.

While we do want people to use proper style, it's a useful tool whilst learning to be able to turn off all the extra friction that you deal with that you don't have to. Let's be nicer about it; could we rename this to nonstandard_style and keep bad_style as a backcompat alias?

Unsure if this requires an RFC.

@Manishearth Manishearth added the A-lint label Apr 30, 2017

@Manishearth

This comment has been minimized.

Copy link
Member Author

Manishearth commented Apr 30, 2017

(Actual name of alias very bikesheddable, I just picked the first thing that came to mind.)

@skade

This comment has been minimized.

Copy link
Contributor

skade commented Apr 30, 2017

Bikeshed: "relaxed_style" sounds good.

@leonardo-m

This comment has been minimized.

Copy link

leonardo-m commented Apr 30, 2017

"bad_style" sounds better than "nonstandard_style" because "nonstandard" sounds un-opinionated. The point of a "bad_style" annotation is to help people feel guilty.

@Manishearth

This comment has been minimized.

Copy link
Member Author

Manishearth commented Apr 30, 2017

Right, I'm questioning if that's a good thing. Do we need to? Even nonstandard_style (or in general, any warning-allow) does make you feel guilty, bad_style is just very much like a shaming and feels bad.

@mgattozzi

This comment has been minimized.

Copy link
Member

mgattozzi commented Apr 30, 2017

Her talk was great. I think using something like relaxed_style or permissive_style would be a better choice then bad_style

@tumdum

This comment has been minimized.

Copy link

tumdum commented Apr 30, 2017

I think that 'any_style' is short and is not passive aggressive at all :)

@steveklabnik

This comment has been minimized.

Copy link
Member

steveklabnik commented Apr 30, 2017

marking as both @rust-lang/compiler and @rust-lang/lang ; not sure who this falls under, really. Also nominating for discussion; I'm not sure if this requires an RFC or not.

@retep998

This comment has been minimized.

Copy link
Member

retep998 commented Apr 30, 2017

As one of the heaviest users of bad_style (https://github.com/retep998/winapi-rs/blob/dev/src/lib.rs#L9), I'd like to voice my lack of opinion on this matter.

@ashleygwilliams

This comment has been minimized.

Copy link
Member

ashleygwilliams commented Apr 30, 2017

i have no opinion on what we alias it as, but i would be very interested in an alias that is less shame-y. i am also very happy to implement once we decide what a good alias is!

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented May 2, 2017

For those readers who (like me) were not familiar with the bad_style group, it refers to a collection of 3 lints that enforce various capitalization conventions (e.g., snake_case methods, SHOUTY_GLOBALS, etc).

I'm in favor of renaming. I like any_style because it's short and easy to spell, but #[deny(any_style)] doesn't make any sense to me. =)

Regarding whether this ought to have an RFC -- I could go either way; if we opt for no RFC, then we ought to at least do a "mini-FCP" here in the issue. TBH I'm not sure what team has ownership of lints though. =) I guess @rust-lang/lang?

@aturon

This comment has been minimized.

Copy link
Member

aturon commented May 3, 2017

I definitely don't feel this needs an RFC. I also wholeheartedly agree that we should change the name.

nonstandard_style or alternative_style seem good to me.

@whitequark

This comment has been minimized.

Copy link
Member

whitequark commented May 3, 2017

alternative_style seem good to me

Do we really want the "alternative facts" connotation? I can already see someone writing that awful snark and the HN frontpage it'll hit and I'd really rather not have it.

@aturon

This comment has been minimized.

Copy link
Member

aturon commented May 3, 2017

@whitequark

Heh, I hadn't realized that the term "alternative" had gotten quite so poisoned! Anyway my preferences here aren't very strong.

@withoutboats

This comment has been minimized.

Copy link
Contributor

withoutboats commented May 3, 2017

I'm happy with any non-judgmental name, we can FCP the PR (I also don't care if we don't)

@whitequark

This comment has been minimized.

Copy link
Member

whitequark commented May 3, 2017

FWIW I like the any_style suggestion as it makes no statement about the particular style in question. I am not worried at all about this change leading to more deviation from conventions because:

  • humans are very good on exerting conformance pressure on their own, no need for the compiler assist;
  • the fact that warnings are emitted by default already make anyone new to Rust stop and think;
  • most Rust code is already uniform to a degree that I have not seen elsewhere, and there's no clear reason why that would suddenly change;
  • rustfmt isn't going to be very configurable, further fossilizing the conventional style.

If something I'm worried there's too much friction for even minor deviations; I don't think I'll ever use rustfmt, for example.

@joshtriplett

This comment has been minimized.

Copy link
Member

joshtriplett commented May 3, 2017

Given that this comes up often in code translators (such as corrode), and potentially in binding generators as well, then having a more neutral alias for this seems appropriate. I also don't think adding an alias needs an RFC.

I'm not going to add to the bikeshedding on the name itself. 🚳

@jseyfried

This comment has been minimized.

Copy link
Contributor

jseyfried commented May 3, 2017

any_style seems too broad -- it includes the standard style, so #![deny(any_style)] is weird.

I prefer nonstandard_style -- I think it's clearer than alternative_style since the latter could sound like we have an alternative in mind and isn't clear about to which it is alternative.

@est31

This comment has been minimized.

Copy link
Contributor

est31 commented May 3, 2017

As someone who has been annoyed by some C++ codebases that despite having official casing rules use different casing styles in parallel (including libraries using different casing styles), I am glad of those checks to be in the compiler and default on, because they create consistency. I believe this wish of consistency in this issue to be universal, so this isn't just a style issue where everyone can have its own, as your choice of casing gets forced upon the users of your library as well. I use tabs in my codebase and am writing let v :Type = try!(foo()) instead of let v: Type = foo()? so I'm not "mainstream" regarding style, but those choices don't escape my codebase so I'm comfortable doing them.

This check has many positive side effects. Like when reading code, you get accustomed to differentiate things inside lists of use clauses by their cases.

Looking at the issue from the other perspective, renaming the lint to nonstandard_style makes you feel intolerant when you type #![forbid(nonstandard_style)]. So one group gets always shamed.

Also, for beginners its important to see that the style they are doing is not fine, but rather something that is bad for the community of crates, especially their users, due to the inconsistency to the other crates on crates.io.

Overall though I don't feel very strongly about a rename, as long as the lint stays a warning by default.

@Manishearth

This comment has been minimized.

Copy link
Member Author

Manishearth commented May 3, 2017

renaming the lint to nonstandard_style makes you feel intolerant when you type #![forbid(nonstandard_style)]. So one group gets always shamed.

No more than #![forbid(bad_style)].

Beginners already see that the style is not great. This is just about making it possible to design your own beginner experience without feeling bad about it. This doesn't change the warning's existence, it just changes the name so that it isn't discouraging when disabled.

@est31

This comment has been minimized.

Copy link
Contributor

est31 commented May 22, 2017

One example for how the snake case style helps you to identify a bug: https://is.gd/XArdpj

You need to look twice to see that the last case in the match is creating a new variable instead of being an actual enum variant.

@skade

This comment has been minimized.

Copy link
Contributor

skade commented May 23, 2017

@est31 I find this example rather contrived (it switches off multiple layers of safety and imports the matching shorthand).

Sure, "nonstandard_style" brings you half-way there, but the option is in the compiler and supported, this discussion is about an alias only.

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented May 24, 2017

@rfcbot fcp merge

I agree we don't need an RFC. I'm moving that we agree to change the name to nonstandard_style (and deprecate -- but naturally not remove! -- the old name bad_style).

@est31

This comment has been minimized.

Copy link
Contributor

est31 commented May 24, 2017

contrived

Its not a contrived example: I have encountered it in one of my programs. Luckily I had the bad_style lint turned on, so I didn't actually encounter the bug itself.

Sure, "nonstandard_style" brings you half-way there, but the option is in the compiler and supported, this discussion is about an alias only.

No, its about deprecation as well, and probably a Rust 2.0 or something will remove the name.

@Manishearth

This comment has been minimized.

Copy link
Member Author

Manishearth commented May 24, 2017

Most lints prevent bugs. That isn't an argument for giving it a name like that.

its about deprecation as well

deprecating the name, not the lint.

@BurntSushi

This comment has been minimized.

Copy link
Member

BurntSushi commented Aug 28, 2017

Moderator note: I've removed a couple comments that violate our CoC, and am temporarily locking this issue to prevent further trolling. We can re-open this in 24 hours.

@Manishearth

This comment has been minimized.

Copy link
Member Author

Manishearth commented Aug 29, 2018

This was fixed in #48386

(looks like we forgot to unlock)

@rust-lang rust-lang unlocked this conversation Aug 29, 2018

@carols10cents

This comment has been minimized.

Copy link
Member

carols10cents commented Aug 29, 2018

@Manishearth #48386 has a comment from you saying that it doesn't fix this issue completely, reopening because I don't see any other linked PRs

@carols10cents carols10cents reopened this Aug 29, 2018

@Manishearth

This comment has been minimized.

Copy link
Member Author

Manishearth commented Aug 29, 2018

pietroalbini pushed a commit to pietroalbini/rust that referenced this issue Aug 29, 2018

Replace usages of 'bad_style' with 'nonstandard_style'.
`bad_style` is being deprecated in favor of `nonstandard_style`:

- rust-lang#41646

pietroalbini added a commit to pietroalbini/rust that referenced this issue Aug 29, 2018

Rollup merge of rust-lang#53786 - frewsxcv:frewsxcv-bad-style, r=Mani…
…shearth

Replace usages of 'bad_style' with 'nonstandard_style'.

`bad_style` is being deprecated in favor of `nonstandard_style`:

- rust-lang#41646

pietroalbini added a commit to pietroalbini/rust that referenced this issue Aug 29, 2018

Rollup merge of rust-lang#53786 - frewsxcv:frewsxcv-bad-style, r=Mani…
…shearth

Replace usages of 'bad_style' with 'nonstandard_style'.

`bad_style` is being deprecated in favor of `nonstandard_style`:

- rust-lang#41646

pietroalbini added a commit to pietroalbini/rust that referenced this issue Aug 30, 2018

Rollup merge of rust-lang#53786 - frewsxcv:frewsxcv-bad-style, r=Mani…
…shearth

Replace usages of 'bad_style' with 'nonstandard_style'.

`bad_style` is being deprecated in favor of `nonstandard_style`:

- rust-lang#41646
@WiSaGaN

This comment was marked as off-topic.

Copy link
Contributor

WiSaGaN commented Sep 8, 2018

Moderator note: I've removed a couple comments that violate our CoC, and am temporarily locking this issue to prevent further trolling. We can re-open this in 24 hours.

While I agree with this naming change, I don't agree with moderator implying people are "trolling" when they voice their disagreement.

In Wikipedia, Troll is defined as

In Internet slang, a troll is a person who starts quarrels or upsets people on the Internet to distract and sow discord by posting inflammatory and digressive, extraneous, or off-topic messages in an online community (such as a newsgroup, forum, chat room, or blog) with the intent of provoking readers into displaying emotional responses and normalizing tangential discussion, whether for the troll's amusement or a specific gain.

The disagreement in this thread may be unpleasant, or sometimes even inflammatory, but we need to have some concrete evidence to prove the intent of those messages are "provoking readers into displaying emotional responses and normalizing tangential discussion" before labeling them as "trolling", even more so when it's coming from moderators. This is especially important when we strive to achieve an inclusive community that welcomes diversity. True diversity is not about people with different colors of skin or gender with the same level of preferrance for how we should approach social progression, it should be about really including everyone who wants to make Rust better. This includes people who comes from a different culture and may not know different nuances in western / English expression, people who are not good at English to express their opinions as eloquantly as others, people who may not be able to express their frustration in a calm, articulating, and constructive way. Removing some of the remarks is sometimes necessary for a better community, but this should not be done assuming the intent of those participants, and we should not lable them as "trolls", "shills", "bots" or other things just because they may have a different opinion that is expressed in an undesirable way.

@retep998

This comment was marked as off-topic.

Copy link
Member

retep998 commented Sep 8, 2018

Good thing Github now allows people to hide comments rather than deleting them, so going forward we'll be able to benefit from the increased transparency and when actual troll posts are hidden people won't think the moderator team was incorrect in that decision.

@mbrubeck

This comment has been minimized.

Copy link
Contributor

mbrubeck commented Sep 8, 2018

Please direct comments about moderation to the moderators or to new forum threads.

bors added a commit that referenced this issue Oct 16, 2018

Auto merge of #54251 - varkor:silence-bad_style, r=Manishearth
Make `bad_style` a silent alias for `nonstandard_style`

Now only `nonstandard_style` is suggested in `rustc -W help`, but `bad_style` will not produce a warning. Closes #41646.

r? @Manishearth

@bors bors closed this in #54251 Oct 16, 2018

djrenren pushed a commit to djrenren/libtest that referenced this issue Jan 22, 2019

Replace usages of 'bad_style' with 'nonstandard_style'.
`bad_style` is being deprecated in favor of `nonstandard_style`:

- rust-lang/rust#41646
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.