I have been learning python for a year and I think I can code in python! I just need to work on projects to advance my skills. Lately I have been thinking to learn Java...so I took advice from my friends. They said I will have tough time learning Java because I have learned python before. They said I should have learned Java first and python later... maybe I messed up 😅😅
Is it true? Will it really be that difficult?😩
Python is my first language and I am thinking of learning Java now. Can I?! Please share your opinions
Thanks in advance 🤗🤗
Videos
Can I take the course for free?
Is this course really 100% online? Do I need to attend any classes in person?
How much math do I need to know to take this Specialization?
I would take a project you've implemented in Python and try converting it to Java. Since you already know basic programming fundamentals, it'll probably be easier if you take things you know how to do and figure out how you'd do the same sort of operations in Java (or whatever new language you want to learn).
In the end, the only way to learn to write code, is to write more code.
Java and C# will be less of a step away from Python than would C or C++ because Java, C#, and Python all have automatic memory management. A good Java book is Thinking in Java by Bruce Eckel. It starts at an introductory level, but also has a lot of depth.
The big difference with the language coming from Python is the fact that all variables are typed. The other hard thing with Java has to do with the bewildering array of Java APIs out there. The fact that you are interested in Android is an advantage here. After becoming comfortable with the core language, I suggest you start learning the Android API and focus on becoming an Android expert. I think Android will be a growing market for a while.
Good luck!
Hi! I’ve been trying w3schools and Codeacademy but when I try to program it I get so many errors. How could I improve my learning?
- Don't put everything into classes. Python's built-in list and dictionaries will take you far.
- Don't worry about keeping one class per module. Divide modules by purpose, not by class.
- Use inheritance for behavior, not interfaces. Don't create an "Animal" class for "Dog" and "Cat" to inherit from, just so you can have a generic "make_sound" method.
Just do this:
class Dog(object):
def make_sound(self):
return "woof!"
class Cat(object):
def make_sound(self):
return "meow!"
class LolCat(object):
def make_sound(self):
return "i can has cheezburger?"
The referenced article has some good advice that can easily be misquoted and misunderstood. And some bad advice.
Leave Java behind. Start fresh. "do not trust your [Java-based] instincts". Saying things are "counter-intuitive" is a bad habit in any programming discipline. When learning a new language, start fresh, and drop your habits. Your intuition must be wrong.
Languages are different. Otherwise, they'd be the same language with different syntax, and there'd be simple translators. Because there are not simple translators, there's no simple mapping. That means that intuition is unhelpful and dangerous.
"A static method in Java does not translate to a Python classmethod." This kind of thing is really limited and unhelpful. Python has a staticmethod decorator. It also has a classmethod decorator, for which Java has no equivalent.
This point, BTW, also included the much more helpful advice on not needlessly wrapping everything in a class. "The idiomatic translation of a Java static method is usually a module-level function".
The Java
switchstatement in Java can be implemented several ways. First, and foremost, it's usually anif elif elif elifconstruct. The article is unhelpful in this respect. If you're absolutely sure this is too slow (and can prove it) you can use a Python dictionary as a slightly faster mapping from value to block of code. Blindly translating switch to dictionary (without thinking) is really bad advice.Don't use XML. Doesn't make sense when taken out of context. In context it means don't rely on XML to add flexibility. Java relies on describing stuff in XML; WSDL files, for example, repeat information that's obvious from inspecting the code. Python relies on introspection instead of restating everything in XML.
But Python has excellent XML processing libraries. Several.
Getters and setters are not required in Python they way they're required in Java. First, you have better introspection in Python, so you don't need getters and setters to help make dynamic bean objects. (For that, you use collections.namedtuple).
However, you have the property decorator which will bundle getters (and setters) into an attribute-like construct. The point is that Python prefers naked attributes; when necessary, we can bundle getters and setters to appear as if there's a simple attribute.
Also, Python has descriptor classes if properties aren't sophisticated enough.
Code duplication is often a necessary evil in Java (e.g. method overloading), but not in Python. Correct. Python uses optional arguments instead of method overloading.
The bullet point went on to talk about closure; that isn't as helpful as the simple advice to use default argument values wisely.
Hey Python,
I learned Java several months ago in a highschool AP CompSci class and the way I learned it was through various projects / assignments the teacher assigned. I really liked this method of learning because I had a specific task or set of problems I had to solve so it made everything easy for me to do, my question is the following... Are there any lessons, assignments or projects online with a set of problems I'd have to solve but for Python? I want to learn python as soon as possible and find it easier to learn when I have something to do.
Also I should add that I know the basic Python syntax, I watched an hour long video that was meant for learning Python after learning Java.
Thanks in advance.
The benefit of python is that you can build the (dynamic) web application in the practical sense. You can build your own blog using framework, and start learning to design with CSS to make it prettier later. You can build the small content management site (microframework). If you build some of those, you can basically get a job somewhere pretty easily.
Could you link the video you watched please, I need more help with comparing how things work between Java and Python. Thank you
I just started a class today and found out i will be learning Python, how easy is it to transfer my skills into modding minecraft, Assuming I do well and actually learn to code in Python?
Note: I have never coded before, sorry if this is a noob question.
Every programming language you learn makes it easier to learn the next one.
Once you know how to program in general (for example in Python), IMO Java is fairly easy to learn. I came into Minecraft modding from mostly C background (and I'd say something like mediocre level or whatever, nothing close to an expert), plus some bash/PHP for hobby projects. I started modding/learning Java by reading through most of the official docs by Oracle, and then mostly just diving in and reading through tons and tons and tons of vanilla, Forge and other mods' code and figuring things out as I went.
As to Minecraft modding itself, I'd suggest reading through the official Forge documentation and then some up-to-date tutorials to get the hang of some basic concepts. After that, I'd suggest reading open/visible source mods' code to see how specific things can be implemented, ie. think of a feature that you'd like to implement or something that is close to what you want, then think of a mod (or something in vanilla) that has something similar, and see how they did it, and whether or not you can think of a better way to implement what you need.