3 ms·
Another benefit of Lua/Python is that it is considerably easier to write testing and debugging versus C. They support introspection and similar techniques. A
by rogerbinns 10y ago
Another benefit of Lua/Python is that it is considerably easier to write testing and debugging versus C. They support introspection and similar techniques. A very typical example is something I did a while back.
I wrote the processing in Python first. The core was 10 lines of code and took about 5 minutes to run on a unit of data. It took about an hour to write, and was correct.
It then took two days to rewrite in C and was 400 lines of code, executing in a second or so. Much of the time was finding and fixing minor bugs. But having the "correct" Python code made it very easy to feed the same test data to both implementations and verify the output. Writing test code in C would have taken even longer than just the algorithm!