digitalmars.D - make imports private by default
- Tyro (10/10) Sep 26 2004 I don't know about you guys but IMHO imports should be made private by
- Helmut Leitner (8/21) Sep 26 2004 I agree with you.
- Mike Swieton (7/19) Sep 26 2004 Aggreed, 100%. Always default to the least confusing behavior, don't pul...
- Matthew (2/9) Sep 27 2004
-
Carlos Santander B.
(19/19)
Sep 27 2004
"Tyro"
escribió en el mensaje - Benjamin Herr (4/6) Sep 27 2004 Carlos Santander B. wrote:
- Bent Rasmussen (1/4) Sep 27 2004 Yes consistency, that's what I thought. Kind of like it.
- Tyro (9/16) Sep 27 2004 I agree that consistency is fundamentally important in the language.
- clayasaurus (2/14) Sep 29 2004
- Derek Parnell (15/26) Sep 29 2004 It's hard to think of any overriding counter argument.
- Norbert Nemec (17/29) Oct 19 2004 I can only agree to this.
I don't know about you guys but IMHO imports should be made private by default. On the grand scheme of things this is quite minuscule, however, I think it important to point out that a vast majority of conflicts are caused by the mere fact that imports are done publicly. Most often when I import a library module, I only want it to be made available only in the file into which I imported it. If I need it to be available to users of my code, I should then be required to state so explicitly. Just my opinion. Andrew Edwards
Sep 26 2004
Tyro wrote:I don't know about you guys but IMHO imports should be made private by default. On the grand scheme of things this is quite minuscule, however, I think it important to point out that a vast majority of conflicts are caused by the mere fact that imports are done publicly. Most often when I import a library module, I only want it to be made available only in the file into which I imported it. If I need it to be available to users of my code, I should then be required to state so explicitly. Just my opinion. Andrew EdwardsI agree with you. If it is still possible at this state of development, I would even argue to make imports private by default and add a public keyword for the rare cases where this is needed. -- Helmut Leitner leitner hls.via.at Graz, Austria www.hls-software.com
Sep 26 2004
On Sun, 26 Sep 2004 05:05:19 -0400, Tyro wrote:I don't know about you guys but IMHO imports should be made private by default. On the grand scheme of things this is quite minuscule, however, I think it important to point out that a vast majority of conflicts are caused by the mere fact that imports are done publicly. Most often when I import a library module, I only want it to be made available only in the file into which I imported it. If I need it to be available to users of my code, I should then be required to state so explicitly. Just my opinion. Andrew EdwardsAggreed, 100%. Always default to the least confusing behavior, don't pull in symbols from across the ocean ;) Mike Swieton __ You can tell the ideals of a nation by its advertisements. - Norman Douglas
Sep 26 2004
Agreed "Tyro" <ridimz_at yahoo.dot.com> wrote in message news:cj60p4$4m$1 digitaldaemon.com...I don't know about you guys but IMHO imports should be made private by default. On the grand scheme of things this is quite minuscule, however, I think it important to point out that a vast majority of conflicts are caused by the mere fact that imports are done publicly. Most often when I import a library module, I only want it to be made available only in the file into which I imported it. If I need it to be available to users of my code, I should then be required to state so explicitly. Just my opinion. Andrew Edwards
Sep 27 2004
"Tyro" <ridimz_at yahoo.dot.com> escribió en el mensaje news:cj60p4$4m$1 digitaldaemon.com... |I don't know about you guys but IMHO imports should be made private by | default. On the grand scheme of things this is quite minuscule, however, | I think it important to point out that a vast majority of conflicts are | caused by the mere fact that imports are done publicly. | | Most often when I import a library module, I only want it to be made | available only in the file into which I imported it. If I need it to be | available to users of my code, I should then be required to state so | explicitly. | | Just my opinion. | Andrew Edwards I agree, but I think once Walter spoke of consistency: all things in D are public by default, so making imports private would break consistency. That's what he said, makes sense, although (again) I agree with the proposal. ----------------------- Carlos Santander Bernal
Sep 27 2004
Carlos Santander B. wrote: > I agree, but I think once Walter spoke of consistency: all things in D arepublic by default, so making imports private would break consistency. That's what he said, makes sense, although (again) I agree with the proposal.As do I.
Sep 27 2004
I agree, but I think once Walter spoke of consistency: all things in D are public by default, so making imports private would break consistency. That'sYes consistency, that's what I thought. Kind of like it.
Sep 27 2004
Bent Rasmussen wrote:I agree that consistency is fundamentally important in the language. However, if in keeping the "tradition" one introduces characteristics that are both unintuitive and problematic, then the tradition must be broken in favor of a more sophisticated solution. I would much rather feel somewhat inconsistent (a little less traditional) than having to hunt down bugs caused by importing someone else's library and plastering my code with "private import" when that is what I mean 99% of the time anyway.I agree, but I think once Walter spoke of consistency: all things in D are public by default, so making imports private would break consistency. That'sYes consistency, that's what I thought. Kind of like it.
Sep 27 2004
me too. Tyro wrote:I don't know about you guys but IMHO imports should be made private by default. On the grand scheme of things this is quite minuscule, however, I think it important to point out that a vast majority of conflicts are caused by the mere fact that imports are done publicly. Most often when I import a library module, I only want it to be made available only in the file into which I imported it. If I need it to be available to users of my code, I should then be required to state so explicitly. Just my opinion. Andrew Edwards
Sep 29 2004
On Sun, 26 Sep 2004 05:05:19 -0400, Tyro wrote:I don't know about you guys but IMHO imports should be made private by default. On the grand scheme of things this is quite minuscule, however, I think it important to point out that a vast majority of conflicts are caused by the mere fact that imports are done publicly. Most often when I import a library module, I only want it to be made available only in the file into which I imported it. If I need it to be available to users of my code, I should then be required to state so explicitly. Just my opinion.It's hard to think of any overriding counter argument. The only thing I can come up with so far is that making imports default to private is inconsistent with member declarations, as these are public by default. In the meantime I guess we need to get into the habit of coding thus ... private{ import std.string; import std.stdio; import whatever.etc; } -- Derek Melbourne, Australia 30/09/2004 2:55:29 PM
Sep 29 2004
I can only agree to this. My personal experience from Python, where imports are public: * you get the namespace clogged up extremely fast: Library coders just do from somewhere import * for their own convenience, so anyone using the library has their namespaces filled with stuff they don't need * Very often, you loose track where a symbol actually came from, because symbols can be imported from just about any module and you hardly ever stop to think where the symbol was actually defined. Just my personal experience. It is nice to go for consistency (like: "everything is public by default") but it is much more important to think about the consequences for the programmer, and in this case, it really is a question of protecting the application programmer against the laziness library programmer. Ciao, Nobbi Tyro wrote:I don't know about you guys but IMHO imports should be made private by default. On the grand scheme of things this is quite minuscule, however, I think it important to point out that a vast majority of conflicts are caused by the mere fact that imports are done publicly. Most often when I import a library module, I only want it to be made available only in the file into which I imported it. If I need it to be available to users of my code, I should then be required to state so explicitly. Just my opinion. Andrew Edwards
Oct 19 2004