Re: proposal: plpgsql - Assert statement - Mailing list pgsql-hackers

From Mike Blackwell
Subject Re: proposal: plpgsql - Assert statement
Date
Msg-id CANPAkgur8XEfdCPtv7GZ30oktYELKOp3z34A5cQGeJJ3sZhxZg@mail.gmail.com
Whole thread Raw
In response to Re: proposal: plpgsql - Assert statement  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers

On 18 November 2014 21:19, Petr Jelinek <petr@2ndquadrant.com> wrote:

Personally, I see this as natural extension of the conditional block control
which we already have for loops with CONTINUE WHEN and EXIT WHEN. This
basically extends it to any block and it seems quite natural to have it for
me...

​This seems to me like a step in the direction of APL, where every statement is a conditional.  

Perl has the option of putting the conditional on the end of a statement as suggested here for ASSERT.  My experience has been that while it may "look prettier" to some, the conditional is overlooked in reviews, etc., more often than one would expect, giving a net loss in the overall risk/productivity analysis.

As a code maintainer, I would be opposed to adding something like this for no other reason than perceived aesthetics.

Your mileage may, of course, vary.

pgsql-hackers by date:

Previous
From: Alex Shulgin
Date:
Subject: Re: [PATCH] add ssl_protocols configuration option
Next
From: Simon Riggs
Date:
Subject: Re: Add shutdown_at_recovery_target option to recovery.conf