Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated functions - centralizing them to optionally not include. #7814

Open
dimitre opened this issue Dec 11, 2023 · 1 comment
Open

Deprecated functions - centralizing them to optionally not include. #7814

dimitre opened this issue Dec 11, 2023 · 1 comment

Comments

@dimitre
Copy link
Member

dimitre commented Dec 11, 2023

I'm thinking about deprecated functions and remembering some previous discussion in github and other means:

Personally I don't think deprecated functions should survive very long on the core (more than 1 year or a major release) but I know there are important downsides to it, like the books printed on OF - that is a good point

I'm wondering about moving all deprecated functions to an ofDeprecated.cpp / .h so it can be optionally not included.
This way we can have the OF backwards compatible and by choice we can disable all deprecated functions.
The good side of removing them is having a faster code completion, smaller code completion cache and a tiny bit faster compilation.

in the next image we can see ofRect function (deprecated almost a decade ago) on autocomplete.
thoughts? ideas?

Screenshot 2023-12-11 at 11 01 41
@artificiel
Copy link
Contributor

artificiel commented Dec 12, 2023

the reason I'm not against holding onto deprecations long-term is that it provides quick fixes when opening old projects. my personal use case is not to try to run projects from 2014 "as is", but i expect to open them in OF2023 and get quick hints about stuff that is gone. if the deprecations are removed, I will only get errors, no helpful guides.

the idea of segregating long-deprecated deprecations in an optional headers is interesting (due to dependencies it may need a -deprecated.h per actual .h?). so If you are in a project resurrection mode, you enable the flag until you fix all the deprecation warnings.

ideally the flag would be opt-in, so old projects includes old deprecations by default, but a newly created project defaults with OF_SUPPRESS_ANCIENT_DEPRECATIONS=1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants