MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: snippets

  • To: mathgroup at smc.vnet.net
  • Subject: [mg89725] Re: [mg89708] Re: snippets
  • From: Murray Eisenberg <murray at math.umass.edu>
  • Date: Thu, 19 Jun 2008 05:42:06 -0400 (EDT)
  • Organization: Mathematics & Statistics, Univ. of Mass./Amherst
  • References: <g1o8fd$hd4$1@smc.vnet.net> <200806110716.DAA14875@smc.vnet.net> <g2qhe2$8kr$1@smc.vnet.net> <200806181041.GAA00161@smc.vnet.net>
  • Reply-to: murray at math.umass.edu

I certainly have no objection to teaching newcomers procedural coding, 
too.  I just have a prejudice against teaching it first or early.

My experience over quite a few years teaching first APL and now 
Mathematica to undergraduates (and some faculty) who have backgrounds in 
C, FORTRAN, Pascal, Java, etc., is that it is very difficult to 
eradicate the "bad" habit of thinking first of totally unnecessary, 
inexpressive, sometimes obscure (and often inefficient) explicit 
looping.  And that making the connection with their prior experience -- 
showing them how to do essentially the same thing in Mathematica -- does 
nothing to wean them away from that and towards functional or 
array-based coding.

David Bailey wrote:
> Murray Eisenberg wrote:
>> That's a useful tutorial on your blog. Of course the palette shown 
>> reflects your own interests and needs.
>>
>> But the title "Newbie.nb" for this palette jarred when I saw the For 
>> expression on one of the buttons.  In general, it's a bad idea to look 
>> right away to For in order to do iteration.  I recommend that "newbies" 
>> not even be told about For until all other, more reasonable constructs 
>> -- Table, Sum, f@@expr, f/expr, Nest, etc. -- be tried first for fit to 
>> the problem.
>>
>> In short, when in Mathematica-land, code in the best 
>> "Mathematica-speak", not in FORTRAN-speak, C-speak, etc.
>>
>> bobeuland at gmail.com wrote:
>>> Since nobody answered my question I had to do some digging myself. The
>>> best approach I found was to make a custom palette for my snippets.
>>> You can see how I've done it at
>>>
>>> http://bobueland.com/2008/06/10/how-to-create-a-palette/
>>>
> Murray,
> 
> Can I suggest that people should be taught BOTH procedural and 
> functional code. This is because procedural code can be very useful for 
> messy problems - where the arrays are not going to be processed in a 
> nice uniform way. Sure, there will probably be a functional equivalent, 
> but it may be quite hard to formulate.
> 
> Procedural code also provides a comforting link with C and Fortran 
> programming experience - a bit like learning to ice skate by holding on 
> to the barrier!
> 
> David Bailey
> http://www.dbaileyconsultancy.co.uk
> 

-- 
Murray Eisenberg                     murray at math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305


  • Prev by Date: Re: Combining pure functions to produce a new pure function
  • Next by Date: Re: Making nice-looking Legend for Plot
  • Previous by thread: Re: snippets
  • Next by thread: Re: Re: snippets