888
Languages (lemmy.ml)
you are viewing a single comment's thread
view the rest of the comments
[-] Lysergid@lemmy.ml 18 points 2 weeks ago

Can anyone actually tell what exactly complicated in Java? Verbose, maybe it was at some point but I find it very straightforward and easy.

[-] houseofleft@slrpnk.net 8 points 2 weeks ago

I think a lot of it is "ceremony", so it's pretty common in java to:

  • create a get method for every object variable
  • create a set method for every object variable

Then add on top that you have the increased code of type annotations PLUS the increased code of having to check if a value is null all the time because all types are nullable.

None of that is hugely complicated compared to sone of the concepts in say Rust, but it does lead to a codebase with a lot more lines of code than you'd see in other similar languages.

[-] houseofleft@slrpnk.net 4 points 2 weeks ago

Before someone says it, I know a lot of this stuff doesn't need to be done. I'm just giving it as examples for why Java has the rep it does.

[-] WhyJiffie@sh.itjust.works 3 points 2 weeks ago

i still don't understand. is it easier in python or JS to make getters and setters? with python my experience has been the opposite, with the decorator based solution in mind.
or if the problem is that they exist, as an option to be used, why is that a problem? they can be implemented in any other language, and it can be useful.

then yeah, you should check for nulls. just like for None's in python, or if you have the correct type at all, because if it's entirely different but ends up having a function or variable with the same name then who knows what happens.
then in javascript besides null, you also have undefined and NaN!

[-] houseofleft@slrpnk.net 2 points 2 weeks ago

It's not easier to do getters or setters but especially in python there's a big culture of just not having getters or setters and accessing object variables directly. Which makes code bases smaller.

Same with the types (although most languages for instance doesn't consider None a valid value for an int type) Javascript has sooo many dynamic options, but I don't see people checking much.

I think it boils down to, java has a lot of ceremony, which is designed to improve stability. I think this makes code bases more complex, and gives it the reputation it has.

[-] WhyJiffie@sh.itjust.works 2 points 2 weeks ago

I think it boils down to, java has a lot of ceremony, which is designed to improve stability. I think this makes code bases more complex, and gives it the reputation it has.

I'm not a java programmer, but I like it more because python and js projects are often very messy

[-] houseofleft@slrpnk.net 1 points 2 weeks ago

Yeah, that's my experience too. I think once projects get to a certain size, you really reap the benefits of strong opinions, regardless if what those opinions are.

[-] WhyJiffie@sh.itjust.works 2 points 2 weeks ago

i still don't understand. is it easier in python or JS to make getters and setters? with python my experience has been the opposite, with the decorator based solution in mind.
or if the problem is that they exist, as an option to be used, why is that a problem? they can be implemented in any other language, and it can be useful.

then yeah, you should check for nulls. just like for None's in python, or if you have the correct type at all, because if it's entirely different but ends up having a function or variable with the same name then who knows what happens.
then in javascript besides null, you also have undefined and NaN!

load more comments (13 replies)
this post was submitted on 25 Sep 2024
888 points (87.4% liked)

Programmer Humor

19315 readers
39 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS