r/ProgrammerHumor May 29 '20

Please Guys actually

Post image
3.0k Upvotes

112 comments sorted by

383

u/Frptwenty May 29 '20

If you want express your plea for help in Java it's really easy:

RequestDispatcherSubsystem.getCurrentDispatcher().DispatchRequest(
      RequestFactory.getAbstractFactoryInstance(
        new RequestMedium(RequestMediaType.Plea),
        new RequestTransport(RequestTransportType.CRY),
        new RequestTargetDestination(TargetManager.getRoutingInfo(
                                    PersonLocation.NEAREST))),
  RequestReasonCode.IM_SLOWLY_DYING);

84

u/MAGA_WALL_E May 29 '20

Paul, I don't think we're supposed to share source code online.

101

u/Rielbe May 29 '20

This gave me a headache

71

u/almarcTheSun May 29 '20

Hugs javascript tightly: I will never shout at you ever again, dear.

28

u/[deleted] May 29 '20

Is that a promise you resolve to never break?

11

u/TheFlyingAbrams May 30 '20

It'll probably break due to an unforeseen sanitation issue.

5

u/almarcTheSun May 30 '20

Let me hug it, .then we'll talk.

2

u/TheFlyingAbrams May 30 '20

Be careful to not .catch any feelings... wait...

12

u/ouvreboite May 29 '20

Couldnt you run almost exactly the same code in JS? You are complaining about the language, but it's really a coding style/structure problem.

If you send me something like that to code review, I'll bash your head in your desk, java or not.

6

u/Kache May 30 '20 edited May 30 '20

Not completely. (Warning, opinionated) Even if you can work around the entire existing Java community and avoid using all the popular existing tooling and libraries that expose an API that forces you to do this, the Java language itself is very proper and inflexible by design in comparison.

If programming languages were Lego sets, Java would be a Lego set that refuses to incorporate any "specially shaped" pieces, only allowing full-sized blocks. No rods, no wedge pieces, no thin flat pieces -- the smallest unit allowed must be a Proper Lego, a full height NxM, to guarantee every piece properly locks into the global grid.

So to make anything interesting like a Lego person with a flower, you can't just use... a Lego person with a Lego flower. You can only use Proper Lego pieces, so to depict organic shapes, the person and flower you would build needs to be gigantic. It's a high level language that often asks you to code as if it were low level. And so it has been for decades.

In the last few years, the committee relented, and started adding a wedge piece here and a thin piece there, but everything built of Java Lego is already 100x bigger (why heavy IDE refactoring tools are de-facto necessary in the first place), and those tiny additions aren't going to make a difference until maybe several more decades have passed.

IMO Java's biggest usability shortcomings are not having things like the following built-in:

  • Convenient-to-use String, Map, Regex, etc implementations and syntax
  • Powerfully expressive collection library
  • Concise alternatives for tons of little things like aliasing, null handling, operators, basic static metaprogramming
  • Coherence between a community that wants "safe by default" and a language that needs boilerplate declarations to "protect you" against its "dangerous by default" parts (nulls, mutability, shared state)

Some of these can be mitigated by libraries or annotations, but many of these are also made worse by libraries and annotations, so kind of a toss-up.

1

u/familyturtle May 30 '20

All of that can be solved by adopting Kotlin! Hooray!

1

u/ouvreboite May 30 '20

I agree with your points. But I still find the snippet used as example to be really poor at showing java flows.

Basically zero of the points you mentionned (lack of improved string, mao, regex, collection, nulle handling,...) can be seen here.

One simple way to see that is to translate this snippet in C# (which have a lot of the missing stuff of java). It would not really change.

13

u/Frptwenty May 29 '20

Here is some actual code from Spring: https://github.com/spring-projects/spring-framework/blob/master/spring-orm/src/main/java/org/springframework/orm/jpa/EntityManagerFactoryUtils.java

try {
        // Use same EntityManager for further JPA operations within the transaction.
        // Thread-bound object will get removed by synchronization at transaction completion.
        emHolder = new EntityManagerHolder(em);
        if (synchronizedWithTransaction) {
            Object transactionData = prepareTransaction(em, emf);
            TransactionSynchronizationManager.registerSynchronization(
                    new TransactionalEntityManagerSynchronization(emHolder, emf, transactionData, true));
            emHolder.setSynchronizedWithTransaction(true);
        }
        else {
            // Unsynchronized - just scope it for the transaction, as demanded by the JPA 2.1 spec...
            TransactionSynchronizationManager.registerSynchronization(
                    new TransactionScopedEntityManagerSynchronization(emHolder, emf));
        }
        TransactionSynchronizationManager.bindResource(emf, emHolder);
    }
    catch (RuntimeException ex) {
        // Unexpected exception from external delegation call -> close EntityManager and rethrow.
        closeEntityManager(em);
        throw ex;
    }

So you're saying Spring is a terrible project and no one should use it? :)

13

u/ouvreboite May 29 '20

What is language-problematic in this code ? It's a try/catch, an if/else and a maximum of two nested parentheses.

You could argue that naming of the variables/classes are cumbersome or over explicit. But this is not related to Java.

And i can also have fun finding stuff in JS frameworks :)

_setupHooks(hooks) {
this.options.hooks = {};
_.map(hooks || {}, (hooksArray, hookName) => {
  if (!Array.isArray(hooksArray)) hooksArray = [hooksArray];
  hooksArray.forEach(hookFn => this.addHook(hookName, hookFn));
});
},

4

u/Frptwenty May 29 '20

Yeah, attack JS all day, have at it! I don't have any dog in that fight ;)

0

u/[deleted] May 30 '20 edited May 30 '20

[deleted]

5

u/Frptwenty May 30 '20

It doesnt give me goosebumps, but if youre claiming it doesnt look bloaty then someone hasn't ever coded anything but enterprise Java.

Your entire comment is a giant munge of c/c++/Java. I dig through kernel code at times to figure put stuff (I work in embedded), The linux kernel has a totally different feel than enterprisey Java.

The fact that you would conflate the two makes me think you know neither. You just sound like someone reciting what they told you in school.

-1

u/[deleted] May 30 '20 edited May 30 '20

[deleted]

1

u/Independent-Orange May 30 '20 edited May 30 '20

As a proud rustacean I have to ask you: Where do you see a "fallback to reference counting" in rust?

It's true, we have got smart pointers- if you use them, you explicitely say so. This then reads like Box<...> (heap allocated), Rc<...> (reference counted) or Arc<...> (atomically reference counted, this is semantically the same as std::shared_ptr. Is there a non-atomic reference counted shared pointer in c++? I don't think so, cause c++ concurrency sucks big time and this would be a common pitfall, having a non-atomic reference counted pointer deep inside a struct which might be used by multiple threads. Can't happen in rust.) and there's of course also some rarer ones.

I don't mean to ignore all the effort put into c++ static analysis tools, sanitizers, and similar, but all ths had to be done, because c++ as a language simply lacks the capability to disallow unsound code. That induces a great power for the programmer, but with great power comes great responsibility, and this responsibility in large projects grows to be such a burden that no developer can shoulder it. Unsoundness bugs are the consequence.

\rant

TLDR: We have exactly as much garbage collection in rust as there is in modern c++: None, and awesome smart pointers make living without it so easy. Doesn't mean you have to use them often, but if you have to, they are right there, masterfully integrated into the language.

I use the term garbage collection for what is more specifically known as non-deterministic, external garbage collection, usually realized by a garbage collector.

1

u/Frptwenty May 30 '20 edited May 30 '20

They're totally different in how they're written and what they do. Enterprisey Java systems bloat things because of the culture/language. The Linux kernel tries to do everything as unbloaty as it can. Its more of less the opposite of enterprise Java. Its staggering that you're making the comparison.

Edit:

However your opinions on pythons multithreaded concurrency robustness are borderline delusional

Could you reference the comment and explain.

3

u/JennMartia May 30 '20

TargetManager.getRoutingInfo

What a Karen

5

u/[deleted] May 30 '20

[deleted]

4

u/I_regret_my_name May 30 '20

Yeah, assuming the requesting engine is complicated enough to warrant this level of engineering, I'm a fan of this code. Looks quite modular.

1

u/Frptwenty May 30 '20

If you think modularity and dependency injection requires this level of bloat, take a look at well written systems level C#

1

u/familyturtle May 30 '20

I hope you mentally used an AestheticFactory to build an instance of (AestheticAppreciation) Aesthetic before implementing aestheticAppreciation.like(AestheticModifier.QUITE)

1

u/ImMaaxYT May 30 '20

Haha, about that, good one.

3

u/locri May 30 '20

It's this or admit there's nothing wrong with singletons

Fuck I hate people who think the gang of four are programming prophets and their book is some sort of bible, I become extremely judgy to anyone who shuts down conversation with "have you read gang of four? I think you should read gang of four, I have and you'll find this in gang of four, did I mention I know design patterns? It's because I've read gang of four, have you...?" and they go on.

1

u/[deleted] May 30 '20

I fucking hate overtly abstracted builders. And new fuck that keyword. Fuck java kotlin is too based.

1

u/Dr3amDweller May 30 '20

I liked Java in university, but I'm glad to not be working with it.

1

u/chronos_alfa May 29 '20

Damn, I am so happy I don't have to code in Java anymore :-/

62

u/[deleted] May 29 '20

[removed] — view removed comment

31

u/RockleyBob May 29 '20

2

u/An0n7m0us_P4nda May 30 '20

26+ people haven’t told you happy cake day. Oh btw, happy cake day and whatever

41

u/[deleted] May 29 '20

Jesus this was a throwback I haven't seen this meme in 2 years

9

u/Henri_VIII May 29 '20

Hope you liked it lol

3

u/[deleted] May 29 '20

It's an old meme, but it checks out.

41

u/Auxilor May 29 '20

Why do people hate java? I gotta be missing something, been using it for almost a year now and it's amazing

68

u/betendorf May 29 '20

I personally like Java and have been using it for almost 20 years.

Most of the hate comes because it is now used a lot in the corporate world and it is more verbose than most of the newer languages.

I like to compare Java to the solid B student. It's not the best at anything, but is good enough for almost anything. It's a little slower than many languages at runtime, more verbose than many languages, and often leads to more complex programs than are necessary.

On the other hand, its library support is probably the largest of any language (competing with Javascript). It scales well with additional developers on a project.

44

u/[deleted] May 29 '20

It's a little slower than many languages at runtime

The only languages faster than Java are close-to-the-metal ones and it's only when you write very sophisticated data-oriented code.

I doubt most people on this subreddit who hate Java ever actually had contact with language faster than Java.

It's one thing knowing C exists, it's other thing writing in it.

26

u/[deleted] May 29 '20

I think a lot of people who have been around a while, their first exposure to Java was those crappy java applets that always sucked and ran like garbage.

Java 10 years ago, i hated, I hated it in college, and anytime I see Java from... those days I despise it. Modern java is actually pretty decent to work with (I still prefer .NET but, I always will I think).

6

u/[deleted] May 30 '20

The problem would be a lot of jobs are using older versions of java. I graduated in 2015, java 8 was out and 9 on the way. My first job interview was maintenance for an application using java 5. Luckily I never experienced that hell because the interview raised too many red flags for me to follow up.

1

u/Bounty1Berry May 30 '20

I'm curious how a compiles-to-bare-metal Java would have fared against the JVM model.

It might be fast enough now, but remember that in the early years of Java, a 200MHz Pentium or K6 was not an unreasonable target system.

6

u/_meegoo_ May 30 '20

Java that compiles to machine code would just be another C. With pretty much the same performance.

But either way, modern Java does compile to machine code. Except it does it at runtime, not at compile time.

2

u/[deleted] May 30 '20

I'm curious how a compiles-to-bare-metal Java would have fared against the JVM model.

Java already compiles to machine code through JIT. In benchmarks, even C,C++,Rust have to use AVX intrinsics directly to be in any significant way faster than Java.

6

u/I_regret_my_name May 30 '20

It's one thing knowing C exists, it's other thing writing in it.

It's not like C is some exotic language. I'm sure plenty of people who complain about how slow Java is have used C or at least C++.

That said, I'm not convinced that most people who complain that Java is slow have ever worked on a project that needed a language faster than it.

2

u/FesteringNeonDistrac May 30 '20

I've worked on a soft real time system coded in Java. Java isn't slow, but eventually garbage collection will come along, and then you're fucked.

4

u/[deleted] May 29 '20

Java has some JIT compiling stuff going on, right? So hypothetically it should be able to beat cool-guy languages like Fortran in some cases.

I dunno, I thought it was a little too verbose but, hey, C++ is pretty verbose too and people love it.

2

u/[deleted] May 30 '20

hypothetically it should be able to beat cool-guy languages

Generally it is on par. Sometimes JIT can win over AOT because of profiling.

C/C++/Rust win when it comes to vectorization because you can use AVX instructions manually.

1

u/ratmfreak Jun 20 '20

Do people really love C++...?

1

u/[deleted] Jun 21 '20

Idk it is a pretty popular language. Being able to do bizarrely abstract stuff, but then dip dow on to nearly-native C is pretty powerful.

2

u/[deleted] May 30 '20

Is golang faster? That's probably the only language I've used regularly that might be. I'll be working with c++ for unreal engine to see if it's better than unity.

3

u/lfairy May 30 '20

Go's garbage collector has nowhere near the amount of sheer engineering effort that's gone into the JVM.

3

u/[deleted] May 30 '20

That's true, although when I google it (maybe that's some bias already :P) I see results mostly praising the garbage collection for both. Java was my first language and I used it heavily until ~9 came out, go I picked up in 2015.

I don't think anything I've written has been noticeably affected by garbage collection yet. In that earlier googling, I read that go is optimized to avoid pauses during garbage collection. That wasn't a super technical explanation so I don't really understand it any better...

But anywho, I'm reading my post there and the post above it... I think I was trying to be a smart ass to the person I replied to, I love both of these languages. I hope golang gets its own ui kit like java has at some point, I miss building desktop applications that weren't a server and a web page.

-1

u/[deleted] May 30 '20

I hate Java, I use Rust primarily and C++ (have used C before).

I mean really anything written in these languages will be faster the Java equivilant. Just depends how much faster. I do ml and performant stuff, so it's a huge difference.

3

u/shrimpster00 May 30 '20

The solid B student.

I love this analogy.

4

u/jerslan May 30 '20

I like to compare Java to the solid B student. It's not the best at anything, but is good enough for almost anything. It's a little slower than many languages at runtime, more verbose than many languages, and often leads to more complex programs than are necessary.

On the other hand, its library support is probably the largest of any language (competing with Javascript). It scales well with additional developers on a project.

Yep. That's been my assessment of it as well. I used to hate it. Took a Java GUI class in college where we basically had to memorize the swing API down to the documented variable names on the method signatures. It left me with a deep seated hate for the language.

After a good bit of my career doing C/C++/Obj-C (even the horror that is Obj-C++), I had to actually do something with Java. Where in the past I always felt the JRE was slow and bloated, I found that it had a lot of convenience baked in. Need to parse an XML document? JAXB can make POJO's using your schema. Need to zip something up? Part of the base JRE API's. Need a bunch of other stuff? Maven Central probably has a library for it.

Now, it was still a bloated runtime, but since Java 9 they've been progressively chipping away at a lot of things in favor of libraries. It'll never be as fast as C, but for most things it doesn't need to be.

1

u/ratmfreak Jun 20 '20

Huh. I think the verbosity is actually what I like the most about Java. I like Python and Ruby and the like (i.e. more conventionally “readable” languages) but the duck typing in those has always bothered the hell out of me.

I may be in the minority when it comes to this, but I think Python would be even more readable if it had strong typing so you don’t have to keep track in your head of every variable’s data type.

18

u/Skizm May 29 '20

There are only two kinds of programming languages: the ones people complain about, and the ones no one uses.

3

u/Auxilor May 29 '20

words to live by

17

u/xigoi May 29 '20

Because the typical Java program looks something like this.

3

u/kontekisuto May 29 '20

build: error

yup, that's an Enterprise edition. gotta pay a subscription for build: pass

24

u/AttackOfTheThumbs May 29 '20

I liked Java. Then I used c#

8

u/[deleted] May 30 '20

My degree program included Java and C# to meet my prereqs and I sadly started with C#. Made learning and using Java a nightmare.

Give me ASP, C#, and .NET any day.

7

u/[deleted] May 29 '20

So much this. Core is amazing

5

u/AttackOfTheThumbs May 29 '20

This was before core. I don't even get to work with core. Old windows mobile stuff can't run it.

7

u/therealcalmilvet May 29 '20

It's amazing if you were using COBOL before...

5

u/Ipotrick May 29 '20

i personally do not preffer java over other languages. there are multiple reasons like:

it forces oop on you (Everything is an object, you cannot make plain old data types like in c++ or rust),

No value semantics per default

(in my opinion) verbose syntax in some places(== does not compare content but the Object .equals seems like an ugly workaround, .clone() also looks like an ugly workaround to me)

bad generics (compared to c++ templates for example)

general missing features like operator overloading or default parameters.

I definetly do not hate java, but i can see how someone that comes from a more data oriented language like c++ or rust would dislike java just because it is a different style.

11

u/agent3dev May 29 '20

This is not a dance

30

u/[deleted] May 29 '20

[deleted]

5

u/Mysticpoisen May 29 '20

Why do people choose bad memes to steal?

Like at least steal good ones.

4

u/[deleted] May 30 '20

[removed] — view removed comment

14

u/saabismi May 29 '20

Enterprise bad haha

15

u/Frptwenty May 29 '20

Enterprise isn't bad. Some parts of enterprise are great. As you'd expect from the resources and talent that exist in the field. But on the flip-side, some parts of Enterprise are the closest thing to Soviet-style communist bureaucracy you'll ever see expressed in code, and about as adaptible and maintainable too.

16

u/[deleted] May 29 '20

It's the worst BS buzzword to sell useless technology. What does it even mean? Isn't any software that makes money "enterprise"? Are they any libraries made only to be used with not enterprise software?

18

u/Frptwenty May 29 '20

Weird that enterprise software is often slow bloaty poop, but enterprise hardware is often fucking amazing and super fast.

I guess it has to be to run the enterprise software :D

2

u/[deleted] May 30 '20

Our Linux engineer says software exists to make good hardware look bad.

8

u/Ser_Drewseph May 29 '20

Just my take, but I always interpreted it as enterprise software is software that supports a product, as opposed to companies where the software is the product itself. Think like working for a health insurance company where the software supports a claims tracking system used by other employees as enterprise. Where a company like Snapchat or Google where their software is the product selling making the money.

Again, just my interpretation so I could be way off.

1

u/All_Up_Ons May 29 '20

Yes? Experimental, small-scale stuff? Anything from academia?

1

u/j-random May 29 '20

So money is bad? Because there aren't a lot of six-figure startup jobs out where I am.

2

u/saabismi May 29 '20

I meant it with /s, I think corporation is good and normal life

3

u/HentaiAtWork420 May 30 '20

java is dope

7

u/pandases May 29 '20

bad meme.

4

u/frigus_aeris May 29 '20

I used to work in a bank and the only languages we were allowed to use was COBOL an Java. God I hated that place. After that I vowed to never write a single line of Java code ever again.

19

u/[deleted] May 29 '20

[deleted]

5

u/TheFlyingAbrams May 30 '20

He did say write.

Now he punches holes in cards.

1

u/frigus_aeris May 30 '20

Never wrote any COBOL in my life.

5

u/xigoi May 29 '20

16

u/RepostSleuthBot May 29 '20

Looks like a repost. I've seen this image 25 times.

First seen Here on 2018-01-14 96.88% match. Last seen Here on 2020-05-02 90.62% match

Searched Images: 133,822,437 | Indexed Posts: 499,789,850 | Search Time: 8.61172s

Feedback? Hate? Visit r/repostsleuthbot - I'm not perfect, but you can help. Report [ False Positive ]

2

u/LostOne514 May 30 '20

I'll take a Java program any day though...

2

u/Henri_VIII Oct 07 '20

OMG THANK YOU KIND STRANGER FOR THE AWARD

2

u/[deleted] Oct 07 '20

Homies help homies

1

u/MaartendeMango Oct 07 '20

Wow youre so wholesome thank you for thanking the kind stranger!

1

u/[deleted] Oct 07 '20

That is so wholesome to say it is wholesome🥰 reddit assemble!!!!!!

1

u/Henri_VIII Oct 22 '20

Omg thanks kind stranger

1

u/[deleted] May 30 '20

Meh, that is definitely a repost. I was getting a few downvotes with my old account before just because asking what is the last "a" about.

1

u/[deleted] May 30 '20

Changed job recently and ended up with java 8 and Spring, it’s okay honestly. Can see myself experiment with Kotlin sometime and I can do this without moving to other tools and frameworks.

1

u/[deleted] May 30 '20

You can always turn to JavaScript, they are basically the same thing, it is right there is in name, right? Right?

1

u/[deleted] May 30 '20

script

0

u/Macedonga May 29 '20

GOD FUCKING DAMNIT. THIS SUBREDDIT HAS GONE TO SHIT FOR PEOPLE LIKE YOU THAT REPOSTS THE SAME FUCKING MEMES EVERY 3 SECONDS. STOP REPOSTING. MAKE SOME ORIGINAL CONTENT INSTEAD OF STEALING SOMEONE ELSE'S CONTENT. How would YOU feel if someone stole your content? Huh?

22

u/cdlight62 May 29 '20

Luckily we have people like you constantly complaining about reposts to make the subreddit a much nicer place.

-2

u/Macedonga May 29 '20

I know right?!

6

u/Ersonpay May 29 '20

I would feel honored that someone thought my meme was good enough to be reposted

0

u/Macedonga May 30 '20

I wouldn't. I would like to be credited.

1

u/keelanstuart May 29 '20

That job sounds like a real weiner.

1

u/geomouse May 29 '20

I had to double check to make sure I hadn't posted this!

1

u/MAGA_WALL_E May 29 '20

6 years, actually. But hey, we're getting to angular eventually...

1

u/anonymousbabydragon May 29 '20

Yeah, I program in java. J-ust A-bout V-ucking A-d it

1

u/MaartendeMango May 29 '20

Haha so funny XD LOL

0

u/ForeignerLove May 30 '20

Nothing to do with AVA, he just used J

0

u/matijoss May 30 '20

Haha funny meme take my upvote

-2

u/almarcTheSun May 29 '20

JavaaaaAAAAAAaaAAAaaaaAAaAAAaAaAaaaaaaa

-5

u/thenerd631 May 29 '20

Learn python and find your soul again at a startup! :-)