7

On the Io home page it mentions its small size, but it uses a unit of measure I've not seen before:

small vm (~10K semicolons)

Is this just the size in characters (~bytes), or is there something more subtle going on here?

draegtun
  • 22,441
  • 5
  • 48
  • 71
FinnNk
  • 3,249
  • 23
  • 25

1 Answers1

9

It's a measure of Logical lines of code.

Rather than simply counting all lines of code, including comments, blank lines, etc., you only measure the lines that end in a semicolon. It's a still-simple but more accurate measure of how large a piece of code is.

RichieHindle
  • 272,464
  • 47
  • 358
  • 399
  • But still very inaccurate, since different programmers use different levels of nesting statements. – Bart van Heukelom Oct 04 '10 at 08:46
  • 4
    @Bart van Heukelom: that's in fact _precisely_ why "semicolons" are used as a measure. The statements `if (foo) bar();` and `if (foo) { bar(); }` differ in levels of nesting, but not in number of semicolons. – MSalters Oct 04 '10 at 08:49
  • Ah-ha - yes, I'm familiar with logical lines of code. 'semicolon' isn't very Google friendly (even with extra search terms) - thank goodness for StackOverflow (and people like you!) – FinnNk Oct 04 '10 at 09:12
  • @MSalters: What I mean is `doThingWith(getSomeObject(), getOtherObject(), { technique: "cool", nesting: "deep"}, function(callbackData) { data = callbackData; }); ` – Bart van Heukelom Oct 04 '10 at 09:26
  • @Bart van Heukelom: that's two _statements_, but a lot of _expressions_. – MSalters Oct 04 '10 at 09:51
  • @MSalter: Ok, I used the wrong word, but that doesn't invalidate my statement that lines of code (logical or not) are not a good measure of code size. If any exists, it's probably the number of bytecode instructions :p – Bart van Heukelom Oct 04 '10 at 12:12