Page 1 of 1
Deprecated commands
Posted: Tue Apr 05, 2011 12:42 pm
by MachineCode
PureBasic Manual wrote:Warning
This function is deprecated, it may be removed in a future version of PureBasic. It should not be used in newly written code.
I think it's confusing to support deprecated commands. Just remove them and let the coder deal with any error messages. You're just making extra work for yourself for nothing. Don't hold the coder's hand all the time for basic errors like this. IMO.

Re: Deprecated commands
Posted: Tue Apr 05, 2011 2:09 pm
by c4s
Isn't it new that the deprecated functions are listed in the help file?
I think it's a very good idea to do so because there are often questions from newbies like "what means the CreateGadgetList() warning" etc. - This way it's a lot easier to find the new function name.
Re: Deprecated commands
Posted: Tue Apr 05, 2011 5:35 pm
by luis
c4s wrote:Isn't it new that the deprecated functions are listed in the help file?
I saw them only in the history, some times I looked for them using "Find" in that list.
Personally I find the "deprecated" message a good thing. Gives the time to update your program later and still enable you to to use the features of a latest version. You are warned, don't count on this forever and plan to update it, but you are not requested to do it immediately.
Re: Deprecated commands
Posted: Tue Apr 05, 2011 5:38 pm
by freak
The deprecated commands are not for existing users, but for new ones. If they copy a code with a non-existing function from the forum they won't know what to do if the message is just "function does not exist". Not everybody knows the PB history by heart and knows which functions have been removed and why.
> Isn't it new that the deprecated functions are listed in the help file?
Yes its new. The idea is to give enough information on where to look for a replacement for such a function, but no further information on the deprecated function itself so people are not tempted to keep using it in new code.
Re: Deprecated commands
Posted: Tue Apr 05, 2011 5:55 pm
by blueznl
I like the message. If I use one of my older include files and I have not yet done an update I get a warning, so I have some time to take care of matters and no ugly surprises...
Re: Deprecated commands
Posted: Tue Apr 05, 2011 7:00 pm
by Michael Vogel
The message is helpful, an additional [Repair] button/popup which converts the given line to the actual syntax would be perfect

Re: Deprecated commands
Posted: Tue Apr 05, 2011 7:46 pm
by blueznl
Perhaps it would make sense to add a link into the help file detailing the replacement comment, wouldn't it?
In fact, come to think of it, it would also simplify many issues with old code... If the compiler encounters a discarded keyword, throw an error, pop up the requester, and show a hotlink into the help file to the replacement or some related code. If the compiler encounters a deprecated command, still pop up the warning but keep compiling. For all practical purposes, it's little more than a two column list, isn't is?
Effectively, if a user would try to run (copy / paste) some old code, he / she would at least have some clue where to go or what to look for.
Re: Deprecated commands
Posted: Tue Apr 05, 2011 9:16 pm
by c4s
blueznl wrote:Perhaps it would make sense to add a link into the help file detailing the replacement comment, wouldn't it?
E.g. CountList() says: "This function has been replaced by ListSize(). Use that instead." I'd say that's enough.
Re: Deprecated commands
Posted: Tue Apr 05, 2011 10:37 pm
by Zach
c4s wrote:blueznl wrote:Perhaps it would make sense to add a link into the help file detailing the replacement comment, wouldn't it?
E.g. CountList() says: "This function has been replaced by ListSize(). Use that instead." I'd say that's enough.
This is what I was thinking too.
Re: Deprecated commands
Posted: Tue Apr 05, 2011 10:49 pm
by MachineCode
freak wrote:If they copy a code with a non-existing function from the forum they won't know what to do if the message is just "function does not exist"
True, I didn't consider that aspect of it. Sorry for my suggestion, then!

Re: Deprecated commands
Posted: Tue Apr 05, 2011 11:32 pm
by nco2k
@blueznl
#True
c ya,
nco2k
Re: Deprecated commands
Posted: Wed Apr 06, 2011 5:27 pm
by blueznl
c4s wrote:blueznl wrote:Perhaps it would make sense to add a link into the help file detailing the replacement comment, wouldn't it?
E.g. CountList() says: "This function has been replaced by ListSize(). Use that instead." I'd say that's enough.
Yup. What I was thinking is keep some sort of warning in there, because after deprecated comes discontinued. So if something is no longer supported, it would no longer be flagged as deprecated, but it would just cause a compiler error. And that's not very beginner friendly
