I was interested in analyzing the code in my first larger PowerBASIC app (about 3000 lines of code), to see what kind of code I used.
Here's the approximate results:
1000 Looping/conditional flow (select, if, do, ...)
750 All other - basically raw code with lots of assignments
500 Control/Dialog or Control Specific (imagelist, treeview, ...)
300 Sub/Function declarations and calling of same
250 Menu definitions, including context menus, plus setting state
200 Dim/ReDim/Global/Local
There were also about 350 comments, either as separate lines or at the end of lines of code.
And there were about 125 subroutines/functions called an average of about 3 times each. This doesn't include callback code that responds to messages.
Has anyone else done a summary of code from one of their apps? I'd guess that the bigger the app, the more common the results would be, regardless of the type of app involved - whereas smaller apps could be much different.
For that matter, there might be some analysis of this type on the web. I'll go take a look.
Here's the approximate results:
1000 Looping/conditional flow (select, if, do, ...)
750 All other - basically raw code with lots of assignments
500 Control/Dialog or Control Specific (imagelist, treeview, ...)
300 Sub/Function declarations and calling of same
250 Menu definitions, including context menus, plus setting state
200 Dim/ReDim/Global/Local
There were also about 350 comments, either as separate lines or at the end of lines of code.
And there were about 125 subroutines/functions called an average of about 3 times each. This doesn't include callback code that responds to messages.
Has anyone else done a summary of code from one of their apps? I'd guess that the bigger the app, the more common the results would be, regardless of the type of app involved - whereas smaller apps could be much different.
For that matter, there might be some analysis of this type on the web. I'll go take a look.
Comment