Interesting...
I ran a tool that counts line of code on the ToggleSwitch class code and it gave me:
Code:
Commented Comment Comment LOC/semi
Lines LOCS LOCS Lines Ratio Semis Ratio File Name
32 16 0 0 0.00 7 2.29 togglesw.cpp
Totals 32 16 0 0 0.00 7 2.29
I ran the same tool on the Posedge_toggle class code and it gave me:
Code:
Commented Comment Comment LOC/semi
Lines LOCS LOCS Lines Ratio Semis Ratio File Name
14 10 1 0 0.05 6 1.67 posedge.cpp
Totals 14 10 1 0 0.05 6 1.67
It is true that my total number of lines in the file is 32 but that includes blank lines and potential comments which makes the code readable. Therefore, it is more meaningful to count real lines of code. The actual number of lines of real code is only 16. Teaching the students to write readable code is one of my priorities and breaking the lines up is one of the techniques. So I just want to make sure students reading it understand it better.