Coder Social home page Coder Social logo

Comments (2)

moribvndvs avatar moribvndvs commented on July 19, 2024

Yeah, I'm aware of that Docs entry and I feel ambivalent about it 😑. When I was designing this, I had a long discussion with myself on what I should name everything and how to handle this issue. The primary goal is for this module to be elegant, simple, and concise. Coming up with some annoying vendor prefix (Hacked? hbc?) is annoying, and adding a module name prefix is double annoying on top of being redundant. I suppose I could just drop the $ on everything and capitalize, but Pascal case in JavaScript seems so lame, so mid 2000s Microsoft, don't you think?

Granted, my gripes are based on stylistic imperatives rather than functional ones. I did a limited and unofficial survey of popular modules back then to see if folks decided to buck the rules or play by them, and most, it seemed, to just do what I did. If you can't beat 'em, join 'em. And then blame everyone else when it blows up in your face because of a collision, right?

Anyways, the advice in the docs is sound, I just disliked implementing their recommendation. I guess I figured I'd let it be a problem when it became a problem, but perhaps I'm being a bit reckless. If we do it, we should do it soon and with a suite of other breaking changes (the upcoming 1.0 release has those).

To get the ball rolling, the proposed changes would be:

$idle -> Idle
$idleProvider -> IdleProvider
$keepalive -> Keepalive
$keepaliveProvider -> KeepaliveProvider
$keepaliveResponse -> KeepaliveResponse
$idleStart -> IdleStart
$idleEnd -> IdleEnd
$idleWarn -> IdleWarn
$idleTimeout -> IdleTimeout
ngIdleCountdown -> IdleCountdown

from ng-idle.

altryne avatar altryne commented on July 19, 2024

Thanx for the in-depth reasoning Mike.
I totally agree with "if you can't win them, join them"
But lately more and more ng modules I see just use the Capital notation like you proposed in the changes, and I have to say, it looks just a little bit cleaner for me.

I agree that prefixing all of this with a vendor prefix of sorts will be messy, also maybe not super needed as you don't expose anything to the UI.
so my vote is on your suggestion!
👍

from ng-idle.

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.