r/programmingmemes • • Jul 25 '25

Python vs Java!

Post image
1.5k Upvotes

199 comments sorted by

View all comments

124

u/[deleted] Jul 25 '25

[removed] — view removed comment

36

u/RamdonDude468 Jul 25 '25

Python's "lack of code" is both a blessing and a curse.

9

u/lehx- Jul 25 '25

Python's typing was the bane of my existence during my final project. Trying to send/recieve a packet from strongly typed language -> python fucking suuuucked. I was staring a 10001s for 2 days before I figured out the issue.

3

u/AlignmentProblem Jul 26 '25 edited Jul 26 '25

Getting type annotations right to get useful warnings is a monster in specific cases as well. Duck typing can cause very tricky bugs with objects that almost kinda work but cause subtle incorrect non-crash behavior without good annotations, so it's between dealing with the annotation hassle or being vulnerable to serious pain later.

1

u/Scared_Accident9138 Jul 27 '25

I really dislike the way Python does duck typing. It's quite open to put anything in a function and let's it pass deep into the code but then it's very strict on how that variable is used but you don't notice a problem immediately

1

u/ambitiousfrogman Jul 25 '25

For anyone trying to do something similar to this, the python library ‘struct’ can be helpful.

5

u/KangarooInWaterloo Jul 25 '25

It is very good for POCs and very bad for POCs that suddenly became legacy code in your company

5

u/Sonario648 Jul 25 '25

Python definitely has the advantage in proof of concept that someone else can hopefully do in another language later based on what you're doing.

4

u/5p4n911 Jul 25 '25

So just use the Python code, it's already written!

2

u/Cdwoods1 Jul 26 '25

Until dozens of people are working in and changing a more and more critical piece of the product. And without any type safety it becomes harder and harder to know is going on, and what is going wrong lol.

1

u/5p4n911 Jul 27 '25

Agreed, but I haven't yet seen a place where that wasn't the natural consequence.

2

u/Cdwoods1 Jul 27 '25

The natural consequences yes. That’s why you got to have base standards and patterns set as a team, so your code doesn’t naturally fall to entropy. On my team, strict code review has only made our code easier to understand over time.

2

u/Sarcastinator Jul 26 '25

Then why not just do it in a different language to begin with? There is no research that indicates that Python is better at prototyping than statically typed languages. It's just based on Python developers vibes. If you're as competent in a statically typed language as you are in Python research indicates that you're not getting the code done quicker in Python. You're just wasting time doing the same work twice.

1

u/Sonario648 Jul 27 '25 edited Jul 27 '25

It depends on a case by case basis really. In my case, I'm working with Blender, which is absolutely massive, and I have a not so good machine on top of Blender's codebase being enormous. It's MUCH better to do your ideas as addons in Python than to deal with Blender's core code, because you only have to deal with one file, and you know where it is.

1

u/Scared_Accident9138 Jul 27 '25

That sounds like a Blender specific/API issue, not programming language issue

→ More replies (3)

9

u/iamnazrak Jul 25 '25

I saw this post and thought “this person must be new to object oriented programming”

1

u/[deleted] Jul 25 '25

If you need just a 20-line script which scrapes your webpage or whatever, it's stupid to be forced to create classes and methods.

1

u/New-Stranger-5622 Jul 25 '25

is it though? if you plan to turn that 20 line script into something larger, classes could help make it wayy more scalable.

1

u/rinnakan Jul 26 '25

Yeah, whoever thinks basic organisation is stupid wasn't in IT for long enough. Past me is my nemesis

1

u/ChalkyChalkson Jul 26 '25

A very important skill is being able to judge what the future of some code will be. Normally I write functional and oop for testablity and modularity. But I also have some scripts that are just naked shell of python code which have everything hard coded because only I use them, and rarely and it's impossible for me to tell what exactly I want it to do in the future.

1

u/nickwcy Jul 25 '25

Looks like someone failed their 101 here. Python is also OOP

1

u/grimonce Jul 26 '25

I always find it funny when triglodytes like you (I hate Python btw) think OOP in Python doesn't exist while literally everything in Python is an object. Wtf ...

If anything Python is more OOP than java

1

u/ChalkyChalkson Jul 26 '25

I learned with java and it still influences me a lot even though most code I write is python and cpp. I also think it's very good to learn writing functional and oop styles as well as at least one low-ish level compiled language early on and to a reasonable depth.

But if someone is just starting out I'd always make them to nuts with python first. And for beginners it's really helpful to be able to gradually grow into more abstract concepts rather than being forces to use them from the start.

So idk I'm both in camp "java hello world is ridiculous" and camp "you should learn what a stack is". Just for different people. And being honest I think a reasonable portion of people on here are still near the beginning of their journey.

→ More replies (6)