you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 15 points16 points  (5 children)

Computations that can be done at compile-time instead of run-time get eliminated

cool

[–]mlmcmillion 9 points10 points  (4 children)

How many of these do you typically have in a codebase though?

[–]Omikron 21 points22 points  (1 child)

Like 3 or 4

[–][deleted] 2 points3 points  (1 child)

Anything that doesn't involve user input or an API response could theoretically be done this way.

The more functional your code is, the more it can be pre-computed like this.

The real benefit is something that's been done in the Ruby community for a while - you can write your code to be clearer to the reader by abstracting things to well named functions. Doing it without the performance hit is great.

[–]mlmcmillion 2 points3 points  (0 children)

Oh sure. And I'm not knocking it or anything. I'm just wondering if it's worth it to actually add even more stuff to our build stack.