Here's where you guys can voice your opinions...but at least back them up!

I have a couple simple classes to input and output a string in the same
format as MFC.  (Have to do it to be backward compatible with the existing
MFC application.)  The base layout for the class is as follows:

public class MFCStringReader : BinaryReader
{
  public MFCStringReader(Stream s) : base(s) {}

  public String ReadCString()
  {
    <processing code here>
  }

There are many instances in which I only need to read one string.  How would
you write it?

  value = new MFCStringReader(sr).ReadCString();

or

  value = (new MFCStringReader(sr)).ReadCString();

The first is a bit cleaner, but the second makes it clearer as to what is
being returned.  Comments!

...Glenn

Reply via email to