RE: Questions/Comments on Media Stream Recording

Adam,
  It's just a quibble about style.  When I used to program in C++, I was taught never to write code like:

   // or if you have a reference to the recorder you
   // can access it directly
   recStream = recorder.stream;

The idea was that accessing instance variables directly broke encapsulation, and that it was better to always use an accessor function:
    recStream = recorder.getStream()

So my question is whether we should add an accessor function like getStream() so that programmers do not have to access the .stream instance variable directly.  It's just a quibble (and I get the sense that such style questions aren't very important in the  JavaScript world.)

- Jim

-----Original Message-----
From: Adam Bergkvist [mailto:adam.bergkvist@ericsson.com] 
Sent: Friday, May 24, 2013 7:58 AM
To: Jim Barnett
Cc: Frederick.Hirsch@nokia.com; mandyam@quicinc.com; public-media-capture@w3.org
Subject: Re: Questions/Comments on Media Stream Recording

On 2013-05-23 15:10, Jim Barnett wrote:
> Adam,
> Yes, this is true.  However in some circles/languages it is considered 
> very bad style to access instance variables directly (particularly for 
> code outside the class).  Do we share this view?

I'm not sure I'm following. Do you mean it's bad style to access the stream from the recorder? Could you elaborate?

/Adam

Received on Friday, 24 May 2013 13:04:32 UTC