Is getservice redundent?

I’ve been really thinking about this. I mean the only difference I guess that it wouldnt error if you changed like ServerScriptService to just like serverscripts, though even then I think thats a code smell by itself if you are changing it. So aside from what I describe what other features does GetService(“Service”) have than just doing game[“Service”]?

GetService will also create the service if it’s not currently there

1 Like

Some services are not available by default; doesn’t exist in place, therefore you use GetService to instanciate the service. The topic above includes all the reasons.

1 Like

Utilizing GetService is good practice as it will create a new service just in case the one you’re trying to index doesn’t exist yet. Attempting to fetch a non-existent service will throw an error.

Just use GetService. Personally it’s better practice for you and keeps your code consistent and clean

1 Like