PDA

View Full Version : Learning Java/Python



Zahhak
2013-05-08, 05:35 PM
So, long story short, I kind of want to learn Java because it's apparently an easy to learn but useful language, and was looking for some good resources. I'm willing to spend money (and expect it for a good resource), but I'm cheap. I know there is a metric ****load of online resources, but I feel like I'd rather get a book (Hipster Thing number 248: using outdated methods of instruction). I know there's a lot of "oh, I used this book and it worked great for me!" recommendations on Amazon and then programmers go "um, maybe, but's not a really good resource" so I was hoping for some input on what to get that's actually a good resource. Or if there's a website(s) that spanks every book ever, I'm good with that too.

Oh, and I have friend that wants to learn Python who has a birthday coming up, so, recommendations on that would be nice too.

Thanks a lot folks

Shhalahr Windrider
2013-05-08, 05:51 PM
When I wanted to give myself a refresher on Java, I found Sams Teach Yourself Java in 24 Hours (http://www.amazon.com/s?ie=UTF8&field-keywords=Java%20in%2024%20Hours) to be a useful learn-by-doing resource. Had some decent projects I could play with.

Of course, I came already knowing some Java, and before that I had experience with Object-oriented programming in C++. So I had a bit of a head start on the concepts. I don’t know what background you are coming from, so I don’t know if the same approach will be useful to you or not.

Also, I used an older edition from the public library, so I can’t vouch for any of the newer stuff in the current editions.

In any case, don’t let the title fool you. “In 24” hours does not mean “do it all in one day.” It should be approached more like twenty four one-hour learning sessions.

Zahhak
2013-05-08, 06:15 PM
Thanks Shhalahr. About all I have is some BBC from forums and HTML from wikis, so I know about enough to embarrass myself at parties.

Shhalahr Windrider
2013-05-08, 06:45 PM
Yeah, those aren’t gonna give you much of a leg up on Java. They are completely different animals in completely different phyla.

Not sure if I can come up with a sure-fire recommendation for that background. I learned most of the fundamental programming concepts in school, mostly through verbal instruction. By the time I got to teaching myself stuff from books, I was at a point I could skim most of the conceptual material and jump straight to the projects. In fact, that’s pretty much what I was doing with the teach yourself in 24 hours book above.

Some additional material on the basics of Object Oriented Programming might be helpful.

Flickerdart
2013-05-08, 08:02 PM
If you just want to learn a language to get your foot into programming, rather than for a specific purpose, Processing (http://www.processing.org/) is much easier to pick up than Java, being essentially a library that takes care of the annoying painful stuff (main method, creating windows) for you. The syntax is the same, and if you must have a book, then this one (http://shop.oreilly.com/product/0636920000570.do) (written by one of the language's creators) is a great resource.

After you have a handle on how to work a programming language, transitioning to Java should be a simple matter.

TSGames
2013-05-09, 05:26 AM
Oh, and I have friend that wants to learn Python who has a birthday coming up, so, recommendations on that would be nice too.

Thanks a lot folks

My first learning experience in Python was writing a Pascal compilier (it even handled recursion), I wouldn't recommend that approach unless you have years of programming experience and a need to quickly become proficient in a language.

So that leaves books. I'll be honest, I don't own a single intro to Python book. However, there's always the Learn Python the Hard Way (http://learnpythonthehardway.org/) book, it comes highly recommended. And here (http://programming-mother****er.com/become.html)'s a list of free Java books to help get you started; I own several Java books, but not one that I would recommend. lol the forum is censoring my link. here's the url, I think you can guess what the full url should be:
http://programming-mother****er.com/become.html

Caesar
2013-05-09, 11:32 AM
cant imagine spending any money on a book for python or java, when there are SO many good online resources.

I mean it. The python course at my university doesnt even offer a book, its just the teachers notes and some online resources and off you go.

Wookieetank
2013-05-09, 11:37 AM
My first learning experience in Python was writing a Pascal compilier (it even handled recursion), I wouldn't recommend that approach unless you have years of programming experience and a need to quickly become proficient in a language.

So that leaves books. I'll be honest, I don't own a single intro to Python book. However, there's always the Learn Python the Hard Way (http://learnpythonthehardway.org/) book, it comes highly recommended. And here (http://programming-mother****er.com/become.html)'s a list of free Java books to help get you started; I own several Java books, but not one that I would recommend. lol the forum is censoring my link. here's the url, I think you can guess what the full url should be:
http://programming-mother****er.com/become.html

I'll second Learn Python the Hardway and add in: Invent With Python (http://inventwithpython.com/index.html) as something worth checking out as a follow up the LPtHW. I found IWP first and it was informative, but even with it as a starting base, I've learned soooo much more from LPtHW. Could just be me though. *shrugs*

Seerow
2013-05-09, 11:48 AM
cant imagine spending any money on a book for python or java, when there are SO many good online resources.

I mean it. The python course at my university doesnt even offer a book, its just the teachers notes and some online resources and off you go.

Same here. When I took Java, the professor just gave us a link to the javadocs and said that was our textbook.

Zahhak
2013-05-09, 12:38 PM
Yeah, those aren’t gonna give you much of a leg up on Java. They are completely different animals in completely different phyla.

I didn't think so. Part of why I wanted to learn Java: I keep hearing its nice and simple.


Some additional material on the basics of Object Oriented Programming might be helpful.

I think college actually has a course in OOP. Might have to take it before I do anything too radical.


After you have a handle on how to work a programming language, transitioning to Java should be a simple matter.

Thanks.

Shhalahr Windrider
2013-05-09, 05:37 PM
Same here. When I took Java, the professor just gave us a link to the javadocs and said that was our textbook.

Thas of course assumes you already understand enough about programming to make heads or tails of the docs.

Even then, the last time I used the javadocs, they were mostly definitions of the properties and methods. Which aren’t very useful if you don’t know how to use them. Especially for more abstract classes.

Grinner
2013-05-09, 05:42 PM
Seeing as I never actually completed them, I'm hesitant to suggest the official Java tutorials (http://docs.oracle.com/javase/tutorial/), but the ones I did were very informative.

Emmerask
2013-05-09, 06:14 PM
Seeing as I never actually completed them, I'm hesitant to suggest the official Java tutorials (http://docs.oracle.com/javase/tutorial/), but the ones I did were very informative.

They are good enough for the basics, after that the docs will make enough sense... and then learning by doing is the best approach imo.

And if you have some more complex questions besides the Programmers in the Playground thread there is also www.stackoverflow.com whcih is the single greatest resource for any programmer :smallwink:

horngeek
2013-05-11, 05:25 AM
If you just want to learn a language to get your foot into programming, rather than for a specific purpose, Processing (http://www.processing.org/) is much easier to pick up than Java, being essentially a library that takes care of the annoying painful stuff (main method, creating windows) for you. The syntax is the same, and if you must have a book, then this one (http://shop.oreilly.com/product/0636920000570.do) (written by one of the language's creators) is a great resource.

After you have a handle on how to work a programming language, transitioning to Java should be a simple matter.

I will back this unreservedly, as Processing is my primary programming language- I might be biased, due to the University unit where I learnt it being one of only two units I really did well in at university.

But yeah, once you've learnt Processing, it's fairly easy to transition to Java from there.

(Also, don't confuse Java with JavaScript. :smalltongue:)

TuggyNE
2013-05-11, 05:59 AM
I didn't think so. Part of why I wanted to learn Java: I keep hearing its nice and simple.

Ahhhh, not exactly. Java is stuffed with boilerplate, and has some annoyingly tricky semantics buried in there. If you really want simple, Python will probably work a lot better, or try why's (poignant) guide to Ruby (http://mislav.uniqpath.com/poignant-guide/). Either of those will minimize most weirdness fairly well while still requiring (and therefore teaching) full normal programming reasoning.

Personally, I learned on QBASIC, and tried Java only after I'd mastered Visual Basic and learned a smidge of assembler. Never really loved it; it's too bland and C-like, and just not quite smooth enough. C#, VB.NET or Javascript are all probably nicer in their various ways, and I prefer all of them to Java. Maybe even PowerShell, if you don't mind a niche scripting language.

Java does have advantages over, say, C++ or C, or maybe Perl or PHP even, but I would never really call it "simple". Its target is "enterprise-grade" projects, basically, filled with architecture and class hierarchies and best practices and checked exceptions and automated build routines and IDEs. Not simple, except by comparison to the even greater hassle you have to go through to do all that in C++.

Shhalahr Windrider
2013-05-11, 11:46 AM
I will back this unreservedly, as Processing is my primary programming language- I might be biased, due to the University unit where I learnt it being one of only two units I really did well in at university.

I think I want to check Processing out now. :smallsmile:

Zahhak
2013-05-11, 12:22 PM
Stuff

I should have mentioned that my plan was to get a basic understanding of Java before taking a class on it at my college, which has Java, C++, C#, and VB. I keep hearing that VB is basically just for teaching has pretty much no real use.

TuggyNE
2013-05-12, 12:35 AM
I should have mentioned that my plan was to get a basic understanding of Java before taking a class on it at my college, which has Java, C++, C#, and VB. I keep hearing that VB is basically just for teaching has pretty much no real use.

Hrmm. VB (mostly VB6 and VB.NET) is one of the most widely-used languages in businesses (http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html), primarily because it does the job nicely. It's very definitely not a teaching-only language. (Lisp is one of the few that's better for learning than for using; nearly everyone who recommends learning Lisp recommends it for the enlightenment it brings, not because it's actually something for your resume as such.)

Of the languages listed, I'd recommend either C# or VB, personally; C# in particular is basically an alternate universe version of Java in which people with good sense were involved in the language design. (:smalltongue:)

However, I should also mention that, in the end, choice of language is not nearly as important as simple programming skill; switching languages takes maybe 4-8 weeks of moderate effort for most of it, and decent programmers will pretty much always learn more than one language, but learning good programming style and technique takes years to master.

Zahhak
2013-05-12, 11:22 AM
I feel like I've been lied to all of my life.:smallfrown:

Recaiden
2013-05-13, 06:40 PM
I didn't think so. Part of why I wanted to learn Java: I keep hearing its nice and simple.

You have been deceived. But it might still be good to learn.

I'm going to throw in another vote for Learn Python the Hard Way, I found it an excellent resource.

Zahhak
2013-05-13, 09:51 PM
Per this post (http://www.giantitp.com/forums/showpost.php?p=15214611&postcount=17), Python isn't the highest on priorities.

Emmerask
2013-05-14, 06:57 AM
If you have an android phone then
I would actually suggest (android) java, it currently is highly relevant and will remain so for a good while I think, it teaches you many best practices (like not doing extensive operations on the main thread etc)
and since its on your phone you can write lots of useful stuff for yourself (keeps the motivation high).

Overall its java (with a little less functionality you wont notice) but with xml ui instead swing which is made by the devil (seriously swing sucks :smallwink:)!

Zahhak
2013-05-14, 11:47 AM
I didn't understand the second half of that last sentence.

Upgrading soon though, so I'll look into that when I do.

Pyromancer999
2013-05-14, 11:57 AM
While not necessarily the best for actual learning, when you need to practice what you've been learning, you should go to CodingBat. It's got exercises for both Java and Python, and all my teachers in my computer classes have had us learn it.

Emmerask
2013-05-14, 12:20 PM
I didn't understand the second half of that last sentence.

Upgrading soon though, so I'll look into that when I do.

The user interface in java is mostly done with swing (library) which has functionality for buttons, tables, windows (not the os^^) etc etc

Android uses xml to define user interfaces for example this




<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black_semitrans">

<TextView
android:id="@+id/worldmap"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
style="@style/MainMenuText"
android:clickable="true"
android:onClick="onClick"
/>
<ListView
android:id="@+id/international_list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:dividerHeight="2dp"

/>

</LinearLayout>



which defines an interface which has a Linearlayout with a textview and a list...its easy and quite powerful. you then just say that this frame/fragment uses this layout resource.

I rather like how android handles it and have a strong dislike for swing (especially due to what happened in one project we did ^^)

/edit javaFx seems to be somewhat similar to android approach (I think) though I can´t say if its actually good or used at all in practice currently