As I’m looking throughout posts on the Internet for solutions to my problems. I find that people often use using as a built-in function rather than at the top of their file. Same posts, of which I guess was about 5 mention different security reasons of using it. Once, alleged problem was “resource leak”, which I have assume is something of a negative Heartbleed or buffer underload.
Whilst I would put using MyNamespaceHere; on top of the file, they would put in a function fashion as such:
using (var variable = MyNameSpace.MyClass.MyFuncion()) {
}
- For one, does Unity have my back on this one, after all I don’t code for raw .NET interface but for Unity’s C++ written interface so any fallacies are technically absorbed by Unity’s code, right?
- For second, does it really matter if there’s a resource leak when there’s tons of decompilers for Unity games? Hacker could simply decompile my game, put his own code in there and read all of these data anyway.
Other than different places of accessibility, does it matter?
One could complain about memory overuse, but if my function is returning random numbers (on purpose), and I ask 10 million random numbers, and return them, it’s not going to keep that 10 million numbers in its memory, it cleans them up right? “Garbage collection” and what not? The only ones that stay are the ones that I decided to assign somewhere. On function’s end it drops it’s internal processing data, right? And if not, why doesn’t it do it automatically? Why on Earth would you want that data stay there?
Once again, I’m ignorant on the topic, so have patience.