For example, jQuery’s .live() is deprecated and instead we must use .on() and for MySQL, mysql_* will soon be deprecated and move onto something else… more noteably… mysqli.
Why do frameworks and programming languages deprecate old functions instead of just updating them? Sorry if this is in the wrong place. If it is, tell me where I should post.
When the design of the function has changed, they want to offer a period of time where both old and new functions are offered (a transition time) and then at some future date, the old version is removed. This could not be done if they kept the same name for the new behavior.
.live()and.on()take different arguments and work differently..on()is more powerful and can be made to simulate.live()if desired, but the two are not compatible without changing the calling code.Introducing the new feature with a new behavior, also simplifies the documentation process since it’s completely clear which behavior is documented (by which name it’s writing about).
And, when old code includes the newest latest version that no longer supports the old way of doing things, it is much clearer why things don’t work when
.live()is not even present than if it was present, but had the wrong behavior.And, old behaviors like
.live()are eventually removed from the code because they are a bad way of doing things (that can lead to significant inefficiencies) so jQuery wants everyone to eventually stop using them. Removing it from future versions is a way of forcing it’s usage to decline and eventually go away. The transition period gives the developers a significant amount of time to learn about the need to change and to implement/test the change.