Skip to content

RFRFC remove hash from the Ember lexicon #473

@chancancode

Description

@chancancode

This is specifically talking about calling "map/dictionary" objects as "hash", not about "hash location" in the router.

Problems:

  • hash is probably a Ruby-ism that we inherited, which makes little sense in our JS context
    • aside: hash in ruby refers to the fact that it is implemented as a hash table, however, I believe the more common name for the abstract data type (i.e. decoupled from the implementation) is a map, dictionary or associative array..?
  • In JavaScript, it is probably more common to refer them to just as "objects" (the "o" in "POJOs")
    • a Map is also a thing in modern JavaScript, but it's not what the hash helper produces (maybe it should? probably not? unknown.)
  • A straw-man proposal is to rename the hash helper to obj or object, and (maybe later?) deprecate hash
    • We should provide a codemod
  • What should we call the second argument passed to helpers? The current signature is commonly referred to as "params and hash", and that's the name/identifier we generate for the function parameters in the blueprints. "options"? What about "params", do we want to rename that too?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions