You will be required to give us 25K robux, this will be used to hire a part time builder.
So just like that you expect to be given that
Forum moderator. Need something? PM me.
Moved topic to commons. Let this be the first and last time you post in the wrong category.
@thesit123, that would be obfuscation. Security through obscurity never works. What if one day you decide a change needs to be made but because of the poorly named scripts you might confuse even yourself. Also exploiter can just look at the script despite being poorly named.
They are flawed to the same degree, as I said.They're both abusing the condition part of while loops. One has a function and one doesn't--but they're still truthy no matter what happens.
[...] you should know that if you're using a function call in a conditional, which has no way of allowing to retrieve your lost return value, 99.999.999.999% chance that the value that you are using is unimportant at the time.
Reminds me, by following the while wait() do idiom you lose the return values of wait. You may need to do things over time, and getting the delta time was a good way of doing this. You get the exact time waited, but instead you put it to waste by using it as a condition.
while 1.017474474 do end
1.017474474 represent? It's not relevant to the desired (non) terminating condition at all.
And for my last point...
while true do ... endis clear and goes straight to the point.
while wait(t) do ... endfails to do this.
while true do -- ... wait(t) end
is clearer. It explicitly tells you that the condition is true, that the loop is infinite because there is no terminating condition.
Answer the following questions, I asked for a proper English interpretation of
while wait() do a few posts back, but you failed to give one, presumably because I was right about there being none, or one being difficult to find.
Here they are:
waitin the conditional part tell you the loop is infinite?
waitin the conditional part tell you the condition is
I use while wait() do because I can, and it shortens one line and.. well, it's less for me to read. I'm a lazy person. I take shortcuts. And probably like, weeks later, it comes around to bite me in the behind. Except while wait() do never does that unless I make a stupid mistake.
The "it's less code" argument is a horrible argument, less code should only be considered better code if it increases readability, simplicity or anything like that. Basically if shortening improves the code in any way, sure it's better.
If you know that your loop will never break, then you can use while wait() do or while true do.
Knowing how the idiom works should only be more motivation to avoid it.
Furthermore, with may people's logic as how wait() abuses the condition part of while loops, while wait() do and while true do are flawed to the same degree. It's a pointless argument.
In repetitive doubt, just use while wait() do. also eliminates the chance of forgetting a wait() like a stoopid lol
It's not stupid to forget. We've all made mistakes at one point or another. And what do we do from our mistakes?
Hint: learn from them.
After forgetting you remember not to forget.
if forgetting to call wait is an issue, just have a call to it be the first statement in the loops body:
while true do wait() -- do something... end
There's no reason to argue about unterminating loops' formatting if they both function the same way and have the same level of readability. If you're unable to conclude that you can't obtain a returned value without running the function itself, then you:
A. don't know functions in general
B. are probably new to Lua.
No no no...
The problem is that it's misleading
The condition of a while loop should be relevant to the actual terminating condition you want. Don't want a terminating condition and therefore want an infinite loop? Use
true as a condition!!!! It's not that hard. It's ridiculous sacrificing readability just to save
line of code!!!!
Looks like your connection to Scripting Helpers was lost, please wait while we try to reconnect.