Add deprecated method names for Async methods without async in them

Async is annoying, and it over complicates method names. GetNameFromUserIdAsync? Seriously? That’s 22 characters. For the 100% people in existence who use these async methods knowing what they are (how can you even use a method without knowing what it is?), adding aliases for these async that don’t include async and deprecating them as soon as they’re created (to make a statement that the naming convention isn’t the best) would be amazing and would result in cleaner code (that’s also easier to type).

1 Like

the Async convention is also inconsistent, adding to confusion and increasing development time to consult the wiki.

I agree it is inconsistent and that is bad, but verbose names increase readability and I like that. Not sure if I really want it that badly, though. 22 characters does seem like a lot.

“but verbose names increase readability”

Yep – GetNameFromUserId is certainly preferable over GetUsername(userId), but make it too long like GetNameFromUserIdAsync and your code is filled with fluff to the point where it’s difficult to read.

I don’t think this is the greatest name for this function either. There are a lot of naming convention violations apart from this though.

After all, it’s not game.InsertService:LoadAsset[b]FromId/b, but game.InsertService:LoadAsset(id).

Why not game:GetUsernameAsync(id) instead of game:GetNameFromUserIdAsync(id)? That is if we don’t consider the Async problem right now.

EDIT: Echo’s comment below

Username is one word – GetUsername instead of GetUserName pls. It’d drive me mad otherwise.

:GetAllPreviousUsernamesFromIdAsync(id)

I just had a chat with Conor. We’re submitting that the new name be
GetPlayerUsernameFromPlayerUserIdAsyncYielding(userId)
Already have a thumbs up from our supervisor

that means the same thing11!1

[quote] I just had a chat with Conor. We’re submitting that the new name be
GetPlayerUsernameFromPlayerUserIdAsyncYielding(userId)
Already have a thumbs up from our supervisor [/quote]

UserId = User Identifier (or could be that all places with Player and User were replaced with Account to add even more to it)
Adding to the “Previous”, this would be one hell of a method.

I agree it is confusing. We should probably add a “-Sync” suffix to all the other methods without the “-Async” suffix.

Just so we’re clear.

It’s only called Async because internally it’s asynchronous, yet the behaviour on our side (where the API is exposed and should reflect) is synchronous and therefore shouldn’t have the Async prefix. :X

You’d think because it’s the lua-side of the API, it would better reflect the Lua side. Telling us it’s asynchronous on the C-side isn’t any help (why do we need to know that?), and is just confusing with the synchronous behaviour on the lua side.

1 Like

[quote] It’s only called Async because internally it’s asynchronous, yet the behaviour on our side (where the API is exposed and should reflect) is synchronous and therefore shouldn’t have the Async prefix. :X

You’d think because it’s the lua-side of the API, it would better reflect the Lua side. Telling us it’s asynchronous on the C-side isn’t any help (why do we need to know that?), and is just confusing with the synchronous behaviour on the lua side. [/quote]

I completely agree, I think methods that actually DO yield on the lua side should be suffixed with “Async”. It’d be nice to note that these methods are async on the c-side in the wiki’s description of that method though.

WaitForChildAsync? No thank you :frowning: If you’re going to use something from any API and any programming language, you’re going to know what it does. You can’t get someone’s userId from their name without knowing that GetUsernameFromId exists, and if you know it exists you know what it does. Async is just a redundant reminder that isn’t needed.

How about GetCurrentPlayerUsernameFromPlayerUserIdAsynchronousCPlusPlusSideButNotLuaSideOnTheLuaSideItYieldsItIsNotAsynchronousOnTheLuaSide(int userId)?

More like…
GetCurrentPlayerUsernameFromPlayerUserIdAsynchronousCPlusPlusSideButNotLuaSideOnTheLuaSideItYieldsItIsNotAsynchronousOnTheLuaSideButReallyIsSyncBecauseItIsAYeildFunctionAndAllItDoesIsMakesTheFunctionNameALotLongerThanItShouldBeAndSuperHardToRememberWhatIsAnAsyncAndWhatDoesNotHaveThatFormOfEndingAndIRealizedThatThisFunctionIsSuperLongAndGoodJobRememberingAllThisLikeRememberingAllTheAsyncsAndNot(int userId) :swag:

Jokes aside, have any of the staff members expressed a willingness to do something about the async naming convention?

In terms of RDC East, no one brought it up. I wish I did when I mentioned things like AngularVelocity.angularVelocity being camelCase rather than AllCaps.
For the forums, I have never seen it anywhere.

That question was more directed at Dave/Gamer101 since they’re both interns with direct access to the ears of the ROBLOX staff + it’s the brainchild of TheGamer101.