News for hackers. Stuff that matters.
Re:Tom Pinckney: Why I gave up on Java and switched to Python by sambeau on Wednesday August 03, 2011 @09:41AM (#2841081)
I think that the real relationship is between clauses and bugs and in many languages a line equates near 1:1 to a clause.

This is not the case for Perl & APL: each line can contain a multitude of clauses and the relationships between them can be complex to unravel.

Conversely some languages (e.g. at the extreme end assembly language) require multiple lines to express a complete clause.

Complex manually expressed type systems can be similar in effect to both cases. A single line can become complex to unravel e.g this kind of thing:

  int (*(*vtable)[])();
Reading complex regular expressions also exhibit similar problems in deciphering. Hence in Perl they are often broken over multiple lines with /x.

We seem naturally drawn to using lines as logical delimiters: code is maybe similar to poetry in this respect. Also, in similarity to poetry, single clause lines allow us to annotate our thinking on the same line by way of a comment.

One clause per line is probably a natural sweet spot.

If my theory is correct then the relationship between lines and bugs will still be linear but APL would have a multiplier greater than one while assembly's multiplier could be a fraction (e.g. 5 vs 1/5).

Re:Tom Pinckney: Why I gave up on Java and switched to Python by russell on Wednesday August 03, 2011 @03:48PM (#2842703)
If I had to nominate favorite chapters in a book, it would be the one in the Vax C manual that walked you through translating C declarations into English and English to C. There was also a program that would do the same They saved me from mental meltdown more than once.