Skip to content

Consistent function naming: let's go with underscores #793

@LeaVerou

Description

@LeaVerou

Currently we have very few MS functions with 2 word names (thanks @DmitrySharabin for hunting them down):

  • groupby()
  • tolast()
  • fromlast()

Given that Mavo is generally case insensitive, I don't think concatenating names makes for very readable code. Instead, we should use underscores to separate words, which is guaranteed to be readable with any casing.

A solid plan for this would be:

  • Any new multi-word functions use underscores (e.g. readable_datetime())
  • We rename the three functions above to group_by(), to_last(), from_last()

We add the current names as aliases, which call Mavo.warn() to print out something like:

groupby() is deprecated and will be removed in the next version of Mavo. Please use group_by() instead.

and then call the new function name.

We need to also make sure we're not calling the old names in any of our own code or plugins.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Effort: lowEasy to address issues, ideal for first time contributors!breaking change

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions