Re: Structured Coding




"Frank Swarbrick" <Frank.Swarbrick@xxxxxxxxxxxxxx> wrote in message
news:4543mdF4run2U1@xxxxxxxxxxxxxxxxx
Michael Wojcik<mwojcik@xxxxxxxxxxx> 02/10/06 7:23 AM >>>
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?

Sorry, I was referring to C# the language, not the book that I am using to
learn it.

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).

The book I am reading is _Programming C#_ (by Jesse Liberty) (hmm, looks
like I should have got it from amazon.com and saved myself $15.00...). I
like the book less than I like the language. It seems like some more
advanced concepts (such as classes, etc.) are addressed earlier than
simpler
concepts (such as arrays and strings). Or maybe he just has a different
opinion on what is advanced and what is not. Still, I'm finding it fairly
useful. Not for a beginning programmer, though. And it sounds like
_Learning C#_ is not either. Not that I need that, but I'd be curious as
to
what book a non-programmer might pick up to learn C# as a first language.
Or perhaps C# simply is not a "first language" at all? I'm personally not
convinced that any OOP language would be a good first language to learn.
But, then, it's hard to erase all these years of procedural programming
and
picture what it would have been like to learn an OO language first. Is
there anyone out there who learned, say, Java first and then COBOL (or C,
or
some other procedural non-OO language)?

It is amazing the diversity of ways in which people learn. (I did an adult
teaching course last year - that's a course for teaching adults - and was
very fascinated by the perceptual and psychological interactions that occur
when we learn something. There is no "one size fits all". Some people are
more visual, some are more conceptual, some are more language oriented. All
of us are different, and a good teacher will include material in his course
that appeals to all types.

Unlike you, Frank, I AM convinced that OO is a good way to learn programming
as a first language. (That doesn't mean I think you are "wrong" - your
statement is certainly true for many people.)

I had major problems struggling with OO COBOL when it was first released. I
spent three months trying to get my head around the new concepts and
suffered from exactly what you outlined above - a lifetime of procedural
COBOL.

In the end, in despair, I thought: "Fuck it. Maybe I'll just learn Java..."
So I invested in a couple of Java books (the best was "Java 2 in 24 Hours"
by Rogers Cadenhead - possibly one of the best books on learning a
programming language ever written; light hearted, witty, amusing,
entertaining, and VERY useful), and tried to clear my mind of everything I
knew and approach it as something not seen before, without making judgements
based on other experience. Within 3 days I was hooked. It was so obvious.
Simple, elegant, and fun. By the time I had my first Java programs and
applets running, my mind was racing ahead exploring the implications of
this new freedom. I went back to OO COBOL and saw it in a new light. The
concepts I had previously struggled with were now an open book and
everything fell into place. I started writing components...

Later I had to run some courses in Java Web programming (servlets) and
JavaScript (for client). I found the "computer programmers (COBOL)" had the
hardest time and were the last to pick it up. The people who had never
programmed in their life took to it like ducks to water.

I think that once we become competent in COBOL (for instance) it is very
easy to believe that is THE way to do things. To succeed with OO you should
clear your mind, or at least agree with yourself to suspend criticism or
evaluation until you have written some samples and got them working. And
learn OO by means of a language that was OO from its inception, designed to
be OO, not having had a bolt on of Object handling to make it "socially
acceptable", even if (as in the case of COBOL) that bolt on is superbly and
cleverly engineered.

I recommend Java because it meets those criteria.

(It's interesting to note that the Wikipedia [yes, I love Wikipedia] page
for Procedural programming refers to C++, C#, Delphi, etc. as being
procedural languages, even though they are also OO languages. I guess
once
could certainly limit themselves to procedural programming only in those
languages, but I can't imagine anyone doing so.)

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++.

It seems to me that it's rather difficult to have a language that is both
small enough to not be overwhelming to learn, yet large enough to be quite
powerful. Still looking...

That is very true. If you consider all the available classes as "part of the
language" (and you certainly have to at least read through a list to know
what is available, even if you don't memorise every class by heart), it is a
lot to learn.


<snip>

Pete.


.



Relevant Pages

  • Re: Wang COBOL alive and well as Wang VS makes a comeback
    ... I fought to the last to keep COBOL at least peripherally in the ... will be the next language du jour... ... This contributes to the stability of programming efforts ... level of COBOL to another can be as big a deal as migrating across platforms ...
    (comp.lang.cobol)
  • Re: Hobby languages
    ... Because 100 out of 100 Java "programmers" have no idea what the ... English with someone whose native language is Swahili, ... of programming and requiring bloated resources. ... COBOL IS commonly found on the PCs of people who are interested in COBOL. ...
    (comp.lang.cobol)
  • Re: 7E7 Flight Controls Electronics
    ... was just good thing that that localization was not too easy - it would ... Please don't confuse abstraction skills of typical COBOL programmer (that ... I pointed at the current programming "biblioware" for commercial data ... > language was because I learned all the workarounds. ...
    (comp.lang.ada)
  • Re: Structured Coding
    ... more visual, some are more conceptual, some are more language oriented. ... I had major problems struggling with OO COBOL when it was first released. ... programming language ever written; light hearted, witty, amusing, ... Later I had to run some courses in Java Web programming and ...
    (comp.lang.cobol)
  • Re: New Cobol compiler written in Cobol
    ... It didn't have a visible operating system. ... > If I were writing a Cobol compiler, I wouldn't look at today's market. ... > What will a programming language need to be successful in that world? ... They'll use a language they can understand at a glance. ...
    (comp.lang.cobol)