Is there any reason (laziness aside) to declare instance variables public?

Why would you declare one public, save for the fact that object.field is quicker to type than object.getField()? It is a pain to have to write get/set methods for private variables, but later on, if you ever need to do something with a variable when it's been accessed or modified, it's much easier to go back and edit just those methods, instead of everywhere the variable's been directly accessed. On the other hand, I see no benefit of declaring a variable public. Is there one?

Never, Never, Never !!!That's a tad extreme.
In most cases, you'll want get and set, and even then you need to examine whether you really want another class to have that direct control over your object's state.
But there are cases where you can make your instance variables public. If it's a pure data container, with no behavior, and you don't expect it to ever be used in a multithreaded context or to be used as a JavaBean, then you can make the instance variables public.

Similar Messages

  • Is there any reason I shouldn't work this way?

    Given the lack of batch capture in FCE is there any reason why I shouldn't work in the following way:
    1. Import video in large chunks using capture now
    2. Use DV start stop and Make sub-clip
    3. Export just the sub-clips I want as self-contained movies
    4. Close the project and delete the original capture files and the FCE project file
    5. Start a new project and import the movies I saved in step 3.
    My reasons for wanting to do this are mainly to save disc space but also to reduce clutter in the bins. So far as I can see this works fine. The only downsides I can see are:
    1. The extra time it takes but this is offset against the chore of capturing individual clips instead of using capture now.
    2. The fact that reimported clips have their audio tracks set to mono mix but it seems easy enough to correct this. (As an aside, if I import a .mov file saved from Quicktime it imports into FCE with the audio set to stereo - why the difference?).
    I'd be happy enough working this way, I think, provided I could be confident that I'm not going to lose quality by saving and then re-importing. Will I? Are there any other downsides I've not thought of?

    You shouldn't lose any quality in the audio or video, but you may lose the timecode track. I'm not sure if you'll lose it, but if you do, you won't be able to recapture the project clips from the original tape because the timecode would be required. This isn't an issue, if you don't ever need to recapture. The timecode may even be retained... I'd have to do an export to see. As a matter of workflow, you may want to think seriously about keeping the timecode, because you can back-up your project file and have some assurance that you can recover from a chatastrophic failure simply by restoring the project file and recapturing from the original tape.
    Regarding your audio and video; unless you were to add effects to the video, there should be no loss in exporting and importing. Losses in DV are incurred when you add filters (alter the image) and recompress. The audio is uncompressed PCM, so no losses to be had there, unless you change the sampling rate.

  • Hi, I've been playing Smurf's village for a year now and just last week, i tried to get into the app but it keeps rejecting and goes back to the main page.  Is there any reason for this?  I've been updating the app everytime and now it's not letting me in

    Hi, I've been playing Smurf's village for a year now and just last week, i tried to get into the app but it keeps rejecting and goes back to the main page.  Is there any reason for this?  I've been updating the app everytime and now it's not letting me in.  Pls advise. Tq

    Reset the device, restart the device, try downloading any other app.
    All of these are basic steps that could have been found by a simple search of the forums as a resolution for the issue.

  • Is there any reason photos in an album page display small on the iPad, but normally on an iMac? And videos on a movies page don't play on the iPad, but are OK on the iMac?

    Is there any reason photos in an album page created in iweb display small on the iPad, but normally on an iMac? And videos on a movies page don't play on the iPad, but are OK on the iMac?

    there are three displays in photos page:
    1) thumbnails grid - smallest
    2) deatial view and detail view slideshow - large
    3a) pop-up slideshow - vary - this is slideshow.html
    3b) or iphone/ipad slideshow phoneshow.html - iphone/ipad can't do pop-up
    it's difficult to know which you refer to.
    if you refer to pop-up slideshow then you should not look into iwebmediagrid.js as wyodor suggested.
    instead look in phoneshow.html and change width and heigth of element id slideshow:
    #slideshow {
    position: relative;
    width: 320px; /* this is default width */
    height: 360px; /* this is default height */
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;

  • HT5622 Is there any reason why my apple id and password allow log in to App Store but say invalid password when trying to activate Facetime ?

    Is there any reason why my apple id and password allow log in to App Store but say password invalid when trying to activate Facetime - I thought that Id and password were the same for all functions ?

    try the steps in this article:
    http://support.apple.com/kb/TS4268

  • Is there any reason or my why cursor is stuck on the spinning rainbow wheel?

    Lately my macbook has been freezing, and I'm thinking that it's being overloaded. Most of the time the cursor is stuck on the spinning rainbow wheel, but it will eventually return back into the arrow. It's currently stuck as the spinning wheel, but I am able to click and access sites. Is there anything I should do to get this checked?
    EDIT: When I open a new tab, the cursor goes back to normal. Is there any reason why it is doing that in the other tab?

    Hi,
    Use the PC KB and hold Windows key + r key at bootup.
    Bootup holding CMD+r, or the Option/alt key to boot from the Restore partition & use Disk Utility from there to Repair the Disk, then Repair Permissions.
    If that doesn't help Reinstall the OS.

  • Is there any reason to use FCP text vs. Borris 3D?

    Is there any reason to use FCP text vs. Borris 3D?
    Thanks.

    boris is vector based, and the basic fcp text is bitmapped. What that means is that you can resize and reposition your type in the control tab with boris without any loss in quality. You cannot do this with fcp text. Also, I think the dropshadow, kerning and leading options are more extensive with boris. Not positive about this as I abandoned the basic fcp titler a long time ago.

  • Is there any reason that my lock keeps unlocking in my network settings? Is there any way to keep it locked? It sure is inconvenient when I have to reboot to get back on the internet and re-lock that lock.

    Is there any reason that my lock keeps unlocking in my network settings? Is there any way to keep it locked? It sure is inconvenient when I have to reboot to get back on the internet and re-lock that lock.

    You could try changing the settings in System Preferences/Security & Privacy/General/Advanced/Require an Administator password to access locked preferences
    But this will affect all Preference settings.

  • I have just installed 11.0.7 on my iMac. Is there any reason to keep 9 or 10 in my "applications" folder?

    I have just installed 11.0.7 on my iMac. Is there any reason to keep 9 or 10 in my "applications" folder?

    No.

  • Is there any reason why my computer won't recognize my iphone

    is there any reason why my computer won't recognize my iphone?

    Have a look here
    iPhone, iPad, or iPod touch not appearing in iTunes
    From Here
    http://www.apple.com/support/itunes/devices/

  • HT4597 I use google for my email, calendar and contacts.  My photos are in iPhoto on my Mac.  I have an Android phone.  Is there any reason I should move to iCloud?

    I use google for my email, calendar and contacts.  My photos are in iPhoto on my Mac.  I have an Android phone.  Is there any reason I should move to iCloud?

    If you don't use MobileMe then there is no point moving to iCloud.

  • Is there any reason that Apple can't support iOS4.3 on the second generation iPod touch?

    I have a number of Apps that can no longer run on my iPod touch second generation because these Apps now requires iOS to be v4.3 or later.  For example, I used to be able to run Skype on this iPod touch, but it failed a couple of weeks ago.  I could not download it from App Store again since it requires v4.3 iOS and Apple does not support v4.3 upgrade on this iPod touch.  The hardware is perfectly fine - I don't see any reason that it cannot support v4.3 upgrade other than Apple wants us to buy newer products.  If that's the case, it leaves a very bad taste on customers' mouth.  How can Apple force their customers to dump what they bought a little over 2 yrs ago because Apple doesn't allow iOS upgrade and customers can no longer run the Apps they need on this device as a result?  There is no way that I am going to buy another Apple product based on this bully behavior!

    I am not sure that I buy that.  Even if that's the case, why can I not continue to run the Apps that used to be supported on v4.2?  I should be able to run the version of Skype App that is compatible with iOS v4.2.  Since Apple controls the App Store content, they should allow those who stay on v4.2 continue to access the Apps that they used to run on v4.2. 
    Becuase App Store continues to push for updates, now it has pushed my iPod to a point of no return as those Apps are no longer supported on v4.2.  I cannot go back to the versions of the Apps that could run on v4.2 - I was happy with Skype (and other Apps) running on my iPod but that version of Skype is no longer available because App Store does not allow that.  It renders my iPod touch useless due to Apple's monopoly control! 
    If anyone knows how to download the older versions of Apps that can run on v4.2, please advise - many thanks!

  • Why is the window for entering bookmarks so small? Is there any reason why it cannot be resizable so that users can expand it if necessary.

    I have a problem with the window size when entering bookmarks. I would like to expand the window so that I do not have to scroll down through the many folders I have.
    Is there any special reason why the window is a fixed size? As far as I can see there should not be any problem with having a window which users can expand if necessary.
    Thank you,
    Sasha

    Try the Add Bookmark Here ² extension for Firefox 3.6.x version: <br />
    https://addons.mozilla.org/en-US/firefox/addon/3880

  • Is there any reason to install iLife if I don't use them?

    I am about to do an erase and reinstall of Leopard. My question is simple: Do I need to install iLife for any reason. While I use iCal and the Address Book, I don't use any of the iLife apps. Instead, I use Aperture, Toast, etc.
    Will I miss out on any critical functionality?
    Thank you.
    Brian

    If you don't need it, don't install it. It won't affect anything else.

  • Is there any reason to Archive both a DNG and DNG with raw embedded?

    In Real World Camera Raw, which suggests using DNG, they seem to be advocating making an archive of both the Camera Raw edited and Bridge rated conversions to DNG files, and another set of the raw files converted to DNG with raws embedded. If you take the raw files from Camera Raw and make one save to DNG with raws embedded, it seems that you could use this set both for a working copy and also archive it. Any reason to make a second DNG set just to have a set without Camera Raw edits and ratings?

    That is a good question and one no one can answer not even Adobe. If
    management or whatever should change at Adobe in the future they could
    decide to remove support for old cameras. Cameras like those that are 5 or
    10 years old (we are talking in the future here). I would imagine that...
    A) Adobe would warn user's ahead of time.
    B) You could keep an older copy of DNG Converter that does support those.
    With that the only time limiting factor is the operating system a time may
    come where the program simply won't run.
    So nothing is guaranteed. However, I think for the foreseeable future
    support for even the oldest of cameras that are currently supported is
    pretty safe. Nothing is forever however.

Maybe you are looking for

  • Portal Runtime Error while creating  new system in portal content

    Hi   Can anyone  solve my problem, i am geting error while creating new system in p ortal content Portal Runtime Error An exception occurred while processing a request for : iView : pcd:portal_content/com.sap.pct/admin.templates/iviews/editors/com.sa

  • How can I get updated data in sub VI in real time?

    Hello. I'm making application using Labview 7.0. What I want to do is the data acquisition changing some parameters. I get the data each time I changed variable parameters. I can do it in sub VI by inserting array component into 'for' loop. As loop i

  • How to get the VENDOR NAME in the report s-ME80FN,MB51

    Dear friends, In many sap standard reports we are getting the vendor no. or material no. etc., What to do if we want vendor name in the reports ME80FN AND MB51? bye TS

  • Does 23" Apple Cinema Display support sAdobe Color Profile?

    i was told the 23" Apple Cinema display does not support sAdobe color profile, can anyone confirm if does or not, thank.

  • Function module Registry_get

    Hi All, We are going for upgrade from 4.6 to ECC 6.0.Function module REGISTRY_GET is obselete in 4.6 instead of this i have used class CL_GUI_FRONTEND_SERVICES method 'registry_get_value' .But the there is a diffrence in number of parameter passed in