1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

no Encapsulation with java - issue?

Discussion in 'General Programming Chat' started by dalinkwent6, Sep 30, 2014.

  1. dalinkwent6

    dalinkwent6 Junior Member

    Joined:
    Jun 30, 2013
    Messages:
    114
    Likes Received:
    16
    Location:
    5th Dimension
    I am about 75% done with a personal bot project of mine thanks to this sub thread and the ones giving the time to private message me some coding guidance.
    I completely disregarded the use of encapsulation on my entire project. Is there going to be an issue that i am going to run into in the future?
    I've made mini games in the past but there was no point in using encapsulation because i didn't use some kind of user database.
     
  2. Arbvestor

    Arbvestor Newbie

    Joined:
    Feb 11, 2014
    Messages:
    25
    Likes Received:
    15
    Occupation:
    Support Tech
    Location:
    Spain
    Home Page:
    Encapsulation is an important and very useful concept in programming. It helps keeping side-effects under control. In very small projects you might not feel the need of it, but as soon as your project grows, you probably want to use this concept.

    Of course you can write correct code without it, but keeping unrelated things separate also helps you in understanding your own code. If I look at stuff I did months ago, it helps to find small modules that do defined things.

    To answer your question: I can#t tell you if you run into problems later with your bat, but it is simply a good idea to use the tools that you use the way they are meant to be used. So if your programming language supports modules, you should start understanding how to use them :)
     
  3. member8200

    member8200 Regular Member

    Joined:
    Aug 9, 2014
    Messages:
    469
    Likes Received:
    33
    If it's just a small project, or a simple program then i don't think encapsulation would be an issue of course.
    But having a big software projects and creating a tons of code then you might wanna consider using encapsulation.

    Encapsulation is one useful tool and i would suggest understanding and incorporating it. besides, how bad could it be to study this concept.
    I tell you, It'll be very useful.
     
  4. botcode

    botcode Newbie

    Joined:
    Oct 30, 2014
    Messages:
    16
    Likes Received:
    1
    Without using encapsulation, you will run into maintenance problems when the size of code base become large. Although you may not be able to appreciate the benefits in small projects, I think it's still better to have it so that you get experience in doing it.