Quenty
|
  |
| Joined: 03 Sep 2009 |
| Total Posts: 9316 |
|
|
| 09 Mar 2013 06:30 PM |
How flexible should (or are) your frameworks on ROBLOX? Do they prepare and validate all user input, with a significant performance cost? Do they presume ROBLOX objects will be there?
Do they presume certain things, how dependent should you make them?
I'm trying to find the answers to these as I create a (fairly flexable) framework, and I want to see what you think. I've decided to not validate user input, because these functions could be called in tight loops. I've also decided that that I will presume ROBLOX methods work, and events work, but not to depend that anything in ROBLOX exists (Parts, Players, etc), and to not provide warnings, but to error and break the script when stuff doesn't work, so I design it to work.
What do you think is the best solution, and if you were going to do it, how would you do it? Do you even develop frameworks, or do you just rewrite code each time? Should I, instead of creating a framework, save stuff in small models that operate within themselves independently, but are extremely hard to modify?
What's your take? |
|
|
| Report Abuse |
|
|
|
| 09 Mar 2013 06:35 PM |
| Best practice recommends checking every single thing that you're not doing yourself (of course, you can trust engines and libraries you use to work as they are described in their documentation). However, we're talking about Lua here. Lua is an exception. |
|
|
| Report Abuse |
|
|
|
| 09 Mar 2013 06:41 PM |
Quenty
you can't just walk up to people and ask how flexible they are
But srs, I mostly re-code stuff from scratch, except waitforproperty and Instance_new2. I just copypasta those into the top of the script. |
|
|
| Report Abuse |
|
|
Quenty
|
  |
| Joined: 03 Sep 2009 |
| Total Posts: 9316 |
|
|
| 09 Mar 2013 06:49 PM |
I really wish Lua wasn't loosetyped (even though a year ago, it would be opposite), in fact, it would be nice (at this point) for ROBLOX to be using a different programming language. However, Lua fits perfectly for ROBLOX, and is perfect for beginners.
|
|
|
| Report Abuse |
|
|
smurf279
|
  |
| Joined: 15 Mar 2010 |
| Total Posts: 6871 |
|
|
| 09 Mar 2013 07:19 PM |
you guys worry too much. . . i assume your using this for yourself? then only check whats necessary. why make it super flexable if you can figure out the problems for yourself. If you plan to publish it then give the user some credit. if they can't figure out simple errors then dont bother making exceptions for them.
you guys spend so much time worrying over petty details like these instead of actually working. its not like you can't change your code in the future
|
|
|
| Report Abuse |
|
|
8SunTzu8
|
  |
| Joined: 30 Sep 2011 |
| Total Posts: 8199 |
|
|
| 09 Mar 2013 08:02 PM |
I had a script that would change a selected player's team.
However, if you input that player incorrectly, then it would break. So, checks are probably a good idea, and the performance lost will end up being minimal in those instances.
"Consider, friend, as you pass by, as you are now, so once was I. As I am now, you too shall be. Prepare, therefore, to follow me." -Scottish Tombstone Epitaph |
|
|
| Report Abuse |
|
|
|
| 09 Mar 2013 08:22 PM |
Since it's within your own place, you can usually find out exactly what sorts of circumstances your scripts will be exposed to, and explicitly place restrictions on yourself to stop certain circumstances from coming about.
So, usually I only do checks where I know the normal behavior is unpredictable (e.g., loading the character, script execution order, &c) |
|
|
| Report Abuse |
|
|
coplox
|
  |
| Joined: 07 Jun 2008 |
| Total Posts: 3252 |
|
|
| 09 Mar 2013 08:28 PM |
| I have a really bad habit of making a lot of fail-safes in my scripts. I'm too flexible. |
|
|
| Report Abuse |
|
|
|
| 09 Mar 2013 08:33 PM |
| I've made a couple FPS frameworks...turns out it wasnt flexible enough and nobody but me coud use it. |
|
|
| Report Abuse |
|
|