Why do we need an entire Service for something that could be realistically handled as a global library, or a method of another service.
For example, TweenInfo is a global, which returns a TweenInfo object, which is passed as the second parameter of the constructor for a Tween Object.
If we can have a TweenInfo global, why can’t we just have a Tween global with Tween.new(), and Tween.newInfo(), for example.
I am leaving out GetValue() yes, this second method is not reason enough to have an entire service dedicated, we can again use the Tween global, with Tween.newAlpha() for example.
Is/was this planned functionality? Was TweenService supposed to have properties, events, more methods?
That could be applied to a lot of things in the Roblox Engine; why have GuiService when StarterGui exists? Why have MemoryStoreService when DataStoreService exists?
From what I remember (and from what I’ve read), Roblox doesn’t want to create too many global libraries. If Roblox made a library for something like TweenService, they’d also likely make a library for something like DataStores (DataStoreOptions, DataStoreSetOptions, etc).
It’s also because TweenService:Create() returns a Tween Instance (which from what I can recall at the moment, no library returns an Instance for any methods), and the Tween Instance has methods and events built for it.
Just today they announced AccessoryDescription Instances for HumanoidDescription. Before, you needed to use tables, but now you can create one with Instance.new.
Yes, they could have also made it so developers had to create their own camera, replication, and character systems… but they didn’t so it would be easier to make games.
If you don’t like tween service remember there are people like me that use tween service and just because you don’t use it you shouldnt complain about it. Also this should be in a different category…
Debris is currently not recommended to be used, because it is less performant than using task.delay and :Destroy(), and it has a cap of 1000 instances
There are things like this that roblox simply don’t maintain, even if updating it wouldn’t cause any backwards compatibility issues. Another example is ContextActionService, and the create mobile button parameter, it still creates mobile buttons in the old style, WHY WASN’T IT UPDATED TO THE NEW STYLE???
The problem with this perspective is that you’re assuming that the service isn’t handling any logic under the hood, as is just a container for methods and events.
I think this is unlikely the case due to the nature of what the service does (calculates animations based on time equations), which probably means that its ties your tweens to a lifecycle event when you play them.
I don’t believe this would be as efficient if each tween instance would be individually handling this logic by themselves, they’re probably all referenced back to the service, which would then do the calculations.
This wouldn’t be done by a traditional library, as libraries shouldn’t impose or run any code when requiring them. (and instead just be a container)
Contrast that to Services which mainly impact actual Instances and other Roblox objects. For Instance the Players service is always returning players and such. TweenService create is used on Instances, therefore it makes sense to be a Service more than a library.
i think it’s a fair question, most people on this thread are judging it from the title alone, and miss that what they’re really asking is “what determines if a module should be a service or a library?”.
It being a service provides easy usage, scalability, high performance and consistency. Afterall it creates object that needs to be controlled/stored somewhere.