Guru: What Is Constant Folding And Why Should I Care About It?

Constant folding is a compiler-optimization technique, whereby the compiler replaces calculations that involve constants with the result values when possible. Constant folding is common in modern compilers, and according to the RPG reference, the RPG compiler uses this technique. (See the documentation of the %div and %rem functions, for example.)

But you and I don’t write compilers. We write business applications. Why then should we care about constant folding? That’s a question worth pondering.

Consider how I used to have to write RPG in the Dark Ages.

C MOVE CUSTNR CUSTSV 50

Here I’m copying the customer account number to

The post Guru: What Is Constant Folding And Why Should I Care About It? appeared first on IT Jungle.

Generated by Feedzy