Re: Structured Coding



Pete Dashwood<dashwood@xxxxxxxxxxxxxx> 02/10/06 6:37 PM >>>

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.

Actually, I only said that because I don't know anyone who learned OO first,
so I had no data that would allow me to state that OO programming languages
are good first languages to learn. But you appear to have experience with
other people, if not yourself, learning an OO language first, and finding it
"simple" (well, as simple as any programming paradigm might be), so you can
state that, and I can as well if I use you as a reference <g>.

Anyway, don't take my message as saying that I am not a fan of OO. I am
definitely a fan. I am constantly going crazy using procedural COBOL
because I know that so many of the things I have to do could be done so much
simpler with an OO language. All I was getting at, and you apparently
agree, is that in order to learn OO you have to leave a lot of your
procedural thinking behind. It's often hard.

I have a general question... With COBOL, if you add a new field to a group
that is passed between programs (program to sub-program, etc) you pretty
much have to recompile any programs that use that group in order for things
to not break. You don't have to do that with Java because the "group" is a
class, essentially, and when you instantiate the class it creates the new
object based on the current version of the class -- basically the class
itself has control over it's own instantiation. As long as the
instantiating class does not attempt to access class variables directly then
it doesn't matter if the changed class is larger, smaller, has variables
moved around in memory, etc.

So the question, is, can this type of behavior be somehow simulated in a
procedural (non-OO) language? Seems to me not very easily. Perhaps you
could get your procedural code to "act" as if it's OO, but I'm sure that
wouldn't be worth it.

Sorry if that question didn't really make sense. I'm having a hard time
phrasing it. Anyway...

Frank


---
Frank Swarbrick
Senior Developer/Analyst - Mainframe Applications
FirstBank Data Corporation - Lakewood, CO USA
.



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: Original Macbook OS died. now no space on HD but also no way to rebuild?
    ... It is very easy to learn to write a program using .net or java. ... learning any language takes longer than a paragraph. ... programming environment is much easier to learn compared to modern ... could compile Java at all. ...
    (uk.comp.sys.mac)
  • Re: Static vs Dynamic
    ... (Java has too much noise in its source code, ... lot to ask and is typical in a typed language supporting polymorphism. ... > developers can easily learn the Java programming language; ... > obivous bugs slip through and b) in many cases, ...
    (comp.lang.lisp)
  • Re: Java compatibility issues (WAS: MF having issues?)
    ... language it can do most of what C, C++, and Java can do. ... 2002 COBOL standard addresses that, but having a standard is a far ... Some flavours do have libraries. ... On the IBM mainframe we have Language Environment but it does ...
    (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)