Page 1 of 1

Improving source code readablity

PostPosted: Wed May 16, 2007 11:57 am
by mcargile
Having spend a fair amount of time going through the source code making changes to the way the mysql statements are run, I have come to the conclusion that the source code for vicidial could really use cleaning. I am sure this has a lot to do with the time that Matt does not have to spend on that. There is however, for the perl scripts at least, a nice program called perltidy that does a fairly good job at it. The default options configure the code to be inline with the perlstyle specifications. When I ran it just now against AST_update.pl the only thing that it did to the readability that I did not like was it indented some of the comments to the wrong spot. I have not tested if the resulting code runs properly but I see no reason why it shouldn't.

PostPosted: Thu May 17, 2007 2:24 am
by mflorell
If you have the time, and can fully test it, I would be very happy to take optimized code for any scripts that are currently in the SVN codebase. I have to date received several rewrites to both code snippets and full scripts(most recently the send and send_child perl scripts) that resulted in reduction in load and much cleaner code.

If you can do this, please use SVN codebase, test the new script fully and post on the VICIDIAL Issue Tracker.