Comments (21)
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.
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.
Okay, let's do this! π
Slating for 0.4. In all likelihood, we'll make this happen by 0.3.
from rocket.
@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.
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.
I agree with LLBlumire. Stick to the Rust guidelines for the sake of consistency in the Rust ecosystem.
from rocket.
This is shipping in 0.3! Resolved in 8973137, 65886c8, and 70bc97c.
from rocket.
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.
Same goes for APIKey
-> ApiKey
(non-breaking, because it's just documentation-level).
from rocket.
I prefer upper-case names but understand why it would bother someone wanting to contribute.
from rocket.
@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.
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.
I second @kerberosmansour's kudos and @LLBlumire's recommendation. Consistency goes a long way (especially for new folks).
from rocket.
Quite a few people have expressed support for following the RFC guideline. Is more feedback needed?
from rocket.
I agree, Json
and ApiKey
.
from rocket.
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.
whoot
from rocket.
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.
@ZelphirKaltstahl my reasons, other than following idiom:
- looks better
- more pleasant to type
from rocket.
@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.
@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)
- Supply PanicInfo to Catchers where applicable HOT 2
- (Solved) Rocket database fairing panicking while connecting to dockerized postgres on MacOS Sonoma HOT 1
- how to return error as a Json from FromParam HOT 3
- Responder enums not serializing like expected HOT 1
- FileServer can serve pre-gzipped content if it exists on the filesystem HOT 1
- Cookies aren't read by get methods but it exists in the browser HOT 2
- HTTP3/QUIC support HOT 15
- Add HTMLStream HOT 5
- cookie removal and Microsoft Edge HOT 7
- Inject script to auto-reload browser when Rocket restarts
- Rocket App Hangs HOT 5
- DefaultListener::bindable() isnβt usable HOT 8
- Allow routes that match any method HOT 4
- Hyper and Rocket disagreeing on validity of URL HOT 3
- Allow from form macro to work on structs with range HOT 4
- Clippy Lint w/ FromForm derive HOT 7
- Possible Incompleteness HOT 1
- Possible Incompleteness HOT 1
- doc: change `&ContentType` with `&Accept` in the list of implementations of `FromRequest` HOT 1
- [Feature]: Enhanced State Mutation for Effortless Handling of Shared Resources HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rocket.