Skip to Content.
Sympa Menu

sm-sorcery - Re: [SM-Sorcery] Preferred coding style for if tests

sm-sorcery AT lists.ibiblio.org

Subject: Discussion of Sorcery related topics

List archive

Chronological Thread  
  • From: Paul <dufflebunk AT dufflebunk.homeip.net>
  • To: SourceMage Sorcery List <sm-sorcery AT lists.ibiblio.org>
  • Subject: Re: [SM-Sorcery] Preferred coding style for if tests
  • Date: Wed, 28 Jan 2004 14:28:51 -0500

My preference is to use && if it's a single command (It's faster to
execute). For more than one command, use the if.

On Wed, 2004-01-28 at 11:22, Ondra Tomecka wrote:
> Hi,
>
> Just a quick question, which may unleash a flamewar ;-)
> Is there preferred style for writing tests?
>
> I mean should I use for patches this form:
> -------------------------------------------
> if [ some_test ]; then
> do_some_simple_command
> fi
> -------------------------------------------
>
> or just
>
> [ some_test ] && do_some_simple_command
>
> What are the opinions?
>
> I used to write with C and C++, so I'm used to former version, but
> recently (blah, 2 years already) I'm working mostly with scripts where the
> latter form is possible.
>
> Andy
>
> _______________________________________________
> SM-Sorcery mailing list
> SM-Sorcery AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/sm-sorcery
--
De mortuis nihil nisi bonum.

Attachment: signature.asc
Description: This is a digitally signed message part




Archive powered by MHonArc 2.6.24.

Top of Page