Quote from: KK20 on March 22, 2018, 02:19:52 pm
@F0: If you're so opposed to it, then just combine the two as
$game_system.playing_bgm && $game_system.playing_bgm.name == "TRACKNAME"
There's nothing stating you can't use and/or in Conditional Branch scripts.
I am not opposed to anything, lol, and I am as guilty as anyone in the community of trying to make everything a "one-liner" back when I wrote RGSS scripts. Over the years I have obviously learned more as everyone has, and cringe at some of the stuff I wrote that I was clever at the time, and I am sure years from now I will feel the same of my current code as I learn more.
I just found the convention of trying to compact every little bit of code into the shortest possible number of characters/lines a bit odd,
even when at the cost of performance, which is typically the reasoning behind trying to make compact code. Some irony there.
This is not an issue unique to RGSS, but looking back, it does seem to hold some greater measure in the community that it is somehow "better" if two different snippets do the same thing, but one is shorter than the other.
Obviously this is a case-by-case basis, and there is no "rule" that doesn't have plenty of exceptions, but just stating an observation. The above example is a somewhat poor example, and would merely be a micro-optimization that holds no sway over the whole at all.
I am against
enforcing any type of standard (I still remember SDK...), but I am for "good coding practice", even when it may be inconvenient for the situation. I wish I would have known things I know now about Ruby when I wrote scripts, but alas, that time has passed
I am far, far from being masterful, but I have recently picked Ruby back up as a hobby, and realizing the error of my ways back then. I would suggest to anyone who is a performance fanatic to really delve deep into the Ruby C API, and really see whats going on behind the scenes with each line in your Ruby script.