logo       

RE: VB vs C# is there a auto documenting feature in C#: msg#00165

org.user-groups.dotnet.padnug

Subject: RE: VB vs C# is there a auto documenting feature in C#


Excuse me, short-circuit is to confusing? I don't think so. If a person is a
programmer then they should be able to follow a language syntax. Just
because some of them can't, doesn't mean that it should not be included.
Thats like saying I shouldn't have an engine in my car since I don't
understand what all the little wires are for.

Conditionals should never have side effects. Unless you really like
debugging and testing nightmares. Any decent optimizer can take an
assignment statement and a following if statement and make just as efficient
as a conditional with side effects. The difference is testability and
reliability.

VB.net does have short circuit capabilities. I think the AndAlso and OrElse
are easier to read. Also, I the evaluation is from the left to the right,
so it reads as a statement "If this AndAlso That then" If "This" if false
the "That" will not be evaluated.
Of course equivalant in C# reads: "if This ampersand ampersand That brace".

Ken

_____

From: Stuart Celarier [mailto:stuart@xxxxxxxxxxx]
Sent: Thursday, January 20, 2005 11:11 PM
To: padnug@xxxxxxxxxxxxxxx
Subject: RE: [padnug] VB vs C# is there a auto documenting feature in C#


Darthsmily wrote:

> does anyone know why .net evaluates both half of an 'or' statement?

IIRC (I'm a little hazy on this...), short-circuit logic was judged to be
too confusing by VB.NET programmers. And it *can* be confusing if the
expressions being evaluated have side effects.

.NET totally supports short-circuit evaluation of logical expressions, this
is a language-specific issue.

Cheers,
Stuart

Stuart Celarier | Fern Creek | www.ferncrk.com





_____

Yahoo! Groups Links


* To visit your group on the web, go to:
HYPERLINK
"http://groups.yahoo.com/group/padnug/"http://groups.yahoo.com/group/padnug/


* To unsubscribe from this group, send an email to:
HYPERLINK
"mailto:padnug-unsubscribe@xxxxxxxxxxxxxxx?subject=Unsubscribe"padnug-unsubs
cribe@xxxxxxxxxxxxxxx


* Your use of Yahoo! Groups is subject to the HYPERLINK
"http://docs.yahoo.com/info/terms/"Yahoo! Terms of Service.



--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.7.0 - Release Date: 1/17/05



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.7.0 - Release Date: 1/17/05



[Non-text portions of this message have been removed]






<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise