Alright So I feel like I just walked into a jungle....

Discussion in 'Mac Programming' started by dr0wzy, May 19, 2010.

  1. dr0wzy macrumors newbie

    Joined:
    May 19, 2010
    #1
    Ok so I am having some trouble on starting to learn java. I am going to make a attempt at learning it but now I really need some help on just starting. Please understand that I am a youngin' (younger than 16) and I need some help to just start. Any links to any developing application's would be great. BTW This is my first post and I am running a Macbook pro (the one that is black).
     
  2. miles01110 macrumors Core

    miles01110

    Joined:
    Jul 24, 2006
    Location:
    The Ivory Tower (I'm not coming down)
    #2
    Ask an actual question. "I need help with java" is very general. You could google "beginning java programming" and start from there?
     
  3. qtx43 macrumors 6502a

    Joined:
    Aug 4, 2007
    #3
    "Thinking in Java" by Bruce Eckel is a nice book, and the previous edition is a free download. If you have specific, to the point, questions then stackoverflow.com is a nice website.
     
  4. notjustjay macrumors 603

    notjustjay

    Joined:
    Sep 19, 2003
    Location:
    Canada, eh?
    #4
    Welcome. And, hey, everyone has to start somewhere. This forum is a good place to start. You'll see posts from everyone from total newbies to experienced programmers. And "experienced" means something different to everyone. For example, I've been programming in C++ and some Java for 10-15 years, but I still don't know a thing about Objective-C or programming for the Mac. One of these days I'll sit down and learn.

    I think there are two "parts" to learning about programming. One is the entire concept of programming in the first place, and has nothing to do with the specific language you're learning. Some people "get" it faster than others. And as computers and operating systems continue to advance, there's more to "get" now than there was before. Back in the day, they taught flowcharts, which seems outdated now, but the concepts are still sound. Understand the concept of a computer program performing things step by step. Understand the concepts of functions, variables, conditionals, loops. The second part is, of course, the specifics of the language you're learning.

    Use whatever language works best for you to understand those concepts. When I grew up, it was BASIC on an Apple ][. For you, since you're learning Java, that could be it. But don't be afraid to try other languages -- maybe look at Python? -- because the more you learn about the commonalities between the languages, the more you are learning about programming and less about the language.

    A couple of things, though. People on this forum don't like it when people are obviously being lazy, or posting homework assignments hoping that others will write the code for them. I'm certainly not accusing you of this, but if you do have questions, try your best to find the answers on your own. Google is a great help. Read the docs (Java is FULL of docs). Try some examples. I find this is the best way to learn -- by doing, trying, failing, learning, trying again. If you're still having difficulty, post a message and indicate what you've tried, and we'll do our best to help you.

    I'm paid pretty decent money to program C++ for a living, and you know what? I Google things dozens of times a day when I forget what a function is called or need to see an example of how a certain chunk of code is supposed to be written.

    I hope that's helpful!
     
  5. ranguvar macrumors 6502

    Joined:
    Sep 18, 2009
    #5
    I'd recommend taking a course at school. Learning from books is cool, but at the beginning, you might have quite a lot of questions about thinking object-oriented, so an actual person to talk to would be better.

    Also, remember that programming isn't about creating shiny applications in the first week. Get ready for looking hours at code and not seeing any graphical results of your work :)
     
  6. MorphingDragon macrumors 603

    MorphingDragon

    Joined:
    Mar 27, 2009
    Location:
    The World Inbetween
  7. Avicenna macrumors member

    Joined:
    Jul 16, 2009
    #7
    yea..as someone else mentioned above, get ready for sleepless nights thinking about where that little bug in your code is coming from...
     
  8. chrono1081 macrumors 604

    chrono1081

    Joined:
    Jan 26, 2008
    Location:
    Isla Nublar
    #8
    LOL that is so true! But, sleep also solves programming bugs too sometimes. I've dreamt about programming many many times lol.

    To the OP, although I can't comment on Java, I will say this holds true for any language: You will get stuck and frustrated MANY times. It's part of learning programming so I hope you are ready for it ;)

    It does get easier with time though and once you get more experience you will be able to switch from language to language with very little problem.
     
  9. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #9
    I'm amazed no-ones noticed this yet: there are no (and have never been any) black MacBook Pros (colorware excluded). You have a MacBook (no Pro).
     
  10. dr0wzy thread starter macrumors newbie

    Joined:
    May 19, 2010
    #10
    Ok Yeah I get all the points you guys are saying. And about python, I just feel like I would rather go for learning a language that is more "object oriented". I maybe didn't convey what I was meaning. I am wondering how to just start programming on a mac, meaning I need some help finding a compiler worth my
    space.
     
  11. mdatwood macrumors 6502a

    Joined:
    Mar 14, 2010
    Location:
    Denver, CO
    #11
    This is why I keep my iPhone (for Evernote) and a pencil and paper next to my bed. I was laying awake for hours last night 'working' on this UI I need to get designed and coded.

    To the OP,

    Python is object oriented also. I wrote a blog post about which language to learn first based on how you think you learn. Check it out.

    *EDIT*

    Also, OSX should already have python, ruby, and java interpreters/compilers installed by default.
     
  12. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #12
  13. chrono1081 macrumors 604

    chrono1081

    Joined:
    Jan 26, 2008
    Location:
    Isla Nublar
    #13
    Netbeans is a very nice free IDE (integrated development environment, commonly confused with a compiler).
     
  14. Detrius macrumors 68000

    Joined:
    Sep 10, 2008
    Location:
    Asheville, NC
    #14
    I just assumed this was in reference to the black screen and keys on the unibody MacBook Pros, but yes, you're probably right.
     
  15. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #15
    Having spent much time struggling with Eclipse and Netbeans I'd suggest that it is probably easier to just learn Maven from day one.
     
  16. firewood macrumors 604

    Joined:
    Jul 29, 2003
    Location:
    Silicon Valley
    #16
    start easier

    Some people can jump right in, and learn a professional programming language right from the beginning.

    But most of these professional programming environments were not designed for teaching/educational purposes. So if you're having problems getting started the hard way, I suggest first learning an easier educational, even toy, computer language. Learning a second/3rd/etc. programming language afterwards is usually a bit easier after you've already figured out how to write and debug programs.

    Squeak, Scratch, Alice, Logo, even Basic. Or maybe an easier "real" language: Python, Javascript in your browser, Scheme, Forth if you're an RPN calculator expert, etc.
     
  17. dr0wzy thread starter macrumors newbie

    Joined:
    May 19, 2010
    #17
    Thanks for the suggestions about ruby. It looks like something that would fit what I need. Thanks guys for your help you get a cookie :):)
     
  18. ThaGrapist macrumors newbie

    Joined:
    Feb 13, 2010
    Location:
    NC
    #18
    If you go the Java route, BlueJ is a really nice IDE for beginners. It will help with the OO concepts, since it can visualize class relationships for you on the fly. I still occasionally use it for some of the object manipulation capabilities it has, which are really useful when debugging.
     
  19. macsmurf macrumors 65816

    macsmurf

    Joined:
    Aug 3, 2007
    #19
    I think you're making a good decision by choosing a "pure" language. Languages can be put into certain groups known as paradigms and some languages are considered multiparadigm. Python, for example, has aspects of both procedural and object-oriented programming.

    Java is very popular as a learning language. There are several reasons for this. First of all, it is a (somewhat) pure object-oriented language. There is an exception, known as primitive types, that were originally put in for performance reasons. I don't think that this will cause any confusion, though. You might not even notice the difference (but any good programming text will point them out for you). Another reason is that Java is quite verbose. You have to write a lot of stuff that could have been made shorter by the designers. On the other hand, you have to really understand what is going on before your programs work.

    Because Java is such a popular choice for a first language, there are lots of books and resources on the web for this purpose. The fact that it is used professionally shouldn't discourage you.

    Ruby is, some ways, more purely object-oriented than Java (no primitive types). On the other hand, it has some components from the functional programming paradigm that may be difficult to grasp for a beginner. It also has a lot of syntactic sugar which is basically shortcuts that allow you to specify something in a short form. This is great for programmers who already know their stuff but on the other hand it may obscure the actual meaning of the code for beginners. Less verbosity is nice but only if you know what is going on.

    Some people say that Ruby is a great first language. I agree that it is a great language but I doubt the claim about it being a good language for beginners. It might be true, though. I simply don't know.

    If you go the Ruby way, you should get the book "Programming Ruby" by Dave Thomas. It is also known as the pickaxe book and is well written. It includes a lengthy introduction/tutorial that will teach you many of the concepts you need to learn.
     
  20. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #20
    Don't forget functional influences either :).

    Good advice. Java is a nice easy way to drop into programming, but then I still think that C is an OK language to start off with too, considering that was the first language I ever learnt.
     
  21. macsmurf macrumors 65816

    macsmurf

    Joined:
    Aug 3, 2007
    #21
    You're right. :eek:

    C will teach you the procedural paradigm and I'm guessing it will be a difficult journey but a rewarding one. It's a language close to the native CPU language and will teach you about the sytem architecture as well.

    However, subtle bugs much? :) C was my third language (Basic & Pascal before) and I remember one bug in particular. I'd defined an array and defined the counter directly after the array definition. I started out by blanking out the array with zeros. Boom, infinite loop. WTF? It turned out that I went out of bounds on the array and overwrote the counter with 0 as well. Pretty subtle for a beginner. One the other hand I learned something. Let's pretend I never made a one-off error ever again ;)
     
  22. Bill McEnaney macrumors 6502

    Joined:
    Apr 29, 2010
    #22
    I don't understand. Was the counter a separate variable, or did you build it into the array? I'm not a C expert, but in Pascal, I've sometimes written something like this:

    Code:
    [B]const[/B] Capacity = 120;
    
           [B]type[/B]
              Element_Type = integer;
              Index_Type = 0 .. Capacity;
    
              List_Type =
                 [B]record[/B]
                    Element: array[Index_Type] of Element_Type;
                    Last: Index_Type
                 [B]end[/B];
    
         [B] function[/B] Empty(List: List_Type): [B]boolean[/B];
            [B] begin[/B]
                Empty := List.Last = 0
            [B] end[/B];
    
        [B]  function[/B] Full(List: List_Type): boolean;
             [B]begin[/B]
                Full := List.Last = Capacity
         [B]    end[/B];
    
          [B]procedure[/B] Insert(Another_Element: Element_Type; var List: List_Type);
             [B]begin[/B]
               [B]if[/B] Full(List) [B]then[/B]
                  writeln('The list is full.')
              [B]  else[/B]
                [B]   with[/B] List [B]do[/B]
                      [B]begin[/B]
                         Last := succ(Last);
                         Element[Last] := Another_Element
                     [B] end[/B]
             [B]end[/B];
    
    Why did I use the successor, succ, function to change the value of Last? I did that to make the code more general because Pascal allows subscripts that aren't integers.
     
  23. qtx43 macrumors 6502a

    Joined:
    Aug 4, 2007
    #23
    In C an array is just a block of memory, no bounds checking, no memory protection (at the language level). He's probably talking about something like:
    Code:
    #define SIZE 10
    int array[SIZE];
    int i;
    for (i=0; i<=SIZE; ++i)
      array[i] = 0;
    You can see that the "int i" is probably stored in memory immediately after the array.
     
  24. Winni macrumors 68030

    Winni

    Joined:
    Oct 15, 2008
    Location:
    Germany.
    #24

    This is the best book to learn Java:

    "Head First Java" by Kathy Sierra and Bert Bates, O'Reilly, ISBN 0-596-00920-8.

    You do NOT need an IDE and you should NOT overload yourself by trying to learn Java AND a compley IDE like Netbeans or eclipse or - horror! - Xcode. Just as Kathy Sierra recommends, a simple text editor (e.g. jEdit, TextWrangler or BBEdit) and the Mac's Terminal window will be sufficient.

    Java is already complex enough, so keep everything as simple as possible.

    Just buy ONE book and stick to the Java command line tools and your text editor while you work your way through that book. And it might be a good idea to stay away from Internet forums while you're studying that book -- it will only confuse you more instead of helping you get anywhere.
     
  25. FlyingHonda macrumors newbie

    FlyingHonda

    Joined:
    Mar 9, 2010
    #25
    May I suggest the fantastic upcoming indie game, Minecraft?
    A couple of years ago, this sparked my interest in Java... I mean, come on! It has stereoscopic 3D! The developer, Markus Persson, AKA Notch, sometimes posts snippets of his Java based genius on his development blog. Other than that, good luck!
     

Share This Page