this post was submitted on 12 Mar 2024
1094 points (95.7% liked)

Programmer Humor

32464 readers
215 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 

Please dont take this seriously guys its just a dumb meme I haven't written a single line of code in half of these languages

top 50 comments
sorted by: hot top controversial new old
[–] smileyhead@discuss.tchncs.de 140 points 8 months ago (5 children)

Every programming language has it's place.

JavaScript's place is in hell.

[–] Bishma@discuss.tchncs.de 55 points 8 months ago

I used to think Javascript was hell when I barely used it. Now I have to build with it regularly and... once in a while I'm just right about things.

[–] Da_Boom@iusearchlinux.fyi 27 points 8 months ago

Ever wanted to be somewhere inbetween java and JavaScript?

Yeah, that's Groovy. Only it's the wrong groove

load more comments (3 replies)
[–] bort@sopuli.xyz 114 points 8 months ago* (last edited 8 months ago) (3 children)

Latex: Problem --> \def\please@#1#2#3#4{\e@kill#2#3{\me#1}#4@now} -->

[–] renzev@lemmy.world 62 points 8 months ago (15 children)

Accurate. LaTeX is great, it makes you feel like you have superpowers compared to "office suite"-style software. But every once in a while you just run into some bullshit that feels like it's stuck in 1985 and it completely breaks your flow. I remember wanting to make a longtable where text in the "date" column would be rotated by 90 degrees to leave more horizontal room for the other columns. It took me two rotateboxes, a phantom, a vspace, a hspace and 40 minutes of my life to get the alignment right. Would probably have taken a duckduckgo search and three clicks in Libreoffice.

load more comments (15 replies)
[–] bitwolf@lemmy.one 22 points 8 months ago (1 children)

I got way too excited Lemmy parsed LaTeX for a second

load more comments (1 replies)
load more comments (1 replies)
[–] xlash123@sh.itjust.works 109 points 8 months ago (4 children)

PHP: Problem -> real_solution_for_real_this_time() (real_solution_i_swear() is unsafe and deprecated)

[–] xmunk@sh.itjust.works 25 points 8 months ago (1 children)

Eh, your statement is accurate for PHP4 and still relevant up to PHP5.2... We're on PHP8.3 now and PHP8.0 is now out of security updates. I know it's trend to hate on PHP but you've got to at least update your materials to var-vars... it's like knocking node for having substr() and substring().

load more comments (1 replies)
load more comments (3 replies)
[–] Swedneck@discuss.tchncs.de 106 points 8 months ago (5 children)

missing the stage of C where it's all incomprehensible bitfucking with comments like "this works, i do not know why it works, do not touch this"

[–] sheepishly@kbin.social 37 points 8 months ago (1 children)

Real fast inverse square root algorithm hours

[–] PlexSheep@feddit.de 18 points 8 months ago (3 children)

That one is not that complicated if you don't think about the math. It's basically just if we interpret the float as int and add a magic number we have a good estimation.

From what I remember at least, it's been a little while since I implemented it.

load more comments (3 replies)
load more comments (4 replies)
[–] neidu2@feddit.nl 91 points 8 months ago* (last edited 8 months ago) (10 children)

Perl:

Problem -> $ @ % <=> <> =()= => ; qw() ])} select(undef, undef, undef, 0.25) =~ tr/.?\w\sREg3xfr0mhe|l/foo/g; $|++ &homebrewedFunction(%$ref, $_ , @_ ) -> solution

Source: I mainly code in perl. I like it, but I'll be the first to admit that it's not a beautiful language.

I was about to make an entry for lisp here, but I don't have enough parentheses to draw the path to the solution.

[–] MonsiuerPatEBrown@reddthat.com 37 points 8 months ago* (last edited 8 months ago)

https://www.foo.be/docs/tpj/issues/vol4_4/tpj0404-0015.html

The Perl Poetry Contest - The Perl Journal, Winter 1999

#!/usr/bin/perl
#
# asylum.pl
# by Harl

close (youreyes);
bind (yourself, fast);

while ($narcosis) {
   exists $to($calm);
   not calm;
}

accept the, anesthesia;
seek the, $granted, $asylum'
and wait;

stat ically;

unlink and listen (in, $complicity);

for (a, little) {
   system ("sync hronicity");
}

[–] mindbleach@sh.itjust.works 23 points 8 months ago (5 children)

Perl is write-only code. Larry Wall raised a monkey's paw and asked for a language that works the way programmers want. So most Perl is the first thing someone tried, unfiltered by rigid syntax putting your thoughts in order, compiler warnings bringing side effects to mind, or even names forcing you to decide what a variable is. An uncommented Perl script is raw brain patterns displayed as ASCII.

Thank god it runs like crap. We'd be in so much trouble if it was fast. Optimized C isn't exactly gorgeous, but any project that compiles proves someone looked at the code more than once.

load more comments (5 replies)
load more comments (8 replies)
[–] RageAgainstTheRich@lemmy.world 87 points 8 months ago (3 children)

C: "Segmentation fault."

Where?

C: 🤷🏻

[–] Classy@sh.itjust.works 54 points 8 months ago (1 children)

C: gestures vaguely everywhere

load more comments (1 replies)
[–] BeigeAgenda@lemmy.ca 33 points 8 months ago (1 children)

Then you open the core file with GDB and hope the stack is not smashed.

load more comments (1 replies)
[–] vox@sopuli.xyz 17 points 8 months ago

gdb -> where

[–] Shady_Shiroe@lemmy.world 75 points 8 months ago
[–] turkishdelight@lemmy.ml 63 points 8 months ago (2 children)

python is like that. someone waay smarter than you have already done this 10 years ago.

[–] stevedidwhat_infosec@infosec.pub 26 points 8 months ago (31 children)

Idk I still like writing my own stuff purely pythonic when I can. Pythons syntax is the most “fun” and “natural” for me so I find it fun. Like doin a sudoku puzzle

load more comments (31 replies)
load more comments (1 replies)
[–] Hotzilla@sopuli.xyz 60 points 8 months ago* (last edited 8 months ago)

C# Solution -> .sln

(brought to you by .net gang)

[–] xantoxis@lemmy.world 59 points 8 months ago (2 children)
[–] PlexSheep@feddit.de 16 points 8 months ago (5 children)

Yeah that one got me too. Rust has tons of c libs wrapped in safe rust.

load more comments (5 replies)
load more comments (1 replies)
[–] onlinepersona@programming.dev 52 points 8 months ago (1 children)

C --> segfault --> new problem

[–] fl42v@lemmy.ml 37 points 8 months ago* (last edited 8 months ago) (2 children)

ResizedImage_2024-03-12_22-25-43_1

Sry, the best I can do on mobile

load more comments (2 replies)
[–] underisk@lemmy.ml 51 points 8 months ago (3 children)

The line between problem and solution for C should be 30 miles long.

[–] kevincox@lemmy.ml 29 points 8 months ago (1 children)

...with 19 bugs 9 of which are exploitable.

[–] witty_username@feddit.nl 19 points 8 months ago (2 children)

And one bug that one person found once but is not reproducible

[–] Rodeo@lemmy.ca 18 points 8 months ago

So the developers claim, but the users still encounter it, and the bug report stays open for 22 years ... possibly more.

load more comments (1 replies)
load more comments (2 replies)
[–] affiliate@lemmy.world 48 points 8 months ago

i feel like javascript could also be

Problem -> solution -> 3 days pass -> all dependencies had breaking changes made -> problem

[–] NocturnalMorning@lemmy.world 42 points 8 months ago (4 children)

Python one is accurate. Most of our problems are solved by importing a library and writing the line, librarySolver.importedFunction.SolveMyProblem()

def main(): Print('thanks librarySolver')

load more comments (4 replies)
[–] leaky_shower_thought@feddit.nl 40 points 8 months ago (7 children)

for the ones missing the marvelous HTML, I gotchu bro:

<problem />

[–] Mr_Fish@lemmy.world 25 points 8 months ago (1 children)

Add css, and the problem looks really pretty now

load more comments (1 replies)
load more comments (6 replies)
[–] xigoi@lemmy.sdf.org 36 points 8 months ago (2 children)

Actual C: Problem → Segmentation fault

load more comments (2 replies)
[–] loweffortname@lemmy.blahaj.zone 29 points 8 months ago (1 children)
load more comments (1 replies)
[–] nintendiator@feddit.cl 25 points 8 months ago* (last edited 8 months ago) (4 children)

C:

Problemreturn Solution;

C++:

Problem

const [auto]&& (Problem&& problem) noexcept(noexcept( Solution<Problem>{}(std::forward<Problem>(problem)) )) { return Solution<Problem>{}(std::forward<Problem>(problem)); } -> decltype( Solution<Problem>{}(std::forward<Problem>(problem)) )
load more comments (4 replies)
[–] idunnololz@lemmy.world 20 points 8 months ago* (last edited 8 months ago) (7 children)

It's ironic that the illustration for JavaScript is probably the most realistic and best solution IRL. In the sense that a lot of what problem solving is (which is a big part of software engineer) is breaking a big problem into smaller problems. And you continue doing this until each problem is solvable in a short period of time.

JavaScript sucks though as a language.

[–] CaptainSpaceman@lemmy.world 19 points 8 months ago (2 children)

I thought it was a jab at all the NPM packages

load more comments (2 replies)
load more comments (6 replies)
[–] wabafee@lemm.ee 19 points 8 months ago

JS is basically the Hydra from the Greek Mythology.

Though PHP is literally the problem had me lol.

[–] deathmetal27@lemmy.world 17 points 8 months ago (2 children)

Java:

Problem -> NullPointerException.

[–] bleistift2@feddit.de 33 points 8 months ago (4 children)

More like

Problem → new ProblemSolverFactory().createProblemSolver().solveProblem();

[–] MajorHavoc@programming.dev 18 points 8 months ago (3 children)

Exactly. And configured by 5000 lines of brittle XML.

load more comments (3 replies)
load more comments (3 replies)
load more comments (1 replies)
load more comments
view more: next ›