this post was submitted on 12 Mar 2024
1099 points (95.8% liked)

Programmer Humor

32410 readers
1840 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
[–] [email protected] 141 points 8 months ago (5 children)

Every programming language has it's place.

JavaScript's place is in hell.

[–] [email protected] 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.

[–] [email protected] 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)
[–] [email protected] 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} -->

[–] [email protected] 63 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)
[–] [email protected] 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)
[–] [email protected] 109 points 8 months ago (4 children)

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

[–] [email protected] 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)
[–] [email protected] 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"

[–] [email protected] 37 points 8 months ago (1 children)

Real fast inverse square root algorithm hours

[–] [email protected] 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)
[–] [email protected] 92 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.

[–] [email protected] 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");
}

[–] [email protected] 24 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)
[–] [email protected] 87 points 8 months ago (3 children)

C: "Segmentation fault."

Where?

C: 🤷🏻

[–] [email protected] 54 points 8 months ago (1 children)

C: gestures vaguely everywhere

load more comments (1 replies)
[–] [email protected] 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)
[–] [email protected] 17 points 8 months ago

gdb -> where

[–] [email protected] 75 points 8 months ago
[–] [email protected] 63 points 8 months ago (2 children)

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

[–] [email protected] 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)
[–] [email protected] 60 points 8 months ago* (last edited 8 months ago)

C# Solution -> .sln

(brought to you by .net gang)

[–] [email protected] 59 points 8 months ago (2 children)
[–] [email protected] 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)
[–] [email protected] 52 points 8 months ago (1 children)

C --> segfault --> new problem

[–] [email protected] 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)
[–] [email protected] 51 points 8 months ago (3 children)

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

[–] [email protected] 29 points 8 months ago (1 children)

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

[–] [email protected] 19 points 8 months ago (2 children)

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

[–] [email protected] 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)
[–] [email protected] 48 points 8 months ago

i feel like javascript could also be

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

[–] [email protected] 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)
[–] [email protected] 40 points 8 months ago (7 children)

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

``

[–] [email protected] 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)
[–] [email protected] 36 points 8 months ago (2 children)

Actual C: Problem → Segmentation fault

load more comments (2 replies)
[–] [email protected] 29 points 8 months ago (1 children)
[–] [email protected] 16 points 8 months ago

I’ve seen this before but don’t accept it myself. There are cases where you just wanted to cat. In this case, maybe to review the problem. Then you want to extend the command. Preserving it in the next commands where you start stacking on pipes is useful since it can be fewer strokes and maintain a habit.

[–] [email protected] 25 points 8 months ago* (last edited 8 months ago) (4 children)

C:

Problemreturn Solution;

C++:

Problem

const [auto]&amp;&amp; (Problem&amp;&amp; problem) noexcept(noexcept( Solution{}(std::forward(problem)) )) { return Solution{}(std::forward(problem)); } -> decltype( Solution{}(std::forward(problem)) )
load more comments (4 replies)
[–] [email protected] 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.

[–] [email protected] 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)
[–] [email protected] 19 points 8 months ago

JS is basically the Hydra from the Greek Mythology.

Though PHP is literally the problem had me lol.

[–] [email protected] 17 points 8 months ago (2 children)

Java:

Problem -> NullPointerException.

[–] [email protected] 33 points 8 months ago (4 children)

More like

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

[–] [email protected] 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 ›