Re: How do *you* use arrays?

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: david epsom dot com dot au (david_at_epsomdotcomdotau)
Date: 02/19/04


Date: Fri, 20 Feb 2004 09:10:59 +1100

I am a professional developer, and I was a professional teacher
teaching electronics. Both as a teacher and as a developer I
try to be aware of different ways of handling ideas. I am also,
for my sins, deeply conservative, and was never very good at
those 'thinking outside the box' exercises. In compensation,
I've always been good at knowing more about the different ways
of handling the same problem: I think a good conservative knows
the solution domain and is not wedded to a small part of it.

I would ALWAYS consider leaving things out of an introductory
course, and I would ALWAYS consider alternatives to the
pervasive explanations and nomenclature, and I would ALWAYS
consider the use of both generalisations and specific examples.

I personally visualise memory as a picture, so linguistic
representations don't help me with the underlying concept
of memory layout. And if you've ever had a colleague who
thought in kinetic terms (eg dance) you will understand
that you have to offer a range of different representations
when teaching, and you shouldn't consider any representation
as 'fundamental' when you are designing a course of
instruction.

Designing a course of instruction is similar to designing a
program in this way: you can choose different fundamental
design elements, and after you have chosen them they force
the direction of the rest of the development, but the devil
is in the details, and sometimes it is a good idea to spend
some time considering what affect your fundamental design
choices are going to have on the ultimate outcome...

(david)

PS Regarding strings: in a von Neumann architecture, everything
is a string (including arrays), modern hardware implements
that on row/column memory, translated by the chipset to grouped
random access, virtualised by the operating system as linear
address, virtualised by the programming language as types,
virtualised by the program as representational objects. At
what level is the 'array' syntax and keyword fundamental?

"Bryan Reich [MSFT]" <brreich@online.microsoft.com> wrote in message
news:OYZVeFo9DHA.2472@TK2MSFTNGP10.phx.gbl...
> Am I the only professional developer cringing at the thought of leaving
out
> the fundamental concept of arrays in a GENERALIZED and BASIC programming
> course? It is fairly accurate to say that arrays don't have to be used
much
> in a scripting environment like VBA, but the concept of an array is so
> pervasive throughout programming, both in practice and in understanding
the
> underlying concepts of memory layout and such, that I would NEVER suggest
> leaving it out of an introductory course. Besides, what if they have to
turn
> around and program in C# or *gasp* C or C++ and all of a sudden have to,
at
> the very least, deal with the command line argument array in main? If your
> goal is to prepare these students for possible future programming in
> undertermined languages in undetermined applications, I would strongly
> advise not brushing off array concepts. I mean, look at strings! They are
> really arrays and the string access symantics are often the same at least
> conceptually if not actually, particularly when used in commercial
> applications where performance becomes an issue.
> Anyway, I'm sure I'm coming from a different world with the kind of coding
I
> do, but trust me that the code I wade through every day here at work uses
> arrays in one form or another handily. :)
> --
> Bryan Reich
> Microsoft Office
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> Use of any included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
>
>
> "Albert D. Kallal" <pleasenonosspammkallal@msn.com> wrote in message
> news:hxMYb.550856$X%5.86011@pd7tw2no...
> > Here is some code from ms-access that I used for analyzing and playing
> black
> > jack:
> >
> > Type OneHand
> > FirstCard As Integer
> > SecondCard As Integer
> > AceCount As Integer
> > BlackJack As Integer
> > bet As Integer
> > HandTotal As Integer
> > TotalBet As Single
> > End Type
> >
> > Public Players(7) As OneHand ' the 7 players
> > Public Dealer As OneHand ' the dealer
> > Dim SplitsHands(14) As OneHand
> > Dim SplitPtr As Integer
> > Dim BlankHand As OneHand ' used to "zero" a hand
> >
> > Dim Deck(208) As Integer ' our 4 decks
> >
> > You can see how usefull The above arrays are.
> >
> > With the above, the code to deal out cards is:
> >
> > 'Give One card to the 7 spots, and setup the player bet
> >
> > For Spotptr = 1 To 7
> > Players(Spotptr) = BlankHand 'zero his info & set bet
> > Players(Spotptr).FirstCard = NextCard(Players(Spotptr))
> > Players(Spotptr).bet = BlankHand.bet
> > AmountBet = AmountBet + BlankHand.bet ' running total of amounts
bet
> > Next Spotptr
> >
> >
> > --
> > Albert D. Kallal (MVP)
> > Edmonton, Alberta Canada
> > pleasenonoSpamKallal@msn.com
> > http://www.attcanada.net/~kallal.msn
> >
> >
>
>



Relevant Pages

  • Re: How do *you* use arrays?
    ... I too am quite conservative David, but it seems my conservitism manifests ... The fact is, as you mentioned, all computing is based on arrays at some ... > Designing a course of instruction is similar to designing a ... >> the fundamental concept of arrays in a GENERALIZED and BASIC programming ...
    (microsoft.public.access.modulesdaovba)
  • Re: newbie: capabilities of c++ in numerical computation
    ... >>1) Does object oriented programming introduce significant overhead as ... I personnaly think that arrays of doubles are better at low ... fortran or c library routines from your code. ... >>calling fftwlibraries? ...
    (comp.lang.cpp)
  • Re: Overloaded Methods called with null
    ... The rules are not for general programming, per se, but ... NullPointerExceptions are obtuse to the Java newbie, I agree, but the ... Using Lists instead of arrays and initializing arrays with ...
    (comp.lang.java.programmer)
  • Re: Structured Coding
    ... concepts (such as arrays and strings). ... I only have my own "learning" experience to base my ... Programming C# assumes some experience with a related language ...
    (comp.lang.cobol)
  • Re: 2D array of pointers
    ... | use of built-in arrays and vectors is probably slanted more toward arrays ... gets is a bit easier to discard from your programming ... I'm glad I didn't offend you. ...
    (alt.comp.lang.learn.c-cpp)