i heard that you can now mark functions as deprecated, so when entering it, function name will be crossed out, but how?
you can just put comment @depracated
Anyway why would you be depracating… YOUR OWN CODE!?
That literally the dumbest thing i have heard
You are the only one to maintain the code, just get rid of function entirely!
you should look into this:
Ahh yes and break functionality, so smart of you
iirc the attribute isn’t active yet, but it does get recognised as a valid attribute instead of throwing an error like it used to.
Just mark it as @deprecated
(NOT @depracated
like Yarik said)
@deprecated local function deprecatedFunc()
end
It’s likely to maintain existing implementations; for example, if you have a widely used community module and want to deprecate a code section, you would do so without breaking already existing implementations; it more serves as a warning “this won’t be updated anymore, your code might break in the future”. It’s the same with built-in functions - for example workspace:FindPartOnRay()
is deprecated but still exists for the sake of not breaking existing implementations.
Or maybe the OP just wanted to know how to do it.
That absolutelly 2 different example.
For roblox it makes sense to depracate and not remove becouse a huge community has already written code and is relying on old mechanisms.
But its absolutelly not relatable to a single/small community developer.
hence why i said:
of course, if it’s your own code, it does make sense to just remove it entirely. but if many other people are using it, it makes much more sense to just deprecate it than break all those implementations.
Roblox functions are on engine level so you cant edit them at all
While modules are very easy to edit so i would disagree.
I think they meant widely used modules like TopBarPlus etc. Things that are in the resources section of the forum.
it’s not about their level or how they’re implemented. By your logic, roblox should just remove all those deprecated functions.
It’s about who uses them and how they use them. If someone uses a community module and heavily relies on a function, but the developer of the module decides to make a better function and then just removes the existing one, that entire code will break. The developer might not even be able to fix it right away, leaving their code basically useless as it’ll just keep erroring, etc. However, by deprecating it, it tells developers “hey, this isn’t going to be updated. You might want to move to the new API.” whilst still leaving implementations that don’t get updated anymore intact.
exactly this
gone from simple discussion to fight
Imagine TopBarPlus renamed a function and just removed the old one. That would basically just break every game on the platform upon updates.
“but its up to the developers to update their code accordingly”
PackageLink
Just have local copy.
No need using packages.
Even if it is someone as trustful as HD admin dev i still would not trust him.
dude what
honestly just delete deprecated functions yourself after updating if it matters that much
fair point
But would apply the other way around too.
Even when it’s your own code, if it’s code in a shared library that’s used by lots of other modules within a large project, you might want to make an improved version of a function for whatever you’re working on right now, and not have to take a 2-day side quest to refactor hundreds of uses of the old version throught your project.
Nobody loves adding tech debt, but it’s a fact of life in any large codebase that sometimes you have to leave older functions around for existing code, but want to remind yourself that you’ve got a better option for new code.
True - i was going more along the lines of a large codebase, and my mind instantly jumped to community modules. But this seems a good use for deprecation too.
Thanks for pointing that out!
im NOT rewriting huge scripts.
- im not only one who works on my game.