Add support for "deprecation" declaration #1131
nemo83
started this conversation in
Core language features
Replies: 1 comment
-
|
great idea, we'll discuss this in our biweekly thursday meeting, which you are welcome to join on the pragma discord server |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What is your idea? Provide a use case.
I've been refactoring a large set of aiken validators and I have been re-writing some pieces in order to make them more maintainable and cheap.
Although I'm happy w/ the work, and given the code is not final, I wanted to mark some functions as
deprecatedso that my colleagues wouldn't accidentally start using them instead of the new super cool ones.Why is it a good idea?
Now sure how much of a good idea it is, as having
deprecatedcode in a smart contract is not a good idea. But it could make sense for unfinished contracts where there is an ongoing, long term, multi people effort, to signal that there are multiple algorithms to solve the same problem, one of which should supersede the other, but for a while new and old code should be kept for some time.What is the current alternative and why is it not good enough?
Current alternative is to
//comment the codewhich is okay, but it gives no explicit warnings to users.Afaik Aiken compiler knows how to distinguish dead branches and dead code. Which means by default it could be setup to warning or even better error out if a function is marked deprecated.
Beta Was this translation helpful? Give feedback.
All reactions