Python Vs. Java?

Discussion in 'Mac Programming' started by Nsutton, Mar 26, 2010.

  1. Nsutton macrumors member


    Dec 29, 2009
    6 Feet Under
    I'm BRAND new to programming (less than a week).
    I've been using Python for now, but I'm starting to think java will give me more versatility with my programs.

    What would you recommend?

    Also, Wth Java should i download like eclipse or is notepad decent enough?

  2. MikhailT macrumors 601

    Nov 12, 2007
    It depends on what you want to do. Both languages are worth knowing. Python is actually an easier language to learn with than Java. You could just start with Python, and transfer to Java (or other languages like C#). But be warned, it can be very hard to adjust to strong-typed language after learning Python.

    Notepad? You mean textedit? It's up to you how you want to code, but most people end up with IDE as Java can be much more complex to navigate with multiple frameworks and so on. Python is usually done without an IDE but you can use IDEs for it as well.

    Eclipse is probably the best IDE you can use for Java, but it's not the only one, you should experiment with the other IDEs to find one that matches your style but you shouldn't worry about IDE right now as you progress with your programming skills.
  3. HiRez macrumors 603


    Jan 6, 2004
    Western US
    Python is an awesome language and I would also say it's a lot less complex than Java. Both are very capable though and both will teach you a lot about programming. In the end you will most likely study a number of different languages, but you have to start somewhere. There are tons of jobs out there doing nothing but Java coding, Python is more useful for shorter scripts, and code to glue different components together (which means very useful since that sort of thing is needed all the time).

    I know some of both and I prefer Python, it just seems much faster and cleaner to code in and I tend to spend less time studying the APIs, which are pretty massive in Java and have a long, somewhat crufty legacy. But, if I were getting into coding big applications, maybe with a GUI, and especially for enterprise, I would probably go the Java route.
  4. Cromulent macrumors 603


    Oct 2, 2006
    The Land of Hope and Glory
    Both Java and Python are general purpose programming languages. In essence this means that you can do just about anything with them. That isn't to say they are equal in every task you can imagine just that you can kludge your way to victory in either of them if you so choose :).

    What I am trying to say is not to worry about versatility at this stage. Either language is perfectly capable of handling anything you can think of from games, to web sites, to desktop applications to specialist niche areas such as scientific computing.

    Learn a language first (any general purpose language, except BASIC that is) then worry about which is better for which task.
  5. ranguvar macrumors 6502

    Sep 18, 2009
    I'd say learn Java first. Going from a strongly-typed language (Java) to a weakly-typed language (Python) is much easier than the other way. Also, Java really makes you think object-oriented, unlike Python which can be more easily written like a procedural / functional language.

    That's just my opinion though. In the end, you can learn both languages, anyway.
  6. Nsutton thread starter macrumors member


    Dec 29, 2009
    6 Feet Under
    Thanks for everyone's input. But I think im gonna go with java for now..

    If it's too complex i'll go back to python...

  7. AlmostThere macrumors 6502a

    Fair enough.

    Out of interest, what has led to the perception that Java is more versatile or better suited to your needs?

    Personally, I would have said hammer away at Python for a year ... but if you are going down the Java route, at least stick with that for a year. Try not to chop and change until you have a good grounding in one language. Part of programming is persistence and learning how to do stuff with the tools you have rather than the tools you would like.
  8. mags631 Guest

    Mar 6, 2007
    They are both good -- I personally prefer Python at this moment. I use it mostly for rapid prototyping.

    Notepad is never decent enough. Basically, regardless of your language, you want an editor or IDE (integrated development environment) that helps you avoid and remove errors in your code. Even the most basic programming editor should feature syntax/keyword coloring -- visually differentiate literals from keywords. The good news is there is never a reason to have to use Notepad -- there are plenty of free programming editors that are lightweight and easy to use. Eclipse is good for Java.
  9. Winni macrumors 68030


    Oct 15, 2008

    I think that as a newbie with less than seven days of programming experience, you are making a very bold and completely unfounded statement there.

    Java will drown you in its rules, restrictions and protocols. It will be hard to find a more bureaucratic "modern" programming language than Java. Do you know why people love C# so much although it basically is a Java rip-off? Because it took away most of those idiotic bureaucratic rules and does something that Java doesn't do: C# trusts the programmer. Java is like a Mac: It believes that you don't know what you're doing, so it refuses to give you the option.

    That being said, Python is a completely different beast than C# and Java. The language is about empowering the programmer and giving him extreme productivity with the least possible effort. And as a hybrid language, it also lets you choose between multiple programming paradigms. You -can- use OO style, but you don't have to.

    Some of the big names in the programming scene called languages like Java "the new Assembler". Except for legacy code bases and extreme low-level systems stuff, nobody will be using languages like C, C++, Java or even C# in a few years from now.

    But in the end, it always depends on what you actually want to do. Java tries to be the one language for all platforms and purposes, but has always failed at delivering. There is no such thing as the one true answer. You can put a nail in the wall with a screwdriver, but you'd usually use a hammer for that job.

    It's the same with programming languages. Some are better for a specific purpose than others. That's why we have so many of them. And that's why you usually have to learn a couple of them in order to be successful in the IT industry.
  10. MorphingDragon macrumors 603


    Mar 27, 2009
    The World Inbetween
    As do most C languages.

    That analogy would only be valid if you were comparing the iPhone, not the Mac platform. Then again, its also a bad analogy.
  11. ranguvar macrumors 6502

    Sep 18, 2009
    You got some good points there. However, I believe it might be enlightening to learn Java first, because its strictness will enforce correct usage and it enforces object-orientation (which is the best thing since sliced bread!). After one has learned the basics, one can move on.
  12. Nsutton thread starter macrumors member


    Dec 29, 2009
    6 Feet Under
    I had chosen Java, because im only 13 so i can take the extra time to pratice and learn java.

    I mean i originally wanted to learn objectic c languages..
  13. IntelliUser macrumors 6502

    Nov 1, 2009
    Why does it matter?
  14. MikhailT macrumors 601

    Nov 12, 2007
    Your age has nothing to do with it, it applies to everybody. It depends on what you want to do in the end.

    Mastering a language of any kind, take years if not decades. Especially C/C++. Java will take you a year just for the basics, than advanced topics like networking, serialization and so on will tack on another couple of years if you take everything slow at once and understand each topic instead of just copying and pasting from the tutorials.

    Objective C is actually a very good language to start with as well, there's no reason for you not to learn it. If you want to develop applications for iPhone/iPad, go with Objective C.

    Java has one huge problem, it's stuck with a legacy codebase and so many weird coding structures that it's starting to catch up with the core devs whenever they try to modernize the language for the next generation. Not to mention, many developers are not sure what the state of Java is now that Oracle has bought Suns.

    Python, depending on what you want to do, has two different versions that will change how the community use it over the next half a decade. So many projects are not compatible with Python 3 yet, and it would take one to three years for major frameworks and projects to catch up.

    Learning C/C++ could make it easy for you to learn Obj C and Java and C$ as they all have very similar concepts. Python is something you can learn anytime.
  15. Nsutton thread starter macrumors member


    Dec 29, 2009
    6 Feet Under
    What about C++, i know its more challenging but i wanna use the dark gdk so baddd!
  16. Cuju macrumors newbie

    Mar 18, 2010
    I started with Java, there's so much info on the web about it. Not saying Python or C++ doesn't have that, but from personal experience I'm glad I chose Java as my first language!
  17. foshizzle macrumors regular

    Oct 17, 2007
    at my university, the three programming classes to get into the dept. are (in this order) Java, C, C++. I'm at C right now. Java is a nice language to get to understand basic concepts, and it can be object oriented so you can learn that concept as well which helps you dive into C++ or Obj. C. I'm taking C++ over the summer and also learning (myself) Ruby to do a few projects with and hopefully I can get around to the 5 books on Obj. C and iPhone programming I got in December.

    I think you made the right choice to choose java, just make sure your next language is something you can apply now. I didn't enjoy java like I enjoy C or Ruby or the very little bit of Obj. C I've done. Python is going to be a nice language for scripting so setup a linux box and write some scripts with it.

    best of luck - I wish i had started programming when I was 13 instead of 20. Just take it one step at a time, and keep ideas flowing.
  18. craig1410 macrumors 65816


    Mar 22, 2007
    I'm resisting the temptation to call this post complete nonsense but I will say that it is heavily biased against Java and isn't really particularly helpful IMHO to a 13 year old who is looking for reassurance.

    A few specifics:

    1. Yes, Microsoft took Java and copied much of it to produce C# but unfortunately they also locked C# to the Windows platform rather than carry forward one of Java's greatest benefits - cross platform compatibility.

    2. What rules, restrictions and protocols do you find difficult? I can't think of anything in Java which is fundamentally difficult.

    3. What do you find Bureaucratic about Java? What does "C# trusts the programmer" actually mean?

    4. I think you will find that Java (and C based languages) will last a little bit longer than a "few years"... Java and C are still pretty much neck and neck at the top of the demand charts with the proprietary C# and VB a considerable distance behind. See the tiobe index for, and admittedly rough, guide.

    Many professional programmers still believe that some level of proficiency with a C based language (C/C++/ObjC/Java) is pre-requisite to being a good programmer. I would happen to agree speaking as a Software Consultant who has been coding for 30 years in everything from hand assembled machine code to the latest toolsets. Knowing something about pointers and memory management etc is important even if you are lucky enough to be using a language which handles most of this for you.

    Another small point to note - if you go with the Microsoft .Net tools then you are pretty well tied to Windows and practically tied to Visual Studio as your IDE. If you go with Java (and many other open languages) then you have a wider range of choices of platform and IDE. Personally I hate going back to Visual Studio after using Eclipse as VS is so clunky and crashes too often.

    Sorry to appear argumentative but I felt your post was a rant against Java rather than something which the OP could benefit from.

  19. cluthz macrumors 68040


    Jun 15, 2004
    I started with HyperTalk in the late 80s :D

    Java is nowadays the preferred language for beginner studies in programming, at least where I am.
    It doesn't take too much time to learn java and make sensible applications out of it.
  20. kylos macrumors 6502a


    Nov 8, 2002
    Regarding using IDEs or a basic text editor, I would definitely recommend spending some time using just a text editor and the command line compiler, javac. You could even be daring and try using a command line editor like vi or emacs.

    Don't get me wrong. Use an IDE for programming. Doing otherwise will be painfully slow and unproductive. But gaining experience on the command line will I think give you a better feeling for how all the tools work.
  21. notjustjay macrumors 603


    Sep 19, 2003
    Canada, eh?
    Honestly, for a complete beginner starting today, I would start with Python. (I started with BASIC, which I don't think there's anything wrong with even today, but Python is very similar and the more modern equivalent.)

    Then pick up some C.

    I learned C years ago using a great little book called "Practical C Programming" published by O'Reilly. Once you're reasonably grounded in C code, it's not a stretch to learn how to wrap it in object-oriented techniques, which gives you C++, which is very very similar to Java. Once you know the concepts behind any one programming language, it's very easy to switch to another one.

    C, C++, and Java are so similar that you pretty much can switch from one to the other with minimal effort. Python "looks" completely different in terms of coding style and syntax. Spend time learning both and you'll be well equipped.

    One thing I like about Python is the command-line interface, you can just sit and play with statements interactively. How do you print something? How do you add 2 numbers? What's the name of the function that gives you the length of a string? Just type it into the command line and see what happens. Saves you from writing your code, run, errors, edit, rerun, more errors, etc.

    As for an editor, learn how to use Notepad/TextEdit for simple programs to start off with (or quick fixes to existing code), but I would recommend finding a "smart" text editor with syntax coloring which makes it much easier to see what you're doing and navigate your way around ever-longer code files.
  22. wrldwzrd89 macrumors G5


    Jun 6, 2003
    Solon, OH
    Also note that, at least on Mac OS X, that the Java interpreter cannot be distributed with applications, but the Python interpreter can.
  23. savar macrumors 68000


    Jun 6, 2003
    District of Columbia
    13 is a great age to start learning. You'll struggle more at first, but when it finally clicks it will be deeply ingrained in everything you do. You'll be miles ahead of most others.

    What kind of programs do you want to write?

    Because I would recommend Python to a beginner... it's easy to learn and lets you focus on basic, procedural programming. Java will force you to learn OOP and strong typing first, which is the wrong order of things. You want to learn the basics of arrays, loops, functions, etc.

    You also might like Javascript, since it can run inside a browser and create graphical output pretty easily. (You would need to learn some HTML, too, however.) There are some good Javascript classes in the YUI Theatre:
  24. cromwell64 macrumors regular

    Jun 30, 2008
    I agree completely with this. To get a really good foundation as a programmer you should learn C. Where I got my degree, the computer science department relied too heavily on Java. A good number of the students could write basic software with Java, but they had little understanding of the details underneath. Java makes a lot of things really easy to do, which is why a lot of people really like it. C on the other hand forces you to be aware of some of the things going on at a lower level. This makes you a better programmer even if you move on to other higher level languages like Java.

    Learning C, as with any C based language like Java, makes it easy to learn most other languages. If you are looking at this as just a hobby, then it is no big deal... but if you want to build a solid foundation I definitely suggest going with C instead of Java.
  25. mdatwood macrumors 6502a

    Mar 14, 2010
    Denver, CO
    I was going to say the same thing. Start with Python and C. Python is nice because you can quickly go from nothing to something. Look at the PyGame libraries if you want to build some quick games like Pong. Object oriented concepts also work fine in Python so you can use it to learn those as well.

    C is good to learn because it's a relatively small language and it will teach you about important concepts that transcend many many other languages. You'll learn about pointers, references and memory management(stack vs heap, allocating and deallocating) that is so critical even in a GCed language like Java.

    While learning both languages pay attention to what they share and how they differ. This is important because what you'll find is that many languages are very similar except around the edges with the main differences coming in syntax. Remember that at the end of the day a particular language is just a tool to express a concept/theory. Learn the theory! Languages will always be changing while the underlying theory often stays the same.

Share This Page