views:

725

answers:

12

Of the two which one would exposed someone just learning to program to more computer science concept/problems?

+3  A: 

Mu

hop
tell you what, this should be a tag.
hop
+7  A: 

Neither. Try Scheme. Or Haskell. or C. or a book.

Breton
+6  A: 

Neither language will expose a student to computer science concepts. That's up to the instructor (or motivated student) – where will they take the learning experience?

[I'm assuming here that by "computer science", you mean algorithms and data structures (and related topics); if instead you mean things like pointer arithmetic and knowing the difference between a short, an int, and a long, then java will be closer than python.]

John Fouhy
+14  A: 

It's not about the language, it's about what you do with it. You can learn about virtually any CS concept in either Python or Java (or anything else), although there are definitely some concepts that are much better suited for one or another - for example, functional programming (e.g. the map and reduce functions) and metaclasses in Python, or graphics programming in Java. Having worked with both, I do think Python would give you an easier learning curve to programming in general, so I'd start with that, keeping in mind that it will be to your advantage to get experience in both Python and Java (and other languages, like C and/or C++) in the long run.

David Zaslavsky
+4  A: 

Computer Science is fairly language agnostic. Both Python and Java support multiple programming paradigms. Python supports object-oriented, imperative, and functional, while Java supports object-oriented, imperative, and structured. Python is dynamically typed while Java is statically typed.

I could go on and on listing similarities and differences, but the bottom line is that if you want to learn a lot of CS concepts, you should learn multiple languages. Either Python or Java would be a good place to start. Python is probably an easier language to learn, so I would start with it.

Bill the Lizard
+2  A: 

C <--

Alex Baranosky
+1  A: 

Clojure or Haskell

Rayne
+2  A: 

I learned C++ first and can't think of a better learning tool. If you want to learn CS rewrite the STL.

Michael
+1  A: 

You have mentioned computer science concepts but that is too vague. IMHO you need to define what concepts you want to learn (say is it algorithms or OO design) and then work with either Java or Python to strengthen those concepts.

If you intend to learn design patterns then I would suggest Java (at least for the reason there are lot of good books, reference materials on the net in this regard). On the other hand Python would be better when you want to quickly code an algorithm or if you want to try out your solution on a problem you came across. With Java you need to get familiarized with lot of API even before you get stared writing moderately complex programs.

sateesh
Well you can use design pattern with Python too. Infact Bruce Eckel has written a book about it. http://bitbucket.org/BruceEckel/python-3-patterns-idioms/
jpartogi
+1  A: 

Strictly speaking neither language is going to help much with computer science concepts, if by this we mean algorithms, data structures and the like. Such things are largely independent of language However there are some programming concepts which are not language independent. Joel talks a fair bit about this in "The Perils of Java Schools, and he at least isn't impressed with either of these languages for teaching. He thinks that understanding pointers and recursion are essential to making a good programmer (I'm with him at least part of the way) and neither of these force you to do that.

DJClayworth
In general I agree with your point, but I have one small nit: both languages offer the opportunity for learning recursion, although I suppose they don't necessarily *force* you to do so. If you're interested in being forced into recursion, I suggest Scheme, but then there are no pointers there.
Jeff
+1  A: 

Just pick one language, and start learning by solving a problem most relevant to you. I don't think that a debate is needed in which language should you learn first.

Selinap
A: 

Pick the one you like. The important thing is not stop learning or giving up because every language you learn will make you a better coder. Lots of knowledge are common between them. Of course there are lots of differences, but do not mind them yet. No language is perfect, or no language is the solution for all problems. Lots of people like me find Python easier, so I would pick that. For starters, there is a free Python e-book at http://www.diveintopython.org/.

Furthermore, you can check the following link http://www.hanselman.com/blog/ProgrammerIntentOrWhatYoureNotGettingAboutRubyAndWhyItsTheTits.aspx.

Caglar Toklu