Sunday, March 6, 2011

Automatic for the People

It's amazing how sometimes an idea hits me. It dawned on me this past week that much of the work I've been doing on libcharlemagne is grunt work. The code file for the PTextView text editing object is literally like 1000 lines long, far longer than most files that I write, and a large portion is stuff that is repeated with very little variation. In a matter of a few nights and a massive codefest yesterday, I've got the majority of a Lua code generation script which will automate most of the work for the different GUI controls. This is a good thing -- already I've found more than a couple bugs in a couple files just while reviewing them for work with the script. All that's left is the code for generating an object's methods -- tricky, but it should be doable with some thought. The more I work with Lua, the more I wonder what other tasks it might be useful for. Who knows? Perhaps PDesigner might end up as a visual designer with the ability to embed Lua code or something. Interesting thoughts for a pleasant Sunday night after a relaxing day. :)

No comments:

Post a Comment