Skip to content

please unreserve underscore, and allow it for user usage #5879

@xlotlu

Description

@xlotlu

Version

2.3.4


I have been a developer for many years, and I, as many others, have been using underscore-starting variables and functions to convey special meaning: this is somehow restricted / it's temporary / it's for internal use / it's the real implementation and the other one is a wrapper etc.

Taking away this ability is unnecessary, it is handicapping developers, and opens the door for bugs. I was bitten by Vue's handling of _ properties a long time ago and had to do the same googling many others have done before me. But what prompted me to submit this issue is I just created a _render method: given that I was renaming a method that was already used in a few places, combine this with some other edits before and after the rename, the outcome was, as you can imagine, a long and frustrating session of debugging.

I propose underscore should be cleared for regular usage by users. This could be really simple, like renaming the internal stuff to start with $_ instead, or namespacing everything under something like this.$ (but I presume that would require some serious code shuffling).

Metadata

Metadata

Assignees

No one assigned

    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