Path: news.mathworks.com!not-for-mail
From: "John D'Errico" <woodchips@rochester.rr.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: idea for file exchange
Date: Sat, 14 Jul 2007 12:12:34 +0000 (UTC)
Organization: John D'Errico (1-3LEW5R)
Lines: 17
Message-ID: <f7aeji$lr7$1@fred.mathworks.com>
References: <ef5b4bd.-1@webcrossing.raydaftYaTP> <ef5b4bd.2@webcrossing.raydaftYaTP> <ef5b4bd.4@webcrossing.raydaftYaTP> <f76o2k$dt1$1@fred.mathworks.com> <f7ac2b$9t1$1@fred.mathworks.com>
Reply-To: "John D'Errico" <woodchips@rochester.rr.com>
NNTP-Posting-Host: webapp-00-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1184415154 22375 172.30.248.35 (14 Jul 2007 12:12:34 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 14 Jul 2007 12:12:34 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader eê64(-¸†
Xref: news.mathworks.com comp.soft-sys.matlab:419066


Let me expand on my last response.

The file exchange is a place to obtain high quality software that extends Matlab. It is also a place to learn programming patterns. But things learned early in your career are not always easy to unlearn.

Students who start out in their Matlab careers writing (to put it bluntly) crap, will continue to do so, when they start on their thesis, or go into the workforce. I learned to write Fortran, mentored by a writer of pure, unmitigated crap. So this is the style I wrote in. For example:

One of my first mentors at Eastman Kodak wrote pure spaghetti code. He only had one program. He just used it for everything. He once balanced his checkbook by adding a branch at the beginning of the code to a routine at the end of this 2000 line box of cards. He then read in, and compiled all 2000 lines of code, just so he could add up some numbers. All this to avoid copying a few JCL cards at the beginning of the deck. This same fellow had a tendency to use uninteresting variable names. For example: i, ii iii, j, jj , jjj, iij, etc.

The first example I ever saw of a least squares spline code was some  hundreds of lines of almost totally uncommented fortran crapola. I say almost uncommented, because in the entire file, there was ONE comment. It was:

"build c matrix here"

Then the author proceeded to build a matrix with the name "c".

Yes. This is how I learned to write code. I then spent the next 30 years unlearning those patterns, by seeing what others wrote that I liked, by seeing what I liked in my own codes as I tried out different styles, by seeing what it was like to come back to a piece of code I'd written years ago and trying to debug it. Its something I still am learning. I'd like to make that learning process faster for others than it was for me. And, it is easier to learn something once than it is to unlearn and learn anew.

John