more about the using statement

S

Scott M.

Actually, what I stated was an opinion and I stated as much. I don't need
to provide any facts or supporting evidence when stating an opinion.

If you are really going to say that anytime two parties have conflicting
viewpoints, they are in an agument, then there is really no point to any
further discussion on this point, since I believe that that viewpoint is
absolutely absurd.

Good day.
 
P

Peter Duniho

Actually, what I stated was an opinion and I stated as much.

Actually, you didn't really state much of anything in an explicit way.
Jon made a perfectly reasonable statement about a philosophy for choosing
the type for a variable declaration, and you wrote a question that implied
(but did not say directly) that you disagreed with it.
I don't need
to provide any facts or supporting evidence when stating an opinion.

Absolutely true. I cannot disagree with that. That does not stop anyone
from asking if you have a _good reason_ for your opinion, or from you
explaining your reason, good or otherwise, for having formed that opinion.

Now, if you fail to state a good reason for your opinion, most people will
rightly decide your opinion is flawed. You have every right to continue
to hold it, but that doesn't make it any less flawed.
If you are really going to say that anytime two parties have conflicting
viewpoints, they are in an agument, then there is really no point to any
further discussion on this point, since I believe that that viewpoint is
absolutely absurd.

You might try looking the word "argument" up in a dictionary some time.
It seems likely that what you'll read will surprise you. In any case,
since this discussion hinges not on the definition of "argument", but
rather on the question of choosing a type for a variable declaration, I
think it's pretty stupid to abandon the discussion based on a disagreement
about the former. How is that at all relevant?
Good day.

Certainly it has been for me. Thanks for caring.

Pete
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,



Nothing wrong with the code...

good use of the using statement - I always try to use the using
statement on any object which implements IDispose - but surely the
StringBuilder object should be employed instead of the string
concatination within a loop!!

My bad, I did not notice it :)
 
H

Hilton

Tony said:
Hello!

I just wonder what is the point of having the reader variable declared as
TextReader in the snippet below..
Is it because of using the polymorfism on the reader variable perhaps.

using (TextReader reader = new StreamReader(fullPathname))
{
string line;
while ((line = reader.ReadLine()) != null)
{
source.Text += line + "\n";
}
}

Have you tried:

using (TextReader reader = new StreamReader(fullPathname))
{
source.Text = reader.ReadToEnd();
}

Hilton
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top