Re: Structured Coding




In article <45209mF4ia9nU1@xxxxxxxxxxxxxx>, "Frank Swarbrick" <Frank.Swarbrick@xxxxxxxxxxxxxx> writes:
Michael Wojcik<mwojcik@xxxxxxxxxxx> 02/06/06 11:01 AM >>>
In article <44foukF1vhs6U2@xxxxxxxxxxxxxx>, "Frank Swarbrick"
<Frank.Swarbrick@xxxxxxxxxxxxxx> writes:
... 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
.



Relevant Pages

  • Re: Structured Coding
    ... Standard Pascal does include goto, ... Microsoft is changing the language and even more so the APIs (and the ... The book I am reading is _Programming C#_ (hmm, ... I had major problems struggling with OO COBOL when it was first released. ...
    (comp.lang.cobol)
  • Re: Structured Coding
    ... Standard Pascal does include goto, ... Microsoft is changing the language and even more so the APIs (and the ... The book I am reading is _Programming C#_ (hmm, ... But, then, it's hard to erase all these years of procedural programming and ...
    (comp.lang.cobol)
  • Re: GOTOs
    ... Any language which allows them is a disgrace ... But there was no GOTO. ... > At the age of 79 and still programming, my favourite language is still the ... One must be carefull that the construction is not the more complex and hence ...
    (sci.electronics.design)
  • Re: GOTO vis-a-vis professional vs amateur programmers
    ... I trained dozens of programmers who were used to using GOTO all the ... A good programming language looks after a lot of those things. ... the language can protect you only to a certain point. ... You can practice and hone your skill in using the risky tool so ...
    (comp.lang.basic.misc)
  • Re: 7drl starting announcement
    ... I ran a BBS for awhile in the 90s and was known around my area code ... I wasn't very sophisticated myself in the area of programming, though, ... I still use goto sometimes today just to solve little problems that I ... what we consider programming language without sophisticated use of the ...
    (rec.games.roguelike.development)