I've been writing Java for the last couple of years , and now I've started to write in python (in addition).
The problem is that when I look at my Python code it looks like someone tried to hammer Java code into a python format , and it comes out crappy because - well , python ain't Java.
Any tips on how to escape this pattern of "Writing Java in Python"?
Thanks!
Although Java is faster, Python is more versatile, easier to read, and has a simpler syntax. According to Stack Overflow, this general use, interpreted language is the fourth most popular coding language [1].
Python is more productive language than Java. Python is an interpreted language with elegant syntax and makes it a very good option for scripting and rapid application development in many areas.
Java is a statically typed and compiled language, and Python is a dynamically typed and interpreted language. This single difference makes Java faster at runtime and easier to debug, but Python is easier to use and easier to read.
Besides, nowadays, artificial intelligence and automation-related jobs are more in the market; thus, preferring Python over Java is more. Therefore, if you are going to start your career by learning any programming language, then learning Python will be easier for you that will even help you to find a job easily.
You might consider immersing yourself in the Python paradigms. The best way is to first know what they are then explore the best practices by reading some literature and reviewing some code samples. I recommend Learning Python by Mark Lutz; great for beginners and advanced users.
You'll do yourself a great injustice if you program with Python and fail to leverage all of the built-in, developer-friendly, Pythonic syntax.
As my French teacher used to say, "French isn't just English with different words."
If you are new to Python and coming from Java (or C#, or other similar statically typed OO language), these classic articles from PJ Eby and Ryan Tomayko are necessary reading:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With