KBD

Keith Devens .com

Tuesday, December 2, 2008 Flag waving
Crying is all right in its way while it lasts. But you have to stop sooner or later, and then... – C.S. Lewis (The Silver Chair, ch 2)
← "Steal these buttons" button makerSlashdot | An Analysis of Various Election Methods →

Daily link icon Friday, October 1, 2004

Use positive conditionals

Charles recommends using positive conditionals. It's an interesting aspect of programming style I hadn't considered before, and he cites it as a reason why languages should have "unless" conditionals.

← "Steal these buttons" button makerSlashdot | An Analysis of Various Election Methods →

Comments XML gif

David Chen (http://fallenearth.org/blogs/caiuschen/) wrote:

The "unless" conditional reminds me of Ruby, which reminds me of putting conditionals after the statement. Which reminded me of your entry about highlighting the main part of the the code. I used to be against putting conditionals after the statement, but now I am for it if it helps highlight the main block of code rather than obscuring it.

∴ David Chen | 2-Oct-2004 4:15am est | http://fallenearth.org/blogs/caiuschen/ | #5746

Keith Gaughan (http://talideon.com/) wrote:

The whole prefixed conditionals is a Perl thing, just like unless, though where Larry picked them up, I don't know.

I think they're both great language features.

∴ Keith Gaughan | 2-Oct-2004 12:11pm est | http://talideon.com/ | #5749

David Chen (http://fallenearth.org/blogs/caiuschen/) wrote:

Heh, I thought it might have come from Perl. Matz found a lot of inspiration from it. Oddly enough, I have more experience with Python and Ruby than with Perl.

∴ David Chen | 2-Oct-2004 1:39pm est | http://fallenearth.org/blogs/caiuschen/ | #5751

Feel free to post a comment below. Please see my comment policy.

Formatting Rules (No HTML):

  • **bold**, *italic*, _underlined_, --strikeout--
  • "text"="url" creates a link, and URLs are auto-highlighted
  • Blockquote: Like e-mail, begin paragraph with > (greater-than sign)
  • Lists: begin paragraph with *,-, or + (unordered), or # (ordered)
  • Code block: ?!code:language=perl|php|sql|javascript|etc.{\n}...{\n}?!/code

:
(will be your IP address if blank)
: (optional)
(Will not be shown on site)

: (optional)
:

December 2008
SunMonTueWedThuFriSat
 123456
78910111213
14151617181920
21222324252627
28293031 



RSS feed RSS feed for Keith's Weblog
Atom feed Atom feed for Keith's Weblog
Weblog archive
Recent comments
  on 6 posts

Recent comments XML

new⇒Perl 6 1.0 in March?

Doh, my mistake. I'm aware of the​relation between Parrot and Rakudo​but I'...

Keith: Dec 2, 1:03am

Free image hosting sites

Well, TinyPic has this in its​FAQ:

> Images and videos is in​your accoun...

Keith: Dec 1, 1:13am

Join a NameValueCollection into a querystring in C#

Well with a lamba expression, this​is what I came up​with:

?!code:csharp...

Gustaf Lindqvist: Nov 30, 4:38pm

Why no generic OrderedDictionary?

Check​http://www.codeproject.com/KB/recip​es/GenericOrderedDictionary.aspx?d...

Gabrielk: Nov 27, 6:57am

WhatIsMyIP.com

http://www.thesysteminfo.com is​another good alternate to​whatismp.com... I...

Kripz: Nov 26, 8:51pm

Girls, please don't get breast implants

Actually I think it's sweet when a​man loves a woman whether she's big​or n...

218.186.12.228: Nov 26, 9:40am

Generated in about 0.178s.

(Used 8 db queries)

mobile phone