No More Pairs is a plugin made to reduce the use of pairs() from your game!
No More Pairs
No More Pairs is a Roblox plugin made for 2 types of people, scripters that got used to write pairs() in their scripts, and game owners/managers.
How does it work?
The plugin uses string manipulation to detect pairs() pattern, and then removes the pairs()
Why is pairs() bad?
In LUA itself, it is necessary to use pairs(). And Roblox, since it uses LUA, was also like that. But Roblox removed this obligatory pairs(), now you don’t need it! But some people still are used to it.
Why using No More Pairs
Free
Open source
Easy to use
More optmization to your game
How to use it?
First, you will choose which option do you want. When done choosing, press the “No More Pairs!” button, and done! Easy like that.
Feedbacks
This is my first plugin ever, so i would really appreciate any types of feedbacks!
Upcoming
Shortcut for removing pairs() in the script you are working with.
I use pairs() in for loops to manipulate data in dictionaries. pairs() are really helpful for obtaining the keys and values of a table. I don’t understand why someone wouldn’t use it.
But Roblox removed this obligatory pairs()
Link to official Roblox post? Nothing’s ever “obligatory,” it’s just a fundamental keyword. Plus it’s not deprecated or anything, and you can use ipairs() for lists if needed.
Any examples of how this plugin would be beneficial to code?
Well, this part about obligatory pairs() i’m not 100% sure. Some old developers in Hidden Devs told me it, it might be wrong tho.
But about the benefits of not using pairs(), right now pairs() it’s just useless. In LUA pairs() is used to make pairs with items in dictionaries (idk if it’s dicts or arrays can’t remember right now). But Roblox already does that for us, so we are kind of making the same thing twice. Although it’s a small difference in performance, when talking about only one pairs(), this plugin was made for games with a bunch of pairs in it. (more pairs, less performance)
Pairs isn’t exactly bad, it just isn’t needed anymore. It’s better to keep your code modern and up to Luau standards. The replacement is literally nothing, you can simply just use a table without pairs.
Why would i want to do this in contrast to pairs? Also, while retriveing and setting data should not be found in a table using pairs(), pairs are still essential for illiterating through all the items in other uses.
Removing pairs can make certain tasks tedious and more difficult than it has to be. I would have to do something like:
Not really, the way I sent also returns the index and values of the table.
So, in performance it’s quite great to use for index, value in table do without using pairs() or ipairs().
You need to learn critical thinking skills instead of believing everything you hear. They did not provide any evidence that it actually does this. In fact, after evaluating surface level credible of this user, it can be noted that:
They use improper grammer and lack sophistication in their messages.
They appear to be a new or novice scripter
They don’t appear to have any proof and simply believed a “old developer” in some discord server.
From this credibility, I can say for certain that the claims of pairs() being unoptomized is unfounded. Please use your brain and don’t trust everything you read on the internet.
I didn’t 100% believe, and I wasn’t going to benchmark
Okay, but I mean’t it’s likely to be true, since I already saw this,
(Also, I normally don’t care about performance, that’s why I wasn’t going to benchmark.)
For me, the only reason I wouldn’t use pairs is because of metatables. They can have an __iter method which acts like pairs by default. If you use pairs, that metamethod will not work. If you use nothing, it uses the metamethod.
I won’t switch unless we can clearly see which is faster. I’d appreciate if somebody did a real benchmark!
It could be slower too if you think about it a different way. It could be either, so we need somebody to do a benchmark. I can’t right now, I’m not at home.
If you know lua basics, you should know that everything that is called with () is a function in Lua. Pretty obvious that functions are not instant and perform various operations.
You may do for i,x in table do instead of for i,x in pairs(table) do or for i,x in ipairs(table) do.
When did this feature ever come out?
Also, wouldn’t it be more confusing since if you used ipairs() then you know it’s index, value. And if you used pairs() then you know it’s key, value.
In your example, both uses i, x which decreases clarity. Plus, in Python (I know it isn’t LUA), it uses something similar to pairs() and ipairs() too, like enumerate() and .items()