Not making functions unnecessarily is a pretty good rule, but like all rules, it can be ignored for good reasons. Strict adherence to any rule (in programming) is fraught.
Yeah there is some overhead with a function call, but for our use case (low-traffic web and batch jobs) that wasn’t a big deal. And the rest of their code wasn’t exactly tuned for performance either.
Yes, it was the dogmatic approach to it that was the most infuriating.
Yes, but Perl 5 did not, except for constant functions. Either way, the effect of that was outweighed by several orders of magnitude by the rest of the WTFs in that code.
All that is a bit beside the point I was trying to make, which is write readable code.
Use your own judgement to find a balance between readability and performance. Use profiling tools to find hotspots where performance is a concern and optimize those. Base your practices on evidence not dogma.
Yup just wanted any newbie types scrolling by to not take that as something that is always true, when writing in most compiled languages it is completely up to the compiler.
Not making functions unnecessarily is a pretty good rule, but like all rules, it can be ignored for good reasons. Strict adherence to any rule (in programming) is fraught.
Yeah there is some overhead with a function call, but for our use case (low-traffic web and batch jobs) that wasn’t a big deal. And the rest of their code wasn’t exactly tuned for performance either.
Yes, it was the dogmatic approach to it that was the most infuriating.
Not necessarily, since compilers can inline functions as an optimization
Yes, but Perl 5 did not, except for constant functions. Either way, the effect of that was outweighed by several orders of magnitude by the rest of the WTFs in that code.
All that is a bit beside the point I was trying to make, which is write readable code.
Use your own judgement to find a balance between readability and performance. Use profiling tools to find hotspots where performance is a concern and optimize those. Base your practices on evidence not dogma.
Yup just wanted any newbie types scrolling by to not take that as something that is always true, when writing in most compiled languages it is completely up to the compiler.