Is it bad practice to rename a service?


  • I'd like to hear your opinions!

    Just a side note: I won't do this, just wanted to see your opinions.

    I was working with someone on studio yesterday and they renamed ReplicatedStorage to RS, ServerStorage to SS, ReplicatedFirst to RF, and so on. I wanted to know your opinions about this.


  • I don't see why it would be worthwhile to do so. If I rename a service, I am still using :GetService() which means that I will be doing the same amount of typing for the name. If he was doing it so that using game.SS would be easier, that was not a good reason to change the name of the service. It is better practice to use :GetService() as explained so eloquently by M39a9am3R in his answer to my question. Also, you should be using variables if you need to make the name easier to type. If you are typing ServerStorage enough to need to change the name, you are typing it to much. A variable is a much better way to go. Honestly, I can think of no decent reason why renaming a service would be helpful. Because it is not useful and not convention (from what I have seen), it is bad practice.
    Quick note about :GetService(): It is very important to use on the client because the client can change the names of scripts, and if you use :GetService(), you will be able to protect against your scripts being broken.


  • Personally I see no point in doing so. An exploiter can still run GetService(). No competent exploiter will do game.Workspace in any professional script


  • That is not the point @green271 . If they rename services any client sided script will see those changes. This means that if the client changed the name of ReplicatedStorage then any localscript that did game.ReplicatedStorage would break. If you use :GetService() this error is avoided.

  • Global Moderator

    @green271 I'd like to point out that game.Workspace is a property and thus would still work after renaming the Workspace.

    @incapaz But regardless of whether game:GetService() works or not, you should not rename services. You may end up using other people's modules in your own work, which may index the DataModel directly and therefore won't work if you don't stick to the standard service names.

Log in to reply
 

Looks like your connection to Scripting Helpers was lost, please wait while we try to reconnect.