last day (15 days later) » 

11:19 PM
0
Q: Why are using directives necessary?

MoopWhy are using directives necessary in C# source files? I know they have their uses Aliases Preventing name clashes Intellisense But why are you specifically required to have a using directive for even simple programs with none of those aforementioned reasons required? Suppose you have a C# p...

 
It's not time consuming unless you have to do it for every identifier that's not a language keyword, and the IDE provides intellisensing that allows you to add the using statement automatically anyway.
 
@EricJ. But why would I even have to fully qualify every type in such a simple example?
 
As the programmer having to read your code after you write it, I would personally find the absence of using statements a bit infuriating... You're too lazy to declare where your identifiers are originating?
 
@EricJ. But I only have System.dll referenced. No third parties libaries. If I added a third party reference that contained a StreamReader then it makes sense that I would have to add a using directive.
@RobertHarvey Why did you mark it as opinion-based when there isn't a single answer to the question? The question isn't opinion-based. Now we may never know what the possible answers are and if they are opinion-based in general since you put the question on hold.
 
We don't evaluate questions for closure based on the answers they receive (or don't receive).
 
11:19 PM
@RobertHarvey Then how did you evaluated this question? It hasn't been asked before, it could easily have a good answer to it that I overlooked, I show an example, I show some initial effort in purposing possible usages, it is well formatted, etc.
 
In the absence of some expert from Microsoft stumbling across your question, any answer would be merely speculation, and speculating on the motives of the Microsoft Team isn't really within this site's scope.
 
@RobertHarvey Your all time best upvoted question that you asked is "Why are C# interface methods not declared abstract or virtual?" so I assuming it is within this site's scope to ask questions about the C# design/implementation
 
I also provided some IL to indicate that the methods actually are virtual under the hood. It's not just an opinion; it's a deliberate misrepresentation of the underlying order.
 
@RobertHarvey Besides you changing your reasoning on why your closed this, according to this link stackoverflow.com/help/dont-ask this particular question seems to a good fit for the bottom 6 bullet points.
 
It still has to be on-topic. You can't cherry-pick verbiage out of the Help Center as justification that your question should stay open.
 
11:19 PM
how is this off-topic?
and the burden of proof lies with you for closing it
not on me for asking a question
 
I don't have to prove anything. You have to prove that the question is interesting enough to attract 4 reopen votes.
 
what? that isn't how this site works
you don't need permission/votes to ask questions
 
The answer is obvious anyway. Java has these kinds of directives, and so do several other languages. The predecessor languages C and C++ have had specific header declarations forever. Having the compiler search for these things would be fairly counter-intuitive, and not really needed, since you're courteous enough to tell us where your declarations are coming from, right?
 
how is that obvious?
and if so, post it as an answer
 
Already did.
Well, not as an answer.
 
11:27 PM
thank you for reopening it
and i recorded all these messages
 
C'mon. How is this question doing anything except satisfy your own personal curiosity? If it starts getting upvotes, I'll eat crow, but let's face it: the question just isn't all that interesting.
 
but that isn't for you to decide what is interesting
 
should i close all PHP questions because I don't find PHP interesting?
 
Those are actual programming problems. This isn't.
 
11:28 PM
Yes it is
you program (type) using directives all the time
 
Really. You can't get something done because the compiler is forcing you to declare your name spaces?
 
you cannot get something done because C# interface methods are not declared abstract or virtual?
i am reporting this as mod abuse
 
Oh, good. Send your correspondence to support@stackexchange.com. Tell them I said hi.
Have a wonderful day. [click]
 
you mean teams@stackexchange.com
how is that appropriate Mod behavior? Belittling the users of the site they are using?
 

last day (15 days later) »