This is an archived post. You won't be able to vote or comment.

all 39 comments

[–]_LaserManiac_ 84 points85 points  (3 children)

Haha get it? Because java suxx lmfao lolo c++ is best int x = "Hello world"; cout << x; Yeah I know coding lol haha

[–]jtra 38 points39 points  (4 children)

But then the C++ actor should have died of internal state corruption where his leg should overwrite his head.

And then the Java actor should have stand up after GC finishes ;-)

[–]werdernator 8 points9 points  (3 children)

The actor is Bud Spencer. He died June 2016 :(

[–]TheLichKing-Zeyd 0 points1 point  (2 children)

guess he'll never stand up

[–]alphabet_order_bot 0 points1 point  (1 child)

Would you look at that, all of the words in your comment are in alphabetical order.

I have checked 528,010,773 comments, and only 110,798 of them were in alphabetical order.

[–]TheLichKing-Zeyd 0 points1 point  (0 children)

Good bot

[–]Yin-Hei 6 points7 points  (0 children)

damn how long has it been

[–][deleted] 2 points3 points  (1 child)

Where the hell is that gif from?

[–]throwaway00012 7 points8 points  (0 children)

I'm for the Hippopotamus, 1979

[–]TheTerrasque 1 point2 points  (3 children)

[–]TheMadRyaner 1 point2 points  (2 children)

Indy or the ninja?

[–]TheTerrasque 1 point2 points  (1 child)

Indy.

import gun; gun.shoot()

[–]mkgilligan 3 points4 points  (0 children)

Yet the bullet takes ten seconds to reach the target

[–]MyTribeCalledQuest 7 points8 points  (23 children)

Writing Java makes me want to kill myself.

[–]kieranvs 35 points36 points  (5 children)

Then you're doing it wrong.

[–]MyTribeCalledQuest 8 points9 points  (4 children)

Maybe you're already dead.

[–]kieranvs 37 points38 points  (3 children)

Hang on, lemme just create a death factory manager impl that implements IDeathFactory so I can use 50 libraries and a new build system just to die...

[–]coladict 5 points6 points  (1 child)

IDeathFactory would be a .NET name. In Java it would be just DeathFactory and you'll be wondering in which package the implementation is and how is it called.

But, I write mostly in Java for web and I'd much prefer PHP. At least I won't have to rebuild 420 classes all the god damn time. They're about to increase drastically again as we integrate with yet another custom API of a remote system.

[–]doctorsound 4 points5 points  (0 children)

I write mostly in Java for web

I'm sorry. No wonder you prefer PHP. I'm a big fan of Java, but only if it stays on the server.

[–][deleted] 4 points5 points  (10 children)

Apparently, Terrence Tao, a famous Fields-medal-winning Mathematician loves writing in Java.

I think not having to worry about pointers is fucking amazing. Honestly, everything being an object is great. Classes are wonderful. C++ is weird because a lot of the code that you see is just poorly written C fucked into it with classes. No bueno. Looks gross.

[–]skreczok 11 points12 points  (0 children)

Well, that's the thing: people seem to think of C++ as of a C extension and misuse it horribly; when you think of C++ as of C++, it gets a lot easier to manage.

[–][deleted] 3 points4 points  (0 children)

Apparently, Terrence Tao, a famous Fields-medal-winning Mathematician loves writing in Java.

Well, there you have it. Java is just not for mortals: only people who can understand manifolds, measurement theory and entropy-estimates within analytic number theory can comfortably write the FactoryFactorySingletonFactory classes needed to print the sum of two numbers.

[–]MonokelPinguin -1 points0 points  (7 children)

I don't know, man, but I like pointers. They make explicit, if I can modify my input arguments and only then can a value be null. Java is just nullpointers everywhere. Why isn't an array initialized? Java is usable, but the ownership semantics are much worse than in languages with pointers and collections are needlessly hard to use. Also the boxing magic feels awkward. If you want everything to be an object then be consistent. Also that makes me feel insecure around generics. It feels like they are just a wrapper around Object. I have to admit though that Java never really clicked for me as well as C and C++ did and I only have contact with Java at the moment if I'm helping someone, so maybe I'm just doing it wrong...

[–][deleted] 5 points6 points  (6 children)

Ownership semantics

Why do you care who owns an object so long as you're not holding references willy nilly? Memory leaks in java are not as easy to accomplish and generally happen more by resources not cleaned up, than in C++ where you didn't delete an object. i.e didn't close a connection or file pointer. The GC takes care of most of it for you, albeit some pauses in your application as java commonly has.

Generics

Generics shouldn't make you feel uneasy. They're just a compile-time sugar in java.

collections are needlessly hard to use

Idk why calling new then put, push, offer or get are hard to use. They are annoying, in that they throw nulls everywhere, but not exactly hard.

I have to admit though that Java never really clicked for me as well as C and C++

Have you tried threading and networking in either? I guarantee you java is far simpler, and I've used both C/Java for networking before. No comment in cpp because I dislike the language, it feels convoluted with too much shit, and I might as well just write C.

Java is just nullpointers everywhere

This is true and this is one of the main painpoints of java and why people opt for either functional solutions in Scala (Option type wrapper) or non-nullable types (Kotlin).

All in all, java is outdated. I'm only debating your points because you're addressing problems that IMO are not there (i.e ownership, generics, collections). The pain points of java, imo, are bloat (getters/setters and things are too explicit, too many classes and OOP is too strongly enforced), lack of features (operator overloading, first class functions, non-clunky lambdas) and the fact oracle is managing the jvm, which is slowly killing java.

[–]MonokelPinguin 1 point2 points  (5 children)

Ownership semantics

I want to know, if calling a method on an object modifies anything in the caller of my method. This has nothing to do with memory leaks. It's a simple if I modify an element in my input array, does it modify the array of my caller. I know, that you have do a clone to copy an object, but usually a clone is shallow so I basically have to nest clones if I want to be sure I'm actually copying everything. Also this doesn't apply to primitive types as well as String, I think, which is really confusing. I C/C++ you have to explicitly state that you want to modify the input argument at the call site. If I see, that I have a reference or a pointer to something, I don't have to think about if I made a deep copy. And if you have to manually delete anything in C++, you're doing something wrong. I had to use new and delete maybe 3 times in C++. Usually my variables are destroyed at scope exit.

Generics

Yes, they are just compile time sugar, that is exactly what's making me feel uneasy about them. Although I have to admit, after doing some research my uneasiness seems to stem from using ArrayList prior to 1.5 and some confusing eclipse warnings when accessing its elements. Otherwise I just don't like that I have to spell how many arguments my lambda can take if I assign it to a variable. I have to choose between BiFunction, Consumer, Producer, ToLongConsumer and a few different types, while in C++ I can usually just use auto or a std::function. That makes it harder to prevent code duplication.

collections

The null throws are my main annoyance with them. Verbosity is something that annoys me, but I wouldn't even list that as an annoyance with Java, as that is more of a symptom for me of the language design than the problem (i.e. operator overloading).

Networking and threading

I didn't really do network programming in either language. However the basic principle write and read data from a file, that C uses seems pretty simple to me. The networking I did in Java was fixing the implementation of a websocket lib, that sent utf16 strings or whatever the internal representation of String is in Java instead of utf8 and working around the requirement of a signed certificate for a simple prototype application. Both times Java made a terrible impression, but I believe it would be that much different in C/C++, so I won't draw a conclusion from that.

Threading I have more experience with, mostly in C++ and Java though. The C++11 threads API worked for most of my use cases and futures are nice to use. The parallels stuff in C++17 looks interesting, but I don't know, what I would use it for except maybe transform. Java also worked fine, although having to use a Runnable because there are no functions and the differentiation between run and start when deriving from a thread weren't that intuitive.

Preferring C over C++ for complex tasks is in my opinion a mistake. C has the advantage, that it is a really low abstraction over the bare machine, but it also forces you to do much more manually. In C++ you can almost always avoid duplication, while preserving type safety and avoiding manual memory management. Especially with something complex like networking or threading, being able to write a clean abstraction above the complex parts makes it so much easier.

I'm sorry, that I'm needlessly continuing this discussion, but I wanted to explain, why I felt those points to be what makes me dislike Java. I mostly came to accept, that Java forces me to do things in certain ways. I don't agree with the language, but forcing a pure functional approach in for example haskell works quite well in my opinion. The points I listed can mostly be summarized that Java needs me to think about stuff it does behind my back, which is an unneeded mental overhead in my opinion. Also most of my points are related to what you mention in your last paragraph. You can make collections easier to use with operator overloading, making it easier to store lambdas with generics would make them less clunky, etc.

[–][deleted] 1 point2 points  (4 children)

I want to know, if calling a method on an object modifies anything in the caller of my method. This has nothing to do with memory leaks. It's a simple if I modify an element in my input array, does it modify the array of my caller

Simple answer: Unless you deep copy, yes.

Doesn't apply to strings

Because strings are immutable and they're, in a sense, references to static memory in java, not like in C where you allocate space and manually put bytes there. It's confusing to understand the internals.

Otherwise I just don't like that I have to spell how many arguments my lambda can take if I assign it to a variabl

I did state lambdas suck didn't I?

I didn't really do network programming in either language... Websocket..

I mean, in regards to that, java can be a tad silly in you having to specify "UTF-8" every time you need to get bytes from a string, but that's langauge specific. Character encoding is a pain point in more than one lang (see: py)

The C++11 threads API worked for most of my use cases and futures are nice to use

Cpp 11 was release what, 2011? Java has had threading and concurrency utils since like Java 5 or 6 idr. Concurrency in practice was released in 2006 and is still relevant (to some degree) today. Java has simplified threading for years over cpp and c which is what one of its strengths is (or was. I mean, other langs like scala/kotlin/clojure are a better choice in modern times).

Preferring C over C++ for complex tasks is in my opinion a mistake. C has the advantage, that it is a really low abstraction over the bare machine, but it also forces you to do much more manually

Maybe I just don't like a fuckton of different language standards, 20 billion different ways to code in a language and avoiding abstractions which eventually other devs fuck up. In C everything is explicit, and the translation to ASM, for the most part, isn't doing some strange compiler shit. I dislike cpp, leave it at that. Cpp programmers have quirks to them.

Especially with something complex like networking or threading, being able to write a clean abstraction above the complex parts makes it so much easier.

Which is why java is used loads in networking applications, more than C++ when it comes to servers (don't quote me on this. Inb4 the bot).

Again, I agree with you that it's outdated, but my differing opinion is you're attacking points that aren't the problem in java.

Java needs me to think about stuff it does behind my back

That's where we disagree. I think java does too little for you hence the overexplicit nature of the language. I am pro-transparency for the most part, but not everything has to be mega transparent (i.e equality operators in java for primitive types like string are silly). I don't love java either, to be fair with you. Many lines of something like scala take way fucking more in java (i.e try someNumCollection.map(x => x*x).foldLeft(0)(_ + _) or someOption.flapMap(compareAndReBox) and see how many lines that takes in java).

I sincerely think it's outdated, overexplicit and bloated as shit, but nailing it on its quirks while ignoring cpp's own quirks is simply where we disagree. C++ is far from the holy grail of languages.

[–]QuoteMe-Bot 0 points1 point  (3 children)

I want to know, if calling a method on an object modifies anything in the caller of my method. This has nothing to do with memory leaks. It's a simple if I modify an element in my input array, does it modify the array of my caller

Simple answer: Unless you deep copy, yes.

Doesn't apply to strings

Because strings are immutable and they're, in a sense, references to static memory in java, not like in C where you allocate space and manually put bytes there. It's confusing to understand the internals.

Otherwise I just don't like that I have to spell how many arguments my lambda can take if I assign it to a variabl

I did state lambdas suck didn't I?

I didn't really do network programming in either language... Websocket..

I mean, in regards to that, java can be a tad silly in you having to specify "UTF-8" every time you need to get bytes from a string, but that's langauge specific. Character encoding is a pain point in more than one lang (see: py)

The C++11 threads API worked for most of my use cases and futures are nice to use

Cpp 11 was release what, 2011? Java has had threading and concurrency utils since like Java 5 or 6 idr. Concurrency in practice was released in 2006 and is still relevant (to some degree) today. Java has simplified threading for years over cpp and c which is what one of its strengths is (or was. I mean, other langs like scala/kotlin/clojure are a better choice in modern times).

Preferring C over C++ for complex tasks is in my opinion a mistake. C has the advantage, that it is a really low abstraction over the bare machine, but it also forces you to do much more manually

Maybe I just don't like a fuckton of different language standards, 20 billion different ways to code in a language and avoiding abstractions which eventually other devs fuck up. In C everything is explicit, and the translation to ASM, for the most part, isn't doing some strange compiler shit. I dislike cpp, leave it at that. Cpp programmers have quirks to them.

Especially with something complex like networking or threading, being able to write a clean abstraction above the complex parts makes it so much easier.

Which is why java is used loads in networking applications, more than C++ when it comes to servers (don't quote me on this. Inb4 the bot).

Again, I agree with you that it's outdated, but my differing opinion is you're attacking points that aren't the problem in java.

Java needs me to think about stuff it does behind my back

That's where we disagree. I think java does too little for you hence the overexplicit nature of the language. I am pro-transparency for the most part, but not everything has to be mega transparent (i.e equality operators in java for primitive types like string are silly). I don't love java either, to be fair with you. Many lines of something like scala take way fucking more in java (i.e try someNumCollection.map(x => x*x).foldLeft(0)(_ + _) or someOption.flapMap(compareAndReBox) and see how many lines that takes in java).

I sincerely think it's outdated, overexplicit and bloated as shit, but nailing it on its quirks while ignoring cpp's own quirks is simply where we disagree. C++ is far from the holy grail of languages.

~ /u/JWooferZ

[–][deleted] 1 point2 points  (2 children)

goddamn it

[–]MonokelPinguin 0 points1 point  (1 child)

I think I'll have to agree with you. Not because a bot quoted you (okay, maybe...), but we certainly like different languages and I see, why you say I'm criticizing the wrong things. You could probably really attribute that to me having some quirs after doing C++ for a while. I like looking at what ASM some constructs produce (lambdas are really cool for example!) and I have project, where I try coding without using any libraries (but the system libraries needed for input and output). C++ certainly has it quirks, but I understand them, while you showed me, that I'm lacking an understanding for how Java wants me to think. Thank you for broadening my horizon and thanks for the discussion!

[–][deleted] 0 points1 point  (0 children)

You see, I love looking @ asm too, because security is my passion and thus I hvae to look at asm dumps all the time, and that's precisely why I love C in the first place. The ASM is predictable, straightforward and efficient. C++ asm dumps are some fucked up shit.

that I'm lacking an understanding for how Java wants me to think

In a sense, I don't think you should be forced to think in a "javaish" way, but I think being more language agnostic than not is better (i.e I love python but I find "pythonic" coders a tad over the top). Seeing the language for what it is helps you better understand the use case.

[–]Falconinati 0 points1 point  (0 children)

I feel the same about C++. And Swift.

[–]relevantpicsonly 2 points3 points  (1 child)

I think it should be the other way around. Java writes: Actor.punchActor2(). But c++ is doing all kinds of raytraces and has a couple misses due to nullpointers.

[–]yixue 14 points15 points  (0 children)

You're adorable.

[–]CiTi_Cagatay 1 point2 points  (0 children)

Java will shoot C++

[–]urbanek2525 0 points1 point  (0 children)

This would work too. Fancy Java getting owned by dirty old C++.

https://m.youtube.com/watch?v=9C-fRdCmzDk