VolmitSoftware / React

Smart Server Performance
https://volmit.com
GNU General Public License v3.0
95 stars 52 forks source link

RenameSuggestion #623

Closed AnonymousAccount4SE closed 1 year ago

AnonymousAccount4SE commented 1 year ago

Renaming Suggestion of Method Names to Make Them More Descriptive


Description

We have developed a tool (NameSpotter) for identifying non-descriptive method names, and using this tool we find a non-descriptive method name in your repository:

/* Non-descriptive Method Name in React/src/main/java/com/volmit/react/util/scheduling/J.java */
    public static void ass(Runnable r) {
        if (started) {
            s(r);
        } else {
            afterStartup.add(r);
        }
    }
    public static void asa(Runnable r) {
        if (started) {
            a(r);
        } else {
            afterStartupAsync.add(r);
        }
    }

We consider "ass" and "asa" as non-descriptive because they only contain some letters and are not commonly used abbreviations. We propose to rename "ass" to "scheduleSyncTaskAfterStartup", "asa" to "scheduleAsyncTaskAfterStartup" according to the functionality of the methods and their corresponding comments.

Do you agree with the judgment?

NextdoorPsycho commented 1 year ago

I have to disagree with this suggestion, mainly based on my long experience in the field. I fully recognize that it may not look great, but I've lost faith in the community's code-naming conventions. My trust began to wane when MD5 deprecated the async runnable method just because of a single report of confusion between "a sync" and "async." This seemed odd, especially since there was a "sync" method right next to it.

As a result, terms like "ass" and "asa" have become standard for us, representing "After-Start async" and "sync," etc. Since I'm likely the only person who will be working on this, and considering our reputation for code resembling Mojank-Microsoft's NMS code (e.g., A.a.1.b()), I'm not inclined to merge this. However, if this truly becomes an issue, I'm more than willing to add annotations so you can simply hover over the terms to understand them. I believe this approach could be a happy-medium.

Let me know!

NextdoorPsycho commented 1 year ago

ill reopen if you respond!