davidedc / livecodelab

a web based livecoding environment
http://livecodelab.net/
MIT License
327 stars 63 forks source link

Stats fixups #274

Closed rumblesan closed 7 years ago

rumblesan commented 7 years ago

This PR cleans up a few things around the stats widget.

fixes #142 fixes #146

rumblesan commented 7 years ago

@davidedc I'm currently making the assumption here that an "empty" sketch is one that's comprised only of comments and white space. You mentioned in #142 about the edge case of supporting non-rendering sketches, but I'm not sure that's something worth supporting currently.

davidedc commented 7 years ago

yeah if detecting non-rendering code doesn't fit the solution easily, let's not do it

rumblesan commented 7 years ago

it's not necessarily that it's difficult to do, more that I don't think it's worth supporting. I think that the best example of non-rendering code is for straight audio sketches, but even then LCL is "doing something" so having some form of stats up still seems reasonable.

davidedc commented 7 years ago

yes you are right, we'd also have to check if a "play" command is issued, not just graphical commands.

But let's keep it simple, let's do as you say, it's not worth the additional complication even if it's just one flag.

rumblesan commented 7 years ago

fair enough. One thing is that currently the livelangv1 compiler only checks if a sketch is totally comprised of white space, it doesn't handle comments, so a sketch of just comments still displays the stats.

Shouldn't be too tricky to update the regexp checker though I think

rumblesan commented 7 years ago

right, got it, and with a test as well :)