News for hackers. Stuff that matters.
Re:How important is it to reduce the number of lines in code? by Someone on Sunday April 07, 2013 @04:17AM (#5506498)
There are few, if any, languages where that would be guaranteed to work. For example:

in C

  #include <studio.h>#include <stdlib.h>
won't work. In perl, strings with literal new lines or here docs will break (terminator must be on a line by itself)

Any language with 'comment till end of line' would break.

Any language that does not use semicolons as statement terminator or separator such as Forth, Postscript, and XML-based languages wouldn't like the inserted semicolons.

Even pascal would break, as it has a few places where repeated semicolons are illegal, as in the third line of

    type
      T = record
        a : integer;
      end;
Algol has a problem changing

    if x=4 then y:=5
    else y:=6;
into

    if x=4 then y:=5;else y:=6;
Because a semicolon is a statement separator in Algol (I think pascal has this problem, too)

So, can anybody suggest a language where this would work?

Re:How important is it to reduce the number of lines in code? by baddox on Sunday April 07, 2013 @03:29PM (#5508328)
I don't really know. I had Ruby in mind, and it seems to mostly work there, but still obviously breaks for things like heredoc multiline strings. Of course, the point is that making generalizations about the line count of a program is silly, because the line count can vary wildly between two semantically identical programs.