Ted Leung on the air
Ted Leung on the air: Open Source, Java, Python, and ...
Ted Leung on the air: Open Source, Java, Python, and ...
Thu, 28 Aug 2003
"Cuddled elses"
Piers Cawley wrote about how he's adopted Kent Beck's code layout rules for Smalltalk when writing OO Perl. While this in itself is interesting, the thing that inspired the title was his name for
[01:39] |
[computers/programming] |
# |
TB |
F |
G |
0 Comments |
} else {
AKA, the "cuddled else". I never heard of a name for this before. I use this style extensively when I'm programming in Java, but it and all the close brackets use up a lot of whitespace.
I remember the first time I saw Python, and saw that indentation was significant. I was really turned off by it, and it kept me away for quite some time. Part of that was because a long time ago I had to implement a compiler for a language that had a similar offside rule, and it was a nasty experience. Having used Python for a while now has made me a believer in the indentation based syntax. As I was browsing the OCaml documentation, I noticed that OCaml code has a similar flavor to Python code. I don't know if OCaml relies on indentation or not, but it's going to be interesting to find out.
You can subscribe to an RSS feed of the comments for this blog:
Add a comment here:
You can use some HTML tags in the comment text:
To insert a URI, just type it -- no need to write an anchor tag.
Allowable html tags are:
You can also use some Wiki style:
URI => [uri title]
<em> => _emphasized text_
<b> => *bold text*
Ordered list => consecutive lines starting spaces and an asterisk
To insert a URI, just type it -- no need to write an anchor tag.
Allowable html tags are:
<a href>
, <em>
, <i>
, <b>
, <blockquote>
, <br/>
, <p>
, <code>
, <pre>
, <cite>
, <sub>
and <sup>
.You can also use some Wiki style:
URI => [uri title]
<em> => _emphasized text_
<b> => *bold text*
Ordered list => consecutive lines starting spaces and an asterisk