Discussion: naming convention CE operations #338
Replies: 14 comments
-
I think the most relevant thing here is this part of the F# component design guidelines (emphasis mine):
There's no mention of custom operations in CEs here, but I'd say that things like ///`signOff` signs off the currently logged in user.
[<CustomOperation("signOff")>]
member __.SignOff(state, scheme) : HttpHandler = state >=> (signOut scheme)
///`sign_off` is deprecated and should be replaced with `signOff`.
[<CustomOperation("sign_off")>]
[<Obsolete("Use signOff instead")>]
member __.SignOffObsolete(state, scheme) : HttpHandler = __.SignOff(state, scheme) It would get tedious doing this for every custom operation in the project, but creating the But that's beside the point. The point is that although snake_case is very idiomatic in Python and, judging from the Phoenix documentation, in Elixir, it's not idiomatic in .Net. So although Saturn was very much inspired by Phoenix, I think it would be best for Saturn to follow .Net naming conventions, hence replacing everything with camelCase. |
Beta Was this translation helpful? Give feedback.
-
Am I only one who likes current naming convention? ;-) |
Beta Was this translation helpful? Give feedback.
-
Yes.
Krzysztof Cieślak <[email protected]> schrieb am Mo., 9. Juli 2018,
11:27:
… Am I only one who likes current naming convention? ;-)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#89 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADgNC3G2g3IYtVS7Rd504PV6rABztQYks5uEyIcgaJpZM4VFW1I>
.
|
Beta Was this translation helpful? Give feedback.
-
Hugs
Krzysztof Cieślak <[email protected]> schrieb am Mo., 9. Juli 2018,
14:28:
…
<https://camo.githubusercontent.com/6526c158b2d7bdd58107e81d69a2e32e5281a5ab/68747470733a2f2f6d656469612e67697068792e636f6d2f6d656469612f796f4a43324f6c7830656b4d79326e5837572f67697068792d646f776e73697a65642e676966>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#89 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AADgNHOV1blBly9mRaN9Z3N8VwXyMNB6ks5uE0xjgaJpZM4VFW1I>
.
|
Beta Was this translation helpful? Give feedback.
-
I prefer snake case, myself. |
Beta Was this translation helpful? Give feedback.
-
Can we pick one before 1.0? (obsolete names that lost, introduce proper aliases for them, done) |
Beta Was this translation helpful? Give feedback.
-
Just to make it more fun and provide a (most likely ) "no", how about: ///```sign off``` signs off the currently logged in user.
[<CustomOperation("sign off")>]
member __.SignOff(state, scheme) : HttpHandler = state >=> (signOut scheme) That would appear as: ``sign off`` |
Beta Was this translation helpful? Give feedback.
-
Have we all agreed that the sneak case is the best way? ;P |
Beta Was this translation helpful? Give feedback.
-
Well, this comment suggesting camelCase got 5 upvotes, while this comment suggesting snake_case got 1 favorite (from you), so it looks to me like a 6-to-2 vote for camelCase over snake_case. Though since you're the maintainer, you could assign your vote a score of 100 if you want... ;-) |
Beta Was this translation helpful? Give feedback.
-
It would be easy enough to extend the CE with an opt-in library like SaturnFramework.FixedCEs that adds the camelCase names. ;-) |
Beta Was this translation helpful? Give feedback.
-
I like it! This allows continuing the current snake_case naming convention, which means minimal changes to existing code, and also means @Krzysztof-Cieslak will be happy. :-) And it also allows people who prefer camelCase to have that option, in an officially-supported way. The SaturnFramework.CamelCase (or CamelCaseCEs or FixedCEs, though I admit I don't care for the FixedCEs name as it's not evident from the name how they're "fixed") library would have to be part of the official Saturn framework release rather than being a third-party library, otherwise there's too much danger of code drift. |
Beta Was this translation helpful? Give feedback.
-
@rmunn The "FixedCEs" name was merely a joke. 😉 |
Beta Was this translation helpful? Give feedback.
-
Farmer is also using a lot of snake_case naming in CE. |
Beta Was this translation helpful? Give feedback.
-
Currently we use snake_case for the CEs but camelCase is the normal F# convention, I'm all for it and we didn't hit 1.0 yet so ¯_(ツ)_/¯
Also it's already inconsistent looking at the subController op.
/cc: @isaacabraham @rmunn
Beta Was this translation helpful? Give feedback.
All reactions