in reply to Re: Ordering of parameters - Re^9: Converting Unicode
in thread Converting Unicode
Regarding the hash suggestions, is this what programmers usually do? . . . put all variables in a hash and bounce them around to the various subroutines, even if a given subroutine might use but a few of those variables?That was my suggestion and, no, only pass arguments that the specific sub requires and nothing more. This is what you should be doing regardless of how the data is being passed. If you've been passing all your data around even if a given subroutine might not use it, I gotta agree with Jenda, this sounds poorly designed.
Apparently, I'm the only one who ever needs scores of variables passed into a single subroutine...But do you really need scores of variables passed into a single subroutine? You might not be the first to try but you're the only person I've seen determined to continue doing that while blaming the language and looking at time tested solutions with 'disgust'. I seriously thought you meant you had 5-10 arguments which would be hard to keep track of but fifty?!? I can't imagine a well designed sub that changes or even accesses the value of fifty different variables every time it's run. At the risk of making another 'disgusting' suggestion, if most of those 50 arguments is just state data being read or passed along to other subroutines, objects might be what you're after.
Regardless, 30,000 lines of code with dozens of globals and subs that accept 50 arguments is madness. Go ahead with the rewrite but an inexperienced developer who has generated a codebase larger than both Mojolicious and Moose while scoffing at established best practices and decades old solutions even when they're explained will not suddenly write better or smarter code by switching to Raku (yet another language you don't really know). We've been trying to help and I'm not going to bully someone for being inexperienced but every complaint you have sounds like a symptom of poorly designed code [edit: and unjustified stubbornness] and I'm beginning to think we're just feeding a troll.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
| A reply falls below the community's threshold of quality. You may see it by logging in. |