Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Proposal]: Emojis in internal/private Variable, member, and method names. #4402

Closed
1 of 4 tasks
AraHaan opened this issue Feb 8, 2021 · 2 comments
Closed
1 of 4 tasks

Comments

@AraHaan
Copy link
Member

AraHaan commented Feb 8, 2021

Unicode based Emojis in variable and method names.

  • Proposed
  • Prototype: Not Started
  • Implementation: Not Started
  • Specification: Not Started

Summary

People long for a feature in programming: the use of unicode based characters, like emojis since they are always custom and unique. Example emojis include the sob emoji and others. I would like all of the emojis currently supported by unicode (which was then become part of some emoji version stuff).

Motivation

Well users currently get to choose their variable or method names, however there are limitations to this, for starters c# code files use UTF-8 BOM by default which supports using emojis in the files, yet the language would not compile the code if emojis was used for variable names, method names, etc of private or internal symbols (as long as they use english based method names for their public api).

This would allow programmers to not only write working and great code, but also have fun too by being able to use emojis for local variables, in using blocks or statements, etc that does not get exposed to public api.

The expected outcome is code like below:
image
Except that it would be able to compile.

Detailed design

public class Example
{
    // example internal method with emojis.
    internal void EmojiTime😂😂😂😂()
    {
        // example local variable with emojis.
        var 😂😂😂 = string.Empty;
        // use it later.
    }

    // example private method using emojis.
    private void AnotherEmoji😂😂😂😂😂()
    {
        // example using block using emojis.
        using (var 😂😂😂😂 = new MemoryStream()
        {
            // do stuff to the stream.
        }

        // example using statement using emojis.
        using var 😂😂😂 = new MemoryStream();
        // do stuff to the stream.
    }

    // example internal property using emojis.
    internal byte[] 😂😂😂😂😂😂 { get; set; }

    // example private property using emojis.
    private byte[] 😂😂 { get; set; }

    // anything else that can make internal or private variables or members of any
    // type using emojis that I have not thought of above.
}

The entire variable spec, class spec (people would probably want to use emojis for class names too on internal/private only classes), enum spec (for internal or private enumeration members), struct spec (for internal/private structures) for variables(or class/enum/struct members) as this very well could apply to the whole thing. However I would like emojis only usable on non-public members (internal or private) to avoid issues with users who cannot type emojis.

Drawbacks

I do not see any drawbacks with allowing usage of emojis in variable, member, or method names as long as they are not allowed to be an public member name for fear of someone unable to type the emojis from having issues.

Alternatives

I have not considered any other ones that would allow using emojis for variable names, member, or method names.

I think the impact of not doing this is limited to the people who want to use emojis for variable, member, and method names of internal symbols.

Unresolved questions

None so far, this is a new proposal.

Design meetings

None so far, this is a new proposal.

@AraHaan AraHaan changed the title [Proposal]: Emojis in Variable and method names. [Proposal]: Emojis in Variable, member, and method names. Feb 8, 2021
@AraHaan AraHaan changed the title [Proposal]: Emojis in Variable, member, and method names. [Proposal]: Emojis in internal/private Variable, member, and method names. Feb 8, 2021
@AraHaan
Copy link
Member Author

AraHaan commented Feb 8, 2021

cc @CyrusNajmabadi

@333fred
Copy link
Member

333fred commented Feb 8, 2021

Duplicate of #3490.

@333fred 333fred closed this as completed Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants