I want to learn Java

Discussion in 'Mac Programming' started by papadopolis1024, Oct 6, 2007.

  1. papadopolis1024 macrumors 6502

    Joined:
    Mar 14, 2007
    #1
    What are some good place to go about learning this? And any tips? Thanks... and o ya I have no programming experience...
     
  2. Southern macrumors regular

    Southern

    Joined:
    May 15, 2007
    Location:
    London, UK
    #2
    Try the Java book from O'reilly press, they have always given me a good start when I need to learn how to use something. The last one I read was when I borrowed a copy of their OSX Tiger book when I was switching and found it an informative and easy read.

    Otherwise, try googling for Java tutorials.
     
  3. toddburch macrumors 6502a

    Joined:
    Dec 4, 2006
    Location:
    Katy, Texas
    #3
    Here's a link to the online Java Tutorials. Lots of info.

    http://java.sun.com/docs/books/tutorial/index.html

    Don't get too hung up on all the Object Oriented big words like encapsulation, inheritance, polymorphism and all the other $2 words that are used when books and people try to teach you about object oriented programming. You'll soon enough learn what these are as you get into more complicated exercises. And, these terms are typically thrown around as a means of teaching the experienced procedural (or structured) programming programmer about OO programming and how it's different and why it is so much better... blah blah blah.

    Follow the examples, type them in and make them work.

    Todd
     
  4. Doctor Q Administrator

    Doctor Q

    Staff Member

    Joined:
    Sep 19, 2002
    Location:
    Los Angeles
    #5
    I recommend Thinking in Java by Bruce Eckel. However, the book that's right for you depends on your previous programming experience, which you say is minimal, so it might be better as a supplemental source. This book states:
    This book assumes that you have some programming familiarity: You understand that a program is a collection of statements, the idea of a subroutine/function/macro, control statements such as “if” and looping constructs such as “while,” etc. However, you might have learned this in many places, such as programming with a macro language or working with a tool like Perl. As long as you’ve programmed to the point where you feel comfortable with the basic ideas of programming, you’ll be able to work through this book. Of course, the book will be easier for C programmers and more so for C++ programmers, but don’t count yourself out if you’re not experienced with those languages—however, come willing to work hard.​
     
  5. pilotError macrumors 68020

    pilotError

    Joined:
    Apr 12, 2006
    Location:
    Long Island
    #6
  6. aLoC macrumors 6502a

    Joined:
    Nov 10, 2006
    #7
    Don't learn Java as your first language, try a non-Object Oriented one.
     
  7. Doctor Q Administrator

    Doctor Q

    Staff Member

    Joined:
    Sep 19, 2002
    Location:
    Los Angeles
    #8
    I've heard debate on both sides of this.

    Why do you suggest learning another (non-OOP) language first?
     
  8. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #9
    My university teaches C first. Java isn't even touched until around senior year. People have enough trouble figuring out the simple parts of procedural programming (functions, variables, etc.) alone. I couldn't imagine what it would be like to try to add on classes and everything that comes with it.

    Edit: forgot we do do C++ semi-early, but OO wasn't emphasized. Mostly was figuring out how to work with MFC.
     
  9. Heath macrumors regular

    Joined:
    Aug 19, 2005
    Location:
    Canada
    #10
    If you have minimal programming experience I highly recommend Head First Java and once you complete that you'll have a better mindset to tackle Thinking In Java which is a very good in depth java reference.

    Just find yourself a good text editor, then learn to love the terminal and you're off.
     
  10. aLoC macrumors 6502a

    Joined:
    Nov 10, 2006
    #11
    I regard OO as a specialized technique, useful in certain cases, such as GUI libraries and collection classes. I don't think it should be taught as a general programming method.

    Obviously you can use it that way, but I don't know how many systems I've seen where the developer, in their obsession with respresenting every little problem as a set of objects messaging each other, has made a real mess of things where a simple recipe style procedural description of what the computer should do would have served the company better.
     
  11. zimv20 macrumors 601

    zimv20

    Joined:
    Jul 18, 2002
    Location:
    toronto
    #12
    sounds to me that you haven't worked on any projects with actual, skilled OO developers. i grew up learning procedural, and while i still use many of the lessons i learned during that time, no way would i want to go back. i've been developing exclusively OO since 1992 or so.
     
  12. aLoC macrumors 6502a

    Joined:
    Nov 10, 2006
    #13
    The right tool for the right job. If there is a natural object hierarchy in the problem, then use OO, otherwise don't. OO is not the only fish in the sea.
     
  13. zimv20 macrumors 601

    zimv20

    Joined:
    Jul 18, 2002
    Location:
    toronto
    #14
    but above you've limited the usefulness of OO to only a couple areas. that tells me you've had only 1 or 2 experiences w/ OO, and they weren't good. so, naturally, you're questioning OO as a whole, but just because you can't abstract to "a natural object hierarchy," doesn't mean the rest of us can't.
     
  14. aLoC macrumors 6502a

    Joined:
    Nov 10, 2006
    #15
    Of course, how could I have been so blind. I now realize OOP is the one true programming way. Praise Jebus and thank you for showing me the light.
     
  15. papadopolis1024 thread starter macrumors 6502

    Joined:
    Mar 14, 2007
    #16
    So now I am confused :confused: ... What should I learn to start learning basic programming... This already seams harder than I thought :confused:
     
  16. zimv20 macrumors 601

    zimv20

    Joined:
    Jul 18, 2002
    Location:
    toronto
    #17
    you are welcome.
     
  17. zimv20 macrumors 601

    zimv20

    Joined:
    Jul 18, 2002
    Location:
    toronto
    #18
    imho, you have to work towards a finished app. if you can't think of something to create, then either buy a book that takes you through building an app, or take a class.
     
  18. Doctor Q Administrator

    Doctor Q

    Staff Member

    Joined:
    Sep 19, 2002
    Location:
    Los Angeles
    #19
    The traditional first program in any programming language is one that outputs the phrase "Hello, World."
     
  19. Blacky macrumors member

    Joined:
    Jun 27, 2007
    #20
    hierarchy is ********, no offence, but if you view OOP like that it's a too narrow view.

    OOP allows analysts, programmers, to model a program after real life (business) processes or to encapsulate change or complexities.

    There are a few common problems about how people use OO:
    1) people try to mimic reality, they create "reusable" objects containing too much properties, and not how the object functiones most efficient for your use cases
    2) incorrect assignments of responsibility, this causes for methods to be in the wrong place, this in turn causes that you need certain objects at the wrong time just because of their incorrect responsibilities. This is first rule of Demeter: "Don't talk too strangers"

    OO has multiple levels, you have the modeling, you have design patterns, you have entire design methodologies like MVC.

    For example have a look at the Java I/O framework, they use a decorator pattern for file reading/writing so you can transparently read/write to zip files, use encryption etc.

    Now to give my 2 cents about the initial question: just start with oop, always care about quality and writing the program correctly, applying mvc, seperating concerns. When you can program oo procedural is a breeze.

    2 books I can recommend: applying uml and patterns from Larman and design pattern explained by shalloway and thott.
     

Share This Page