node-rss icon indicating copy to clipboard operation
node-rss copied to clipboard

camel casing

Open cole-gillespie opened this issue 10 years ago • 12 comments

some have _ some are camel. some of the main attributes are camel case, some are not. can we switch all to camel for cleanliness and sanity?

lib/posts.js
  251:4   error  Identifier 'feed_url' is not in camel case  camelcase
  252:4   error  Identifier 'site_url' is not in camel case  camelcase

cole-gillespie avatar Jan 09 '15 17:01 cole-gillespie

Great idea. This will be a major api breaking change unless we support both. How do current users feel about this change?

dylang avatar Jan 09 '15 18:01 dylang

just added code that i think will support both @dylang

cole-gillespie avatar Jan 09 '15 18:01 cole-gillespie

passing tests locally. i think this should work. maybe should make some new tests just to make sure.

cole-gillespie avatar Jan 09 '15 18:01 cole-gillespie

How do current users feel about this change?

As one of the current users, the change feels fine as long as the major version is incremented.

The change should also be mentioned in the readme in some subsection called “Upgrading” or “Changelog” or “Breaking changes in 2.0.0” or in a similar fashion.

Mithgol avatar Jan 10 '15 20:01 Mithgol

Any news on V2? Just starting with this module and the case mixing's a bit confusing.

mikemaccana avatar Dec 31 '15 23:12 mikemaccana

I have taken over maintenance of this module, and haven't yet sat down to look at it properly.

The current proposal is to add support for both snake case and camel case, I'd personally be in favour of picking ~~snake~~ camel case only. I'd also be interested to see if there's any names which can be moved closer to the RSS/atom spec, to make the API more easily 'guessable', and doing these as breaking changes for 2.0.0.

Any thoughts on this idea?

ErisDS avatar Jan 04 '16 13:01 ErisDS

Well it's node, JavaScript itself nearly always uses camelCase, and every JavaScript style guide uses camelCase.  Also : HI HANNAH 😃

On Mon, Jan 4, 2016 at 5:34 AM -0800, "Hannah Wolfe" [email protected] wrote:

I have taken over maintenance of this module, and haven't yet sat down to look at it properly.

The current proposal is to add support for both snake case and camel case, I'd personally be in favour of picking snake case only. I'd also be interested to see if there's any names which can be moved closer to the RSS/atom spec, to make the API more easily 'guessable', and doing these as breaking changes for 2.0.0.

Any thoughts on this idea?

— Reply to this email directly or view it on GitHub.

mikemaccana avatar Jan 04 '16 14:01 mikemaccana

BACK AT YOU MIKE :grin:

That's basically what I'm thinking - supporting both is just prolonging agony. Can always do a 1.x version with deprecation warnings if it seems necessary, but I'd rather support one clear, sensible format than multiple formats when the lack of backwards compatibility can be managed with a major version bump and good docs.

ErisDS avatar Jan 04 '16 14:01 ErisDS

Slightly confused - you wrote " I'd personally be in favour of picking snake case only" but also "That's basically what I'm thinking" re: using camelCase since it's consistent with JS. 🤔

mikemaccana avatar Jan 08 '16 02:01 mikemaccana

I'm not surprised you're confused! Sorry, that was a total brain fart... I meant camel case. Updated my comment.

ErisDS avatar Jan 08 '16 11:01 ErisDS

I'm fine with camelCase as long as the breaking change causes an increment of the major version (see https://github.com/dylang/node-rss/issues/40#issuecomment-69469722 above).

An increment of the major version also means that you may break a few other things along the way (for example, you might consider rewriting the whole thing in ECMAScript 6 with arrow functions).

Mithgol avatar Feb 27 '16 19:02 Mithgol

Hey guys, stumbled upon this conversation and agree using a consistent naming convention would be amazing!

@dylang @ErisDS Who is generously maintaining this package finally?

sunknudsen avatar Jan 22 '21 14:01 sunknudsen