Start with Python, without any doubt.
Python can make huge difference for beginner. I remember that child of one of my friend spent few weeks in a summer camp learning Java or C++, and got really confused and not sure anymore he wants to study computers. I started Python interpreter and shown him how easy things can be, and I remember the smile on his face which explained everything.
Python is much easier to start with, for several reasons:
- dynamic typing: if type of your variable is OK (which usually is), things “just work”). In Java, types are much more complicated and messy.
- interpreter, which allows you to program “one line of code at a time” and try expressions without the need to write small program to test concepts, like you have to do in Java
- huge library of convenient functions, called “batteries included”
- debugger which allows you trivially examine you objects and which methods they have. So instead of spending hours reading docs, you can experiment in your code
- lots of free online resources for learning the language, including excellent online courses, some even using “python in your browser” approach, so yo don’t even need to install Python
- Python is first language designed to be read by human as first priority
- Python code can be procedural (easiest to start with and comprehend), object-oriented or functional. You can start with simple procedures, and using existing Python objects will satisfy your needs for long time. In Java, objects are the only way.
Java objects are often they are confusing: in example, there are multiple integer types:
Integer (which is object), and
int, which is not. I’ve seen the confusion it caused to beginners first-hand, and few more, with different precision (how many digits they can hold). Using wrong type in Java will cause compile-time or worse runtime error. Python has just one integer type, and will convert internally to whatever precision you need. Same with array size: If your data increased and will not fit, Java will have runtime error, Python will double the array size.
Python is excellent also for many tasks for which Java is not a good fit: small little programs to manipulate files, parse and analyze text files like log files, to automate system administration tasks.
Python was designed for people who are not experts in computer science/engineering, and need a language which works hard to help them to solve their problems.
Disclaimer: Obviously, there is no silver bullet. Even in Python, if you use wrong type, you will get runtime error.