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

Always use dash instead of underscore for commands #1501

Merged
merged 1 commit into from
Apr 30, 2020
Merged

Conversation

kraih
Copy link
Member

@kraih kraih commented Apr 29, 2020

Simple proposal. All commands now look like mojo generate lite-app instead of mojo generate lite_app. And the command list will also only show the version with dash. Both variants still work though.

$ mojo generate
Usage: APPLICATION generate GENERATOR [OPTIONS]

  mojo generate app
  mojo generate lite-app

Generators:
 app       Generate Mojolicious application directory structure
 lite-app  Generate Mojolicious::Lite application
 makefile  Generate "Makefile.PL"
 plugin    Generate Mojolicious plugin directory structure

See 'APPLICATION generate help GENERATOR' for more information on a specific
generator.

@kraih
Copy link
Member Author

kraih commented Apr 29, 2020

Calling for a vote @mojolicious/core.

@kraih kraih added the vote label Apr 29, 2020
Copy link
Member

@christopherraa christopherraa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I do not quite see the purpose of https://github.com/mojolicious/mojo/pull/1501/files#diff-3bdbac1ce4a8f86842eab030329d0633R82 I do think that defaulting to a dash is more natural than using the underscore. Bonus feature that both work.

👍

Copy link
Contributor

@Grinnz Grinnz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commandline programs much more commonly use dashes so this makes sense, as it did in #1372. This addresses the potential for confusion by printing them consistently and not doing the translation on the first character. So I vote 👍

@jberger
Copy link
Member

jberger commented Apr 29, 2020

I'm glad that both versions still work. Dashes look nice. 👍

Copy link
Member

@marcusramberg marcusramberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥳👍

@CandyAngel
Copy link
Contributor

Just for the record, I vote against.

@jhthorsen
Copy link
Member

Just for the record, I vote against.

Why do you vote against @CandyAngel?

I'm neutral. It looks better, but I'm not sure if it's worth the change. (Not opposed though)

@CandyAngel
Copy link
Contributor

My opposition is that this introduces complexity, change and risk for no/little gain.

Existing documentation (tutorials, blog posts, user documentation) now look different from what Mojolicious outputs (confusing for newbies). You can use dashes.. except for the first character (more edge cases to consider)[1]. If a problem with this is discovered and it gets reverted, that will then be a breaking change.

I would say I would prefer it if dashes worked as well (almost like a hidden feature for power users?), but that still means that what gets written in user documentation could depend on the author preference, rather than the "actual way" Mojolicious uses commands (which is neither complicated from a developer point of view, because it's just a module name, or from an end user point of view, because it's shown to you).

Normally these things are balanced out by the improvement but it doesn't seem worth it to me for a minor cosmetic change.

[1] Case in point, the PR title is wrong, because it doesn't "always use a dash instead of underscore"

@ghost
Copy link

ghost commented Apr 30, 2020

Hello. I've been lurking on the sidelines of the project for a while, as I struggle to muster the familiarity, knowledge, ability and courage to effectively contribute. So I realise I'm not qualified to weigh in on this, except to put forward the perspective of the newcomer, whose plight seems to form the bulk of the argument against the change.

I believe the use of hyphens appears more modern / standardised, and in my experience suits general taste more widely. It's adoption might not win any new followers, but its absence might deter them...

Personally, I was disappointed when I first encountered underscores, considering it an indicator of style for the project as a whole, and foreseeing the frustration of frequent typos in my future.

During the early stages of researching and thinning down alternative tools, such trivialities can count for more to the newcomer than they do for someone already convinced of the tool's merit (as with website snazz). As the number of alternatives in the marketplace increase, the filtering criteria in the early stages become increasingly superficial. For this reason, I would count this amongst those barriers to adoption that alone might not deter a new user but that in combination with others very well might.

I hope it isn't out of place for me to volunteer the above.

@kraih kraih merged commit 863f97b into master Apr 30, 2020
@kraih kraih deleted the dasherize_commands branch May 2, 2020 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants