4 ms·
These solutions are what is presented at the beginning of the article, basically. They suffer from a maintenance and readability issue (most editors will disabl
by ux 12y ago
These solutions are what is presented at the beginning of the article, basically. They suffer from a maintenance and readability issue (most editors will disable syntax in the macro scope, you have to mess with the '\', ...).
In this particular case it's not exactly a problem, but when you reach a 100+ lines macro, it becomes one.
It's a bit like maintaining pixel shaders in strings, it pretty quickly becomes a huge PITA.
Now if you read carefully the post, you will notice that I'm not encouraging the latest multiple files method, it is just presented because it's a common pattern and has its use cases.
I think what is described in "Mixing full functions mechanism and macros" would be more appropriate for the example you picked. Again, you have to assume that the function is going to grow, and it needs to be editable.