View Single Post
  #8   Spotlight this post!  
Unread 18-12-2013, 04:05
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 667
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
Re: C++ Toggle Button

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.
__________________

Last edited by mikets : 18-12-2013 at 04:31.
Reply With Quote