[ale] I've decided again to learn programming again

Byron Jeff byronjeff at mail.clayton.edu
Fri Oct 14 15:42:55 EDT 2011


On Fri, Oct 14, 2011 at 02:16:53PM -0400, Scott Castaline wrote:
> On 10/14/2011 10:59 AM, Byron Jeff wrote:
> > On Fri, Oct 14, 2011 at 06:42:11AM -0400, Ron Frazier wrote:
> >> Hello all,
> >>
> >> Those of you that have read some of my prior posts know I've been
> >> threatening for some time to relearn programming after 16 years out of
> >> the loop.  I discussed it here before, and we had discussions about the
> >> various merits, or unmerits of different languages.  I really was
> >> planning to learn C++, after you guys convinced me to not target C#.  I
> >> have, sitting next to me, some of the best C++ textbooks out there,
> >> including one by the inventor of C++.  The problem is, no disrespect to
> >> the authors, that these things are BORING, and intimidating.  I mean, I
> >> have to go through 400 pages of for next loops, if then's, and variable
> >> setting, etc. to even get to putting a GUI hello world program on the
> >> screen.  And, that's IF they even discuss GUI programming.  Now, I know
> >> you have to learn the basics, and I know these things are foundational,
> >> but I think this is the least enticing way to teach it.

> > The real problem is that there is a functional disconnect between
> > foundational programming concepts and GUI programming. GUIs are event
> > driven creatures that rarely have a linear flow. We run into this problem
> > all the time teaching introductory programming and invariably end up right
> > back at linear console programming to teach basic concepts. It's difficult
> > to branch out to non-linear event driven programming without a clear
> > understanding of basic programming concents.

> That was my problem in the late 80's early 90's ( I maybe off a couple 
> of years), I was making an attempt to "relearn programming". Prior to 
> that I had done school projects in the mid to late 70's Cobol, and 
> Assembler (6800, Harris, and there was another machine in there 
> somewhere). My attempts to relearn hit a major roadblock when I tried 
> "Event Driven Code", to me it was another term for Spaghetti Code. My 
> gray matter turned into something worse than Spaghetti Junction and I 
> gave up.

There are two or three other possible approaches that can be done instead
of the typical callback approach (which completely delinearizes the code):

1. Popups a la the dialog/Xdialog model. You have graphical screens that
delivers back one item at a time. Somewhat limiting but keeps things in a
linear code flow mode.

2. The HTML form approach where the user completely fills out a complete
screen of data, then the entire screen is delivered to the program. Then
the programmer can pick apart the data a chunk at a time.

3. An explicit event loop. Instead of callbacks, ask for the next event.
Then use a multibranch IF statement to process each different type of
event. It's slow going, and the loop can grow to be large and complex.
However, it does keep things in a straight line.

It's kind of tough going from a linear programming model to one where
functions are automagically called when the user presses a button. But
teaching it to begin with is even worse.

BAJ

[Snipped the rest]
-- 
Byron A. Jeff
Department Chair: IT/CS/CNET
College of Information and Mathematical Sciences
Clayton State University
http://cims.clayton.edu/bjeff


More information about the Ale mailing list