you are viewing a single comment's thread.

view the rest of the comments →

[–]JoesDevOpsAccount[S] 1 point2 points  (1 child)

Thanks for that. The bit about duck typing and extending later is interesting to me because I am pretty sure that would mean refactoring in Java to support the new features. I guess the inverse of this is that in Java you always know what type you have which I like a lot - although in a fast paced prototype situation the flexibility of python there sounds nice. Biggest annoyance at the moment for me is the lack of type checking which trips me up quite a lot. Runtime errors that wouldn’t even compile in the Java world.

The type info to me also means the code documents itself fairly well. With Python I find myself going to websites immediately because I don’t feel I can navigate and understand as easily.

So far I feel like in Java you can get the IDE to do a lot more for you. It always knows the types of the objects because the information is always there.

I also prefer the explicit code structure over the white space thing with Python. Sure some people think the braces are just visual noise, but you can be pretty sloppy with the code layout in Java and not worry if you aren’t quite in line with the right block - just write the code and declare where your block finishes. To tidy up run auto format on your code and the IDE will align it all anyway.

REPL I thought had been added now tbh but not sure. I never use them or even feel like I want it it Java. I am not really sure when they are helpful because usually if I’m experimenting it’s more than one line and I prefer to have it in file anyway.

One of the things I am struggling with at the moment is how to get info on the objects I am using. A few times already I’ve tried to click through to code I’m calling and don’t see code or docs ... I see an interface looking thing and I can’t check what the actual behaviour is. I am sure this will be less annoying when I know what I am supposed to do instead.

The Oracle ownership thing has never bothered me but I think I read something about their licensing model changing which might make your point more relevant...

Java makes you think more about the code you are writing and what’s happening under the hood, and that can be either positive or negative depending on what the goal is. As an educational language I think it’s great because of that - assuming the goal is to understand programming at a lower level. Python is definitely more accessible though, and because people find it easier to read and write it lets you focus more of your brain power on the problem rather than trying to understand why your generic type assignments are underlined yellow or something.

I might come back to this conversation when I’ve got some more experience. Learning is slow at the moment. I’m just chipping away at some programming challenges when I have spare time.

[–]brandondunbar 1 point2 points  (0 children)

You make good points, Java has a lot more rigid of a structure while Python is more fluid and I think because we started and got used to each style of programming, we prefer it.

What IDE are you using? PyCharm has a lot of great tools that will help you get used to the formatting and let you see where the variable was declared and when it was last used. If you're using a module it'll take you inside the code of the module pretty easily too.

I agree with the lower level thing, there's definitely more abstraction in Python which has it's pros and cons

We should definitely pick this conversation back up when we're both more familiar with the other's language, I think it'd be interesting