At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga.
Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus.
Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
Well, there are probably two reasons:
(1) For relatively simple programs, objects don't really help maintainability and do jack up complexity. In the words of John Carmack: "Sometimes, the elegant implementation is just a function. Not a method. Not a class. Not a framework. Just a function." This is the massive downside of Java's approach of classes-and-objects-absolutely-everywhere.
(2) Really learning how to use objects properly takes time, studying other people's code/how frameworks work, and practice. You eventually gain a way of approaching problems in an object-oriented way that does make their usefulness clearer than it might be at first. You'll realize that you may well be able to decrease complexity if you do things right.
Classes allow for complex actions to be accessed very simply. Even in a "Hello World" type program, the use of the System class ( System.out.println( "Hello World" ) ) hides all the good stuff of iterating through the characters and writing them to file descriptor one.
Usually true, but I don't know that I like the example. print "Hello World" in Python or Ruby both provide the same hiding without the complexity of a static main function, wrapping class, System.out, etc. Java sucks for simple programs because its design decisions are entirely based around complex programs, and leave no room for simplicity when it's needed.
Not the answer you are looking for? Search for more explanations.
True, but the print function still hides the same good stuff. If you want Python objects, how about lists?
I've also gone over to:
if( __name__ == "__main__" ):
which basically makes a main function, in most of my recent programs.
thanks guys the important thing to note is when writing simple programs shouldnt be a language of choice..:)