strcmp on the wiki - time for a change?
#3

For a short answer I say yes.

On the other hand, I think this post is worth a read:
Quote:
Originally Posted by AndreT
View Post
I agree that beginners need to be told about more efficient ways to handle commands, but the command "processors" that use CallLocalFunction only become favorable when there are more commands than just a few. CallLocalFunction, too, uses string comparisons, but does it using binary search resulting in logarithmic compexity. But it does not search from amongst your commands, but all public functions registered with the AMX (everything such as native callbacks, timers, etc. are included in the search).

So for just a few commands I would favor using string comparisons in OnPlayerCommandText. Especially when the code is created by or for beginners who could find the idea of callback hooking or includes confusing!
Even with that said, I still agree that the other options should be presented at the time you also show using OnPlayerCommandText. Maybe just have an additional warning box stating that there are more efficient ways. As pointed out, there are numerous pages that would need modifying, and you cannot register on the Wiki anymore (AFAIK), so you would have to get a select few to do that.

The reason I say don't strip the OnPlayerCommandText method completely is I believe they should know the different approaches they can take. That also makes it their responsibility on whether or not to choose the better method.
Reply


Messages In This Thread
strcmp on the wiki - time for a change? - by MP2 - 19.07.2013, 06:01
Re: strcmp on the wiki - time for a change? - by Vrag - 19.07.2013, 06:08
Re: strcmp on the wiki - time for a change? - by Bakr - 19.07.2013, 06:27
Re: strcmp on the wiki - time for a change? - by DBan - 19.07.2013, 06:48
Re: strcmp on the wiki - time for a change? - by MP2 - 19.07.2013, 06:58
Re: strcmp on the wiki - time for a change? - by RajatPawar - 19.07.2013, 07:03
Re: strcmp on the wiki - time for a change? - by Sublime - 19.07.2013, 07:11
Re: strcmp on the wiki - time for a change? - by MP2 - 19.07.2013, 08:02
Re: strcmp on the wiki - time for a change? - by AndreT - 19.07.2013, 08:49
Re: strcmp on the wiki - time for a change? - by Twizted - 19.07.2013, 09:01
Re: strcmp on the wiki - time for a change? - by MP2 - 19.07.2013, 09:16
Re: strcmp on the wiki - time for a change? - by Y_Less - 20.07.2013, 12:13
Re: strcmp on the wiki - time for a change? - by MP2 - 20.07.2013, 12:52
Re: strcmp on the wiki - time for a change? - by Basssiiie - 22.07.2013, 23:16
Re: strcmp on the wiki - time for a change? - by MP2 - 22.07.2013, 23:46
Re: strcmp on the wiki - time for a change? - by Basssiiie - 23.07.2013, 00:06
Re: strcmp on the wiki - time for a change? - by legodude - 23.07.2013, 10:48
Re: strcmp on the wiki - time for a change? - by MP2 - 23.07.2013, 10:53
Re: strcmp on the wiki - time for a change? - by Richie© - 23.07.2013, 13:10
Re: strcmp on the wiki - time for a change? - by MP2 - 23.07.2013, 13:59
Re: strcmp on the wiki - time for a change? - by Basssiiie - 24.07.2013, 23:43
Re: strcmp on the wiki - time for a change? - by jamesbond007 - 25.07.2013, 09:12
Respuesta: strcmp on the wiki - time for a change? - by RafaelZam - 26.07.2013, 05:42
Re: strcmp on the wiki - time for a change? - by Scenario - 26.07.2013, 05:49
Re: strcmp on the wiki - time for a change? - by IllidanS4 - 26.07.2013, 15:15
Re: strcmp on the wiki - time for a change? - by Scenario - 26.07.2013, 15:27
Re: strcmp on the wiki - time for a change? - by Ballu Miaa - 26.07.2013, 15:34
Re: strcmp on the wiki - time for a change? - by IllidanS4 - 26.07.2013, 17:19

Forum Jump:


Users browsing this thread: 1 Guest(s)