#163 ✓invalid
Douwe M.

Rename Element#subNodes to Element#children? and more

Reported by Douwe M. | January 7th, 2010 @ 06:56 PM

Maybe you could rename Element#subNodes to Element#children, so the name is more a more along the line of Element#siblings and Element#parent.
I'm not sure if this is even possible, as there is already a property called children...

(And maybe the Element#parents method could be renamed (or alias-ed) Element#ancestors, as I think this is a more descriptive term...) (Element#descendants would be nice too, as an alias to Element#select)

Comments and changes to this ticket

  • Douwe M.

    Douwe M. January 7th, 2010 @ 07:07 PM

    • Title changed from “Rename Element#subNodes to Element#children?” to “Rename Element#subNodes to Element#children? and more”
  • MadRabbit

    MadRabbit January 8th, 2010 @ 01:20 PM

    • State changed from “new” to “invalid”
    • Tag changed from aliases, element#children, element#subnodes, idea, renaming to element#children, element#subnodes, idea
    1. No aliases on RightJS, although I've already have couple of them. Aliases are evil, and one of the first rules on RightJS is a simple, clean API. No aliases. Only over my dead body. 8)

    2. 'children' is a conflicting name

    3. 'parents' is more natural, coz .parentNode and it's shorter and less miss-printable than 'ancestors', same for 'descendants' and 'select'.

  • Douwe M.
  • MadRabbit

    MadRabbit January 8th, 2010 @ 08:23 PM

    It's not all that bad. I'm just want to keep a clear single interface in the core so didn't get people in troubles like, someone reassigned one alias, but the other was pointing to an old method. Those things tend to get really messy over the time.

    If you like the Prototype names, you can just write a plugin that will contain the aliases, similarly how I did for right-rails implementing Ruby style interface.

  • Douwe M.

    Douwe M. January 8th, 2010 @ 08:27 PM

    Yeah, I understand ;-)

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

RightJS Core Tickets

Shared Ticket Bins

People watching this ticket

Pages