|
|
|
|
|
by ratww
1788 days ago
|
|
It depends on the intention. If you're intentionally rounding a number because it's in some algorithm, or maybe your tax law, or to give discounts to customers, then it's not glue code. Using a cast to round down will obscure the intention, but I'd argue it's not really glue code. However, if you cast the float because you have two systems and the second one only accepts integers, then you are using glue code to make the two incompatible things work together. The lines a bit blurry sometimes. But the distinction is still helpful, because less code can potentially (but not necessarily) mean less bugs, less time needed to understand the system, less cost, more performance, etc. And glue code is code that you can potentially (but not necessarily) remove. |
|