From: James M. <mu...@pi...> - 2010-09-15 23:42:38
|
> * For newbie's convenience, provide a "physicists make happy" package that > does the wild card imports all across the board. > (Even though I'm of the opinion that this dirty short cut creates more > head scratching in the future than it helps up front ...) Guy, I have to admit that I am a bit offended by the "physicist make happy" comments. What is being referred to here are in general NOT physicists. Bruce's target audience is College Freshmen, (mainly future engineers), who have never taken any programing course. Bruce wants to allow them to investigate their course material visually, and uses the python environment to do that. The concept of namespace is lost on them. I know, as I am teaching some of them right now. In their "computing for freshman engineers" course, they are currently learning excel. Next term they plan to teach them Matlab. They don't know variables; they don't know for or while loops; they don't know physics; THEY DON'T KNOW ANYTHING! So don't call them physicists. Other than that, I agree with everything you said. What I would like to see is something like matplotlib where they cleaned up the code but kept the pylab module to preserve functionality. People who know what they are doing, might do import numpy as np import matplotlib.pyplot as plt import scipy etc. but one can also just do import pylab which ends up importing all sorts of things into the pylab namespace (I am not sure how much). And again most people continue to use it as from pylab import * We can cringe, and tell them not to do it, but it was important that the option was preserved. The matplotlib people provide the option but also provide ways to do things properly. I see the same thing in this case. If the code could be rearranged to have proper granularity and allow people to use namspaces properly, that would be great! WE do not need to use the "visual" name for that. Then "visual" can just be something that imports everything to reproduce the current visual namespace. We don't need to care as we can use the "correct" imports, as long as they exist and are documented. From Bruce's mail, it seems like the option is there to separate the namespaces. whether this is the correct separation, I don't know, but seeing all the things visual currently loads into one namespace is great. I can start to use things properly. Most of my students will still "from visual import *", but I have something to tell those who do know a little programming. As always, the devil is in the details, but I think this thread will continue. -Jim |