From: Daniel J S. <dan...@ie...> - 2004-07-10 04:20:16
|
Hans-Bernhard Broeker wrote: >On Fri, 9 Jul 2004, Ethan Merritt wrote: > > > >>#ifdef EAM_HISTOGRAMS >> /* EAM FIXME - There are places in df_readline where it would be really */ >> /* nice to know what kind of plot we are making, so I think that */ >> /* current_plot should be a parameter to df_readline. >> >> > >I strictly disagree with that reasoning. If df_readline needs to know >what the the plot style is, then IMHO that's a sign that there's something >seriously wrong with df_readline(). > >It's separations like this being broken down or "tunnelled", tieing every >piece of the program to all others, that got gnuplot into the mess it's >still in. > >Bluntly put, adding a global variable is essentially never the right >solution for any problem other than stack size limitations. > >Instead of designing a correct structure of "who is responsible for what", >creating a global means that we've given up. In the case at hand, >df_readline is the core interface between the datafile itself and the next >stage in data processing: the 'using' specifiers. It should never need to >know anything about plot styles, which are at least two steps removed from >its work. > Well, global variables is certainly not good. The issue is that df_readline() has a number of "local" variables that must be configured by "df_open", e.g., what quantities to put into what variable. The question is, should the user have to specify every detail about that, *or* should there be some defaults, i.e., the logical extension to 3 space, for example. If you think the latter is good, then there is some information about the plotting style required. Dan |