From: Doug H. <dho...@ta...> - 2006-07-28 13:05:34
|
Hi Mike, On Jul 27, 2006, at 8:04 PM, Mike Hore wrote: > Hi Doug, > >> What has always puzzled me are the strong objections to locals from >> people like Elizabeth Rather. I *think* she is saying that locals >> somehow prevent or impede good factoring. But I have never >> understood why. Nor have I seen a clear explanation why. >> Meanwhile I use locals where it helps. I am not against stack >> manipulation. But I prefer to keep it simple. A few DUPs or SWAPs >> are often just right. But when I start seeing ROTs and stack items >> carried through loops and so forth I get nervous. > > Me too. It's too easy for bugs to creep in, if not when first > writing the code, then later when I'm modifying it. I first learned > to program on an English Electric KDF9, which as I'm sure you all > know ;-) was a stack machine. Writing assembler on the KDF9 was > very like simple Forth with no locals. And I was always tying myself > in knots with stack juggling, and most of my bugs were related to > this. I now use locals a lot, and only rarely get confused by the > stack. So like you I don't see the objection. OK. Now I don't feel so bad. I thought perhaps I was missing some subtle nuance. Apparently not. ;-) > I might have said > these objectors just wanted to stick to what they were used to, but > surely that would have applied to me just as much. Maybe more, since > I was stack programming before any of them! I think only Chuck Moore > goes back as far as I do with stack programming, since he started on > a Burroughs 5500, which was around the same era as the KDF9. I assume your formal education is in computer science. Mine is in mechanical engineering. We had to learn a version of Fortran. Anything I know about computing beyond that, which isn't much, is self-taught. RPN pocket calculators (Hewlett-Packard) had just appeared in my second year of college. Most of the students bought one, me included. That was my first exposure to a stack of any kind. So when I started in with Forth I had a decent idea of concept of the stack. Regards, -Doug |