Re: Structured Coding
- From: mwojcik@xxxxxxxxxxx (Michael Wojcik)
- Date: 10 Feb 2006 14:23:30 GMT
In article <45209mF4ia9nU1@xxxxxxxxxxxxxx>, "Frank Swarbrick" <Frank.Swarbrick@xxxxxxxxxxxxxx> writes:
<Frank.Swarbrick@xxxxxxxxxxxxxx> writes:In article <44foukF1vhs6U2@xxxxxxxxxxxxxx>, "Frank Swarbrick"Michael Wojcik<mwojcik@xxxxxxxxxxx> 02/06/06 11:01 AM >>>
... This was using Pascal. I'm not even sure if Pascal has a goto
statement! (No, just kidding, I'm sure it does. We were just told to not
use it.)
Standard Pascal does include goto, but it's deprecated...
Typically, goto is used in Pascal to escape from nested loops in the
event of an error.
Java has no goto statement proper, though it provides restricted
gotos that can only branch to certain locations (break and continue).
I like this quote from _Learning Java_:
"Multilevel break and continue statements remove the remaining justification
for the evil 'goto' statement in C/C++".
Really? It's impossible to tell out of context (we don't know what
justifications remain, because we don't know which ones the author(s)
have eliminated), but it reads to me like a bit of idle demagoguery.
Bought a book on C# the other day. Has a surprising amount of good stuff.
C#, or the book?
I have two C# books at the moment, both by Jesse Liberty. _Programming
C#_ is a reference, and is OK, but somewhat out of date because
Microsoft is changing the language and even more so the APIs (and the
Visual Studio IDE, if you care about such things) rapidly. _Learning
C#_ I think was probably not worth my money. It's aim isn't clear;
it's not a proper introduction to programming, but it claims that its
audience includes new programmers, and it tries to teach such basic
concepts as arrays. It's not a large book and it devotes far too
many pages to elementary topics like that, and far too little to ones
of more interest to experienced programmers coming to C# (notably
what approaches are preferable for given situations, and why).
C# has a number of nice features; its main problem is that that number
is growing far too quickly. It's losing any hope it had of being more
elegant than C++.
However, it will likely always be better than C++.NET, which will
always be an awkward combination of a bloated, complicated standard
language and a wide array of proprietary extensions. Ugh.
Now F#, *there* is a language for .NET programming...
Can't recall offhand if it has multilevel break/continue statements, or
something similar.
It doesn't, unless they've been added very recently. While C# is in
many ways closer to Java than it is to C++, this is one of the places
where it didn't pick up a Java feature. It also retains goto and
adds "goto case", which it uses to make C++'s default fall-through
(which C++ got from C) explicit rather than implicit.
--
Michael Wojcik michael.wojcik@xxxxxxxxxxxxxx
Q: What is the derivation and meaning of the name Erwin?
A: It is English from the Anglo-Saxon and means Tariff Act of 1909.
-- Columbus (Ohio) Citizen
.
- Follow-Ups:
- Re: Structured Coding
- From: Frank Swarbrick
- Re: Structured Coding
- References:
- Structured Coding
- From: apple.time@xxxxxxxxx
- Re: Structured Coding
- From: Frank Swarbrick
- Structured Coding
- Prev by Date: Re: GoTo in Java
- Next by Date: Re: Are identifier names case sensitive?
- Previous by thread: Re: Structured Coding
- Next by thread: Re: Structured Coding
- Index(es):
Relevant Pages
|