3 ms·
That just compiles like normal code which is obviously a win in many scenarios but there can be a few downsides. The first is that it can quickly devolve into t
by flukus 7y ago
That just compiles like normal code which is obviously a win in many scenarios but there can be a few downsides. The first is that it can quickly devolve into template/generic hierarchical madness (assuming the real example was a bit more complex then the example), this is more complex to maintain than a DSL parser. The second is users will get crazy meta programming error messages, especially in c++ where you can get some multi page ones. You're probably unlikely to get non-tech people writing these tests but you will get people that want be able to untangle that mess, like QA and interns. There are a few other little things too, like the original including the '$' sign making it clearer what is a monetary value.
Personally nearly every time I write something resembling a DSL it's not for production code though and tends to be written in shell script or awk and will only translate to something like sql.