Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Semicolons or just OCD

35 views
Skip to first unread message

Doc Trins O'Grace

unread,
Dec 8, 2015, 12:01:56 PM12/8/15
to
I tend to write my awk programs using a semicolon at the end of every statement. I think I picked up this habit using C and Java. I noticed that in the examples I see from you all here, that this practice appears to only occur when multiple statements are placed on the same line. I tend to do this in Perl as well.

Are there any advantages or disadvantages to this habitude?

Kenny McCormack

unread,
Dec 8, 2015, 1:00:49 PM12/8/15
to
In article <de32d077-6a61-4cfd...@googlegroups.com>,
AWK is classically a line-oriented language (unlike those other languages
you mentioned). Thus, it looks ugly and uncouth to put in semicolons at
the ends of the lines. It makes you look like a refugee from another
language.

--
b w r w g y b r y b

Ed Morton

unread,
Dec 8, 2015, 5:06:24 PM12/8/15
to
On 12/8/2015 11:01 AM, Doc Trins O'Grace wrote:
> I tend to write my awk programs using a semicolon at the end of every statement. I think I picked up this habit using C and Java. I noticed that in the examples I see from you all here, that this practice appears to only occur when multiple statements are placed on the same line. I tend to do this in Perl as well.
>
> Are there any advantages or disadvantages to this habitude?
>

advantages: if/when in some highly unusual situation you decide to change your
multi-line script to a single line you do not need to add sem-colons.

disadvantages: to quote from the movie Fargo: it's kinda funny-looking.

IMHO - don't do it or people will think you don't know awk.

Ed.
0 new messages