SRL Archive - Discussions and Debates

Using the include


Tim0suprem0

2010-06-11 01:49:40

Just wanted to get your guys' opinion on this. I recently made a script, which I'm about to release, that has a lot of procedures that are already in SRL. Or for some, maybe they aren't exactly the same, but there are functions in SRL that I could use to go about doing the same thing a different way.

It works fine, but when I started, my knowledge of the include was a lot less than it is now (and it's still growing! :p). So anyway, should I change everything so it uses SRL more? Or should I leave things the way they are? Or is it just personal preference and the ends justify the means.

noidea

2010-06-11 02:27:05

It's always best to use the premade procedures as they are most likely faster and more reliable.

I suppose you could use your own though.

EvilChicken!

2010-06-11 03:01:13

You need to compare your functions with SRL's.

- If there are functions you constantly modify, use yours.
- If SRL's functions are faster, shorter or cleaner, use SRL.
- If you have a function in your script which is similar to SRL's functions, but does not fit in the above mentioned points, use SRL's.
- Needless to say, but if a function in your script is superior to the equivalent function in SRL, use it. But feel free to post the function(s) so they might be committed :)

Tell me if there's anything I could assist with anytime. :)

Sabzi

2010-06-11 04:17:54

What I really love in using SRL's functions is that they will be surely updated.
So if you make a good script it will theoretically never gets outdated.
For example a script with his own login function wouldn't survive long without updating it, but with SRL's you only have to bug the devs. :D

Tim0suprem0

2010-06-11 12:05:19

From: EvilChicken!
You need to compare your functions with SRL's.

- If there are functions you constantly modify, use yours.
- If SRL's functions are faster, shorter or cleaner, use SRL.
- If you have a function in your script which is similar to SRL's functions, but does not fit in the above mentioned points, use SRL's.
- Needless to say, but if a function in your script is superior to the equivalent function in SRL, use it. But feel free to post the function(s) so they might be committed :)

Tell me if there's anything I could assist with anytime. :)


Thanks, this was quite helpful! :)

EvilChicken!

2010-06-11 15:37:47

You're welcome. :3

I might've missed out on mentioning my actual point, which was that a script should be kept as short as possible. It's a thumb rule which goes something like "the shorter, the faster", (of course referring to procs & funcs) which quite more often than not, happens to be true. By "shorter", I ofcourse am referring to difference in lenght between two snippets of code performing the exact same action; never replace good coding practices for shorter/faster methods.
My point with mentioning is that one should always use SRL where applicable, as it both allows you to shorten your code, and take advantage of using a snippet which already has been processed, refined and enchanced by several talented coders.
Just trying to explain the reasoning behind my previous post. :)

Nava2

2010-06-12 15:08:32

If something in SRL doesn't fit your needs, write your own. If it does fit your needs, I would highly recommend using it since they were written to the best standards currently, and as someone else mentioned, will more than likely be updated with little to no compatibility issues.