this post was submitted on 05 Apr 2024
0 points (NaN% liked)

Programmer Humor

19171 readers
1402 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
 
top 40 comments
sorted by: hot top controversial new old
[–] affiliate@lemmy.world 2 points 5 months ago (1 children)

back in my day we only had one language. it was called ASSEMBLY. wanted to make the computer do something? you had to ask it yourself. and that worked JUST FINE

[–] jaybone@lemmy.world 2 points 5 months ago (2 children)

Well la-tee-da, fuck my AND gates and inverters.

Look at moneybags over here with his instruction sets.

[–] trashgirlfriend@lemmy.world 2 points 5 months ago

Back in my day when you wanted a computer to do something, you just asked her to do it and then underpaid her because women can't hold real jobs.

[–] Aceticon@lemmy.world 1 points 5 months ago (1 children)

Gates and inverters!!?

Luxury!

In my day we had to use transitors and resistors and, if we were lucky, maybe capacitors.

[–] anton@lemmy.blahaj.zone 1 points 5 months ago

Look at me, I have a friend at bell labs.
We had to use vacuum tubes, and we liked it.

[–] invertedspear@lemm.ee 1 points 5 months ago* (last edited 5 months ago) (1 children)

One project I worked on had 10 different languages. That was rough. But even your basic full stack web application is usually 5 languages: SQL, a backend language, HTML, CSS and JS. Usually some wheel reinventing frameworks thrown in for good measure. 5 languages is light these days.

[–] agressivelyPassive@feddit.de 1 points 5 months ago (1 children)

And don't forget the CI "language" plus a bunch of bash scripts, Helm, Kubernetes, etc.

[–] mctoasterson@reddthat.com 1 points 5 months ago

Probably a bunch of hacked together Python to copy stuff between fileshares. Bonus points if it runs with a .bat file and a Windows scheduled task.

[–] pulaskiwasright@lemmy.ml 1 points 5 months ago (2 children)

My favorite is “Java is slow” said by someone advocating for a language that’s at least 10 times slower.

[–] humbletightband@lemmy.dbzer0.com 1 points 5 months ago (2 children)

Those who say such things are straight ignorant

[–] pulaskiwasright@lemmy.ml 0 points 5 months ago (1 children)

They’re basically fashion victims.

[–] humbletightband@lemmy.dbzer0.com 1 points 5 months ago

I wouldn't say so. They are inexperienced. They don't know where the bottleneck of most of the modern software is (it's io in 80-90% of cases) and how to optimize software without rewriting it to C++

[–] SorryQuick@lemmy.ca -1 points 5 months ago* (last edited 5 months ago) (2 children)

How are they ignorant? It’s a known fact that java is slow, at least slower than some others. Sure, it’s still fast enough for 95% of use cases, but most code will run faster if written in, say, C. Will have 10x the amount of code and twice as many bugs though.

[–] humbletightband@lemmy.dbzer0.com 1 points 5 months ago* (last edited 5 months ago) (1 children)

Java is indeed slower than C, Rust, in some cases than Go.

But that doesn't mean that

code will run faster if written in, say, C

Again, like 80-90% of production code are bounded by disk/network io operations. You will gain performance from using C in embedded systems and in heavy calculations (games, trading, simulations) only.

[–] SorryQuick@lemmy.ca -1 points 5 months ago

Which is exaxtly what I said, that it’s fast enough for most use cases.

In theory though, you will “gain performance” by rewriting it (well) in C for literally anything. Even if it’s disk/io, the actual time spent in your code will be lower, while the time spent in kernel mode will be just as long.

For example, you are running a server which reads files and returns data based on said files. The act of reading the file won’t be much faster, but if written in C, your parsers and actual logic behind what to do with the file will be.

But it’s as you said, this actual tiny performance gain isn’t worth it over development/resource cost most of the time.

[–] xor@infosec.pub -1 points 5 months ago (2 children)

the jvm brings enough bugs to outweigh any benefits there...
it is relatively fast, but it's slow in that it takes up a bunch of resources that could be doing other things...

[–] humbletightband@lemmy.dbzer0.com 1 points 5 months ago (1 children)

the jvm brings enough bugs to outweigh any benefits there...

Please name a few

[–] xor@infosec.pub -1 points 5 months ago

i decline your invite to debate the merits of java and jvm... i will instead walk my dog through this beautiful park here...

but, it's all been said on top level comments on this post.
it's trash, and honestly, even if it was perfect, sun microsystems has ruined any potential benefits.

[–] humbletightband@lemmy.dbzer0.com 0 points 5 months ago (1 children)

takes up a bunch of resources that could be doing other things...

You cannot get rid of garbage collectors, but you can always compile your java into binary to reduce the memory footprint.

[–] xor@infosec.pub -1 points 5 months ago
[–] kaffiene@lemmy.world 1 points 5 months ago (1 children)

My favourite is "all the boilerplate" then they come up with go's error checking where you repeat the same three lines after every function call so that 60% of your code is the same lines orlf error checking over and over

[–] xtapa@discuss.tchncs.de 0 points 5 months ago (1 children)

When you handle all your errs the same way, I'd say you're doing something wrong. You can build some pretty strong err trace wrapping errs. I also think it's more readable than the average try catch block.

[–] kaffiene@lemmy.world 1 points 5 months ago

You still need to add error handling to every call to every function that might raise an error

[–] redempt@lemmy.world 0 points 5 months ago (1 children)

we should use only the best language for everything.

[–] Maalus@lemmy.world 0 points 5 months ago (1 children)

Codebase is now 30 languages

[–] redempt@lemmy.world 0 points 5 months ago* (last edited 5 months ago) (1 children)

there aren't 30 best languages, that's not how "best" works. we use only the best language. for everything.

[–] Maalus@lemmy.world 0 points 5 months ago (1 children)

That's exactly how "best" works. Everyone thinks their language is the greatest and shits on everything else. If they all chose "the best" there would be 50 of them. Opinions are like assholes. Everyone has one.

[–] redempt@lemmy.world 0 points 5 months ago (1 children)

too bad everyone else is wrong

[–] Empricorn@feddit.nl 0 points 5 months ago (1 children)

Lol Principal Skinner meme

[–] KairuByte@lemmy.dbzer0.com 0 points 5 months ago (1 children)

If only it was intentional…

[–] redempt@lemmy.world 0 points 5 months ago (1 children)

yeah if only I was joking. wouldn't that be funny

[–] Iapar@feddit.de 0 points 5 months ago* (last edited 5 months ago)

Your joke is like my asshole. No one gets it.

[–] KairuByte@lemmy.dbzer0.com 0 points 5 months ago (1 children)

Write your business critical process in brainfuck and have job security for life.

[–] onion@feddit.de 0 points 5 months ago

Sprinkle in some whitespace code...

[–] abbadon420@lemm.ee 0 points 5 months ago (2 children)

Java is great if you actually want to earn a living.

[–] aisteru@lemmy.aisteru.ch 0 points 5 months ago (1 children)

You're not wrong, it's still a staple today, but it lost a lot of its shine a while ago. They are mimicking "new" features introduced in other languages, but make a point to preserve retrocompatibility.

I can't imagine how convoluted the JVM has become in the last 10 years.

[–] abbadon420@lemm.ee 1 points 5 months ago (1 children)

I don't really see how that is bad..? Java wants to be widely applicable and taking the best features from other languages helps that goal, right?

[–] jaybone@lemmy.world 1 points 5 months ago

C++ fanboys will talk a bunch of shit about Java for this, but c++ has been doing this same shit (and more poorly) pretty much since its inception.

And most of the newer Java stuff is syntactic sugar, so I’m not sure why that commenter is calling out JVM implementations. I’m guessing they don’t know much about the JVM, since you can compile these higher level syntax tricks down into bytecode just like you might compile more verbose source code.

Static analysis of compiled code with javap might be more difficult, but I’m betting the commenter doesn’t know what that is either.

[–] Sendpicsofsandwiches@sh.itjust.works 0 points 5 months ago (1 children)
[–] agressivelyPassive@feddit.de 0 points 5 months ago

That's almost comically besides the point of the comment.