re: Types and true division (was Re: strange output)

Kirby writes -
I don't find this on-the-face-of-it persuasive, as then any counter-intuitive wrinkle X in any language (any "wart") could be justified as "reminding the newbie to give attention to X".
What I am experiencing - that is, from my point of view - I am trying to talk about something very specific in a very specific way, and mostly, having my point defeated by talking it to absurdium by resorting to generalities about mega-design issues. Perhaps, one of my key points is that nothing can be generalized from this particular specific, nor do I see myself attempting to advocate any generalization that can be made. I honestly don't see one . The old "/" operator is a gotcha if one choses to see it that way. I had told you in a private note some time ago, that I found it a particulary nasty gotcha when raising to a fractional power. From an experiential point of view, that tended to be the only time I would *actually* get caught with my pants down. But I have the ability to foresee where Bruce's and Michael's students are most likely to get caught with *their* pants down, under the new operator. Which are ways even more subtle, IMO, but just as likely to arise as with my raised to a power issue. So, on the gotcha score - at best a wash, IMO. With no generalizations to be made beyond that observation. Art

Oh, OK, twist my arm, one more... At 03:42 PM 10/10/2002 -0400, Art wrote:
The old "/" operator is a gotcha if one choses to see it that way. I had told you in a private note some time ago, that I found it a particulary nasty gotcha when raising to a fractional power. From an experiential point of view, that tended to be the only time I would *actually* get caught with my pants down.
But how much time have you spent trying to read code as elaborate and math-invested as Pygeo's, yet not written by yourself?
But I have the ability to foresee where Bruce's and Michael's students are most likely to get caught with *their* pants down, under the new operator. Which are ways even more subtle, IMO, but just as likely to arise as with my raised to a power issue. So, on the gotcha score - at best a wash, IMO.
(You don't spell out the gotchas with the new behavior -- examples might have been nice.) Again, your model is the of lone coder, trying to get results, wrestling with his or her own confusions and overcoming them. But what about teams of coders writing stuff that future maintainers will need to wrap their heads around? The change in the div operator is what'll make Pygeo easier to grasp when you're no longer around to explain how it works. Commenting helps of course, but a function like def op(a,b,c): return (a/b)+c buried on line 10000, is just going to puzzle a reader (including a pro), if they don't know immediately all the places op is invoked (and why should they), and whether op expects floats, or integers -- and given no explicit declarations, this'll be hard to determine (like, maybe a,b,c are read from some raw data file -- this isn't Kansas a.k.a. the C language, where you'd have int a; int b; float c declared elsewhere, along with the return type of the function itself).
With no generalizations to be made beyond that observation.
Art
It's an observation based on an overly-narrow appreciation for what programming involves, which is *not* just person X overcoming some initial confusions and producing an elaborate, functional program. You need one of those jobs where someone hands you 10000 lines of Python code, with some subtle math-related bugs in it, and asks you to track them down (by tomorrow, latest). These days, I'm struggling with some Visual FoxPro thing (Xbase) written by an amateur coder with a day job as a plumber. He's since moved to Colorado (I'm changing some of the facts, to protect the guilty). My client uses this program all day for mission critical stuff. There's no time to start over, so I have to gradually puzzle through all this stuff, a lot of which is written in quirky ways because he didn't really know Xbase all that well. A test of Xbase's power and long term viability is how well it holds up (in terms of readability, comprehensibility) in circumstances like these. If I have doubts about APL and J (REBOL?), it's in this area also: are these "write once, read never" languages? -- I haven't learned J well enough to know if easy fluency around *other peoples code* (not just mine) is trully attainable (presumably it is, but it takes more than a year to get there). Kirby

Again, your model is the of lone coder, trying to get results, wrestling with his or her own confusions and overcoming them.
But what about teams of coders writing stuff that future maintainers will need to wrap their heads around?
As a lone programmer myself, I appreciate that. So recently I have been gently inspired by some good lessons from the Extreme folks: http://www.extremeprogramming.org/rules.html Especially working alone, I find just __thinking__ about their approach has given me fresh insight. Daily results and testing are something a loner person can do. It's encouraging. If Extreme Programming is really just a banner for applying continuous and extreme common sense, then I figure we can all do with some of that. Python already has lots and especially when it comes to teamwork [readability]. I am beginning to suspect that many of the 'newbie/novice' issues raised here are indeed symptomatic of 'lone-ly programmers'. Of course, I don't mean simply people programming on their own, but rather the lack of development feedback which comes with concerted team effort. The shining lights of openSource... ./Jason
participants (3)
-
Arthur
-
Jason Cunliffe
-
Kirby Urner