Where I work, I see a lot of the following type of code written in PL / SQL,
IF a>b THEN
NULL;
ELSE
c:=a*b;
END IF;
I find this odd because the C equivalent would look like this:
if (a>b)
{
}
else
{
c=a*b;
}
And the above type of code was frowned as a bad style on the C forum, which I know when posting newbies. Since PL / SQL does not allow empty blocks and always requires a NULL statement, does this type of coding style give any wrt readability advantages or is it just a matter of preference ?. FWIW, the guy who encoded PL / SQL with the above style is undoubtedly an experienced coder. Are there any advantages over the following?
IF a<=b THEN
c:=a*b;
END IF;
source
share