collectiveaccess / providence

Cataloguing and data/media management application
GNU General Public License v3.0
303 stars 170 forks source link

Increase the usage of expressions with combined operators #1225

Open elfring opened 3 years ago

elfring commented 3 years ago

:eyes: Some source code analysis tools can help to find opportunities for improving software components. :thought_balloon: I propose to increase the usage of combined operators accordingly.

Would you like to integrate anything from a transformation result which can be generated by a command like the following? (:point_right: Please check also for questionable change suggestions because of an evolving search pattern.)

lokal$ perl -p -i.orig -0777 -e 's#(?<target>\$\S+)\s*=\s*\k<target>[ \t]*(?<operator>[+/%^.]|-(?!>)|&(?!&)|\|(?!\|)|\*\*?|<<|>>|\?\?)#$+{target} $+{operator}=#gm' $(find ~/Projekte/Providence/lokal -name '*.php')
elfring commented 2 years ago

I would appreciate another bit of constructive feedback. :thinking:

collectiveaccess commented 2 years ago

Apologies. We were doing some housecleaning and prematurely closed this.

What exactly are you suggesting? To wholesale replace assignments in thousands of source files, some of which date back 20 years, using a regular expression? Wouldn't this potentially introduce a whole bunch of hard to find/diagnose bugs?

elfring commented 2 years ago

I propose to adjust a few implementation details in some source files. 🔮 Will the support grow also for the application of combined operators according to the programming language “PHP”?

collectiveaccess commented 2 years ago

Which files?

elfring commented 2 years ago
collectiveaccess commented 2 years ago

Please explain what you hope to achieve with this transformation.

elfring commented 2 years ago

Software run time characteristics can be influenced in desirable directions if each parameter will be evaluated only once by combined operators, can't they? :thinking:

collectiveaccess commented 2 years ago

Have you evaluated to impact of this change on performance?

elfring commented 2 years ago

Not yet. ‒ 💭 I became curious if you would like to take another look at change possibilities.