Code Monkey home page Code Monkey logo

Comments (21)

LLBlumire avatar LLBlumire commented on May 3, 2024 59

I'll chime in and say Rocket should conform to what of the rust style guide is defined. So, Json and ApiKey. This is more intuitive for library users as it's what people are (or should be) used to for rust.

Same goes for code layout, a cargo fmt goes a long way towards readability (except when it doesn't and screw up royally)

Oh, and the constants that are status codes should be SCREAMING_SNAKE_CASE: ImATeapot -> IM_A_TEAPOT

from rocket.

mgattozzi avatar mgattozzi commented on May 3, 2024 28

Especially since this is just such a slick framework. It really had potential and I think if people want to use it then making it more idiomatic will be beneficial

from rocket.

SergioBenitez avatar SergioBenitez commented on May 3, 2024 26

Okay, let's do this! πŸš€

Slating for 0.4. In all likelihood, we'll make this happen by 0.3.

from rocket.

kerberosmansour avatar kerberosmansour commented on May 3, 2024 6

@SergioBenitez bravo on building this framework in rust, and looking forward to getting Rocket on to Rust asynchronous I/O libraries once they stabilize.

from rocket.

SergioBenitez avatar SergioBenitez commented on May 3, 2024 4

Indeed, this is by design. There are several other names that don't conform, but I prefer to keep upper-case names for acronyms. If enough people disagree, happy to change it.

from rocket.

ghazkarim avatar ghazkarim commented on May 3, 2024 4

I agree with LLBlumire. Stick to the Rust guidelines for the sake of consistency in the Rust ecosystem.

from rocket.

SergioBenitez avatar SergioBenitez commented on May 3, 2024 3

This is shipping in 0.3! Resolved in 8973137, 65886c8, and 70bc97c.

from rocket.

steveklabnik avatar steveklabnik commented on May 3, 2024 2

It's also easier to convert simply between the two styles this way; that is, you can easily convert

JsonApi => json_api

but this means

JSONAPI => j_s_o_n_a_p_i

and

JSONEncoder => j_s_o_n_encoder

We don't use reflection a ton in Rust, but this is why Ruby uses this scheme.

from rocket.

SkylerLipthay avatar SkylerLipthay commented on May 3, 2024 1

Same goes for APIKey -> ApiKey (non-breaking, because it's just documentation-level).

from rocket.

ereichert avatar ereichert commented on May 3, 2024 1

I prefer upper-case names but understand why it would bother someone wanting to contribute.

from rocket.

inta avatar inta commented on May 3, 2024 1

@ZelphirKaltstahl it is easier to recognize word boundaries. If you end with something like JSONAPIKey that is definitely harder to read than JsonApiKey.

from rocket.

JeremySorensen avatar JeremySorensen commented on May 3, 2024 1

This was the Rust version of a flame war. That's why this community is so great!
@SergioBenitez Thanks for taking the feedback so graciously. Rocket is in good hands.

from rocket.

reillysiemens avatar reillysiemens commented on May 3, 2024

I second @kerberosmansour's kudos and @LLBlumire's recommendation. Consistency goes a long way (especially for new folks).

from rocket.

cbruun avatar cbruun commented on May 3, 2024

Quite a few people have expressed support for following the RFC guideline. Is more feedback needed?

from rocket.

impowski avatar impowski commented on May 3, 2024

I agree, Json and ApiKey.

from rocket.

tshepang avatar tshepang commented on May 3, 2024

It will be more hard to change the names as more people use the project. I imagine there are more pressing things, but this doesn't seem like something that'll take much effort.

from rocket.

drusellers avatar drusellers commented on May 3, 2024

whoot

from rocket.

ZelphirKaltstahl avatar ZelphirKaltstahl commented on May 3, 2024

I never understood why anyone would want to lower case an abbreviation or acronym. Makes no sense to me and I always keep them upper case. Well, I am late to the party anyway : )

from rocket.

tshepang avatar tshepang commented on May 3, 2024

@ZelphirKaltstahl my reasons, other than following idiom:

  • looks better
  • more pleasant to type

from rocket.

ZelphirKaltstahl avatar ZelphirKaltstahl commented on May 3, 2024

@inta Hmm, that's actually the first valid point I see for this. I am not sure this overrules the "correct" spelling of abbreviations or acronyms, but it is a valid point. Now I at least know one good reason why someone would do that.

Looking better? Meh that's subjective.
Pleasant to type? I am already pressing the shift key for the first character, so it does not really matter.

from rocket.

inta avatar inta commented on May 3, 2024

@ZelphirKaltstahl camel case is not about correct spelling at all, you start every word with a capital letter, even those you would usually write all lowercase.

@steveklabnik I have not thought about conversion, that's really the best reason for me.

from rocket.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.