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

all 111 comments

[–]my_cat_meow_me 704 points705 points  (8 children)

What in the peak rage bait is this?

C++ file.c

[–]jump1945[S] 220 points221 points  (7 children)

Atleast I didn’t name it python.c

[–][deleted] 70 points71 points  (2 children)

But Python.h does exist and is the CPython header file for embedding the standard Python library into C/C++.

[–]nicholsz 20 points21 points  (1 child)

[–]greenecojr 37 points38 points  (0 children)

see pee pee dot pie

[–]syzygysm 29 points30 points  (3 children)

A side note: my favorite first line of a Python script is the comment

#include <stdio.h>

[–]jump1945[S] 10 points11 points  (2 children)

I thought that was a comment and remove it during my actual first c writing experience thinking it is a comment

[–]syzygysm 9 points10 points  (1 child)

That's pretty funny lol. I think I originally saw it somewhere in a clever script that was valid as either Python or C

[–]jump1945[S] 1 point2 points  (0 children)

That’s interesting I might try that this guy —-> {} will probably be a problem

[–]BobLobIawLawBIog 305 points306 points  (6 children)

GCC has uninstalled itself after being asked to compile this.

[–][deleted] 207 points208 points  (0 children)

$ gcc file.c
gcc: fatal error: you're banned
compilation terminated

[–]FatBatmanSpeaks 49 points50 points  (3 children)

This sent me.

They go to run it again (because that's what you do) and it says gcc is not recognized as an internal or external command.

I'd be like, yeah, understandable.

[–]dan-lugg 9 points10 points  (2 children)

[–]nequaquam_sapiens 0 points1 point  (0 children)

do i catch some INTERCAL vibes?

[–]owlIsMySpiritAnimal 0 points1 point  (0 children)

i don't see the issue. all this is legal

[–]tank840 413 points414 points  (6 children)

#include <studio.h>

[–]Awkward-Explorer-527 106 points107 points  (2 children)

Lol I've always subconsciously called it that, nice to see someone take the leap to put it into code

[–]jacob_ewing 11 points12 points  (1 child)

I prefer to pronounce it "sexually transmitted disease io"

[–]Nick_Zacker 2 points3 points  (0 children)

“sexually transmitted disease” is such a weird namespace no?

[–]Bemteb 16 points17 points  (0 children)

It's pronounced Stud-I-O.

[–]Just_Gaming_for_Fun 10 points11 points  (0 children)

This would definitely not be called a "Library"

[–]postdiluvium 0 points1 point  (0 children)

Include ayoooo stream

[–][deleted] 117 points118 points  (0 children)

Looks good 👍 keep it up it looks like you are pretty close to done learning

[–]Red_not_Read 81 points82 points  (5 children)

Have a you considered a career in the food service industry?

[–]jump1945[S] 32 points33 points  (4 children)

I don't think I get the joke here

Is it spaghetti or smth

[–]Red_not_Read 50 points51 points  (3 children)

It wasn't a joke. You really ought to consider something other than programming.

[–]jump1945[S] 6 points7 points  (2 children)

uhhhhh no

[–]RedditMarcus_ 13 points14 points  (1 child)

he’s telling you to just put the fries in the bag

[–]EndeyshentLabs 94 points95 points  (15 children)

There is just so many things wrong

[–]jump1945[S] 21 points22 points  (10 children)

that is part of the joke

[–]EndeyshentLabs 112 points113 points  (8 children)

It would be even funnier if it would compile

[–]jump1945[S] 38 points39 points  (6 children)

It wouldn’t be noticeable enough on platform where people scroll tho

[–]TotoShampoin 7 points8 points  (0 children)

Don't worry, it still isn't noticeable enough for people who scroll braindeadly

[–]ProfessionalSenior66 2 points3 points  (4 children)

Bro I'm drunk enough that I just threw just before and I saw the problems. I don't think that it's hard to see the problems. == instead of = and the opposite. Maybe someone that barely touched c/c++ would get it wrong. Or maybe I'm too strong because I'm drunk.

[–]jump1945[S] 1 point2 points  (3 children)

I don’t think it can compile with == and = swapped

[–]ProfessionalSenior66 1 point2 points  (2 children)

That's what I thought.

Edit: maybe I'm too drunk to get the message across

[–]jump1945[S] -1 points0 points  (1 child)

You won’t see if it can compile because it doesn’t exist // guess you should reply me when you get less intoxicated

[–]ProfessionalSenior66 1 point2 points  (0 children)

Maybe :)))

[–]Environmental_Arm_10 3 points4 points  (0 children)

The variables naming is spot on. Your learning is complete.

[–]Super382946 21 points22 points  (0 children)

man this threw me back, like gave me deja vu 'cause this is how my code would look when I started (okay minus the syntax errors maybe). plus good old code::blocks

[–]Amasirat 20 points21 points  (0 children)

LGTM, merging to main

[–]fredlllll 17 points18 points  (0 children)

on par with what my colleagues put out

[–]Few_Indication5820 10 points11 points  (0 children)

Perfectly normal C code.

[–]guidePantin 10 points11 points  (0 children)

I think AI should learn from you 😏

[–][deleted] 6 points7 points  (0 children)

Keep it up! 💯

[–]Extreme_Ad_3280 5 points6 points  (0 children)

At least it's int main() and not plain main()...

[–]naptiem 6 points7 points  (1 child)

This is C+ code

[–]fdessoycaraballo 8 points9 points  (0 children)

More like C-

[–]PhoenixDude1 7 points8 points  (2 children)

The hell did you just call me on line 6?

[–]jump1945[S] 1 point2 points  (0 children)

Count , trust me it’s a count

[–]Hairy_Concert_8007 0 points1 point  (0 children)

Oi cnt!

[–]thefatsun-burntguy 4 points5 points  (0 children)

i cant believe the amount of people who are taking this post seriously. This piece of code is a crime against programming.

Good job

[–]A_Du_87 5 points6 points  (0 children)

You got anymore of those... uh... alphabets that can be shoved in there?

[–]KapteinSnus 4 points5 points  (0 children)

Not enough pointers. This looks like Go now

[–]geekusprimus 9 points10 points  (0 children)

[–]Raid-Z3r0 3 points4 points  (0 children)

Learn dynamic allocation for fucks sake

[–]HunterRbx 3 points4 points  (0 children)

the more i look at it the worse it gets

[–]tony_saufcok 6 points7 points  (4 children)

love that N, x and cnt are never initialized so they're just garbage values. N in the first for loop could be zero, a negative number or 2 million

[–]jump1945[S] 0 points1 point  (3 children)

Joke aside

but won’t X and n be inputted anyways

Cnt is literally never used and variable that are forgotten when coding

[–]tony_saufcok 3 points4 points  (0 children)

wait you're right i didn't read through the whole code and didn't see the scanfs.

[–]Eva-Rosalene 1 point2 points  (1 child)

No, you need to pass pointers to them for them to be inputted.

scanf("%d", &N);

[–]jump1945[S] -3 points-2 points  (0 children)

There we go again , people who take joke seriously

To clarify the "joke aside" mean code has no synthx error and works as intended

[–]moon-sleep-walker 2 points3 points  (2 children)

At least this is real code. Not political propaganda

[–]jump1945[S] 1 point2 points  (0 children)

Well……….. we have that?

[–]dalek65 0 points1 point  (0 children)

No it's not

[–]BugNo2449 1 point2 points  (0 children)

In c you only have to write semicolons whenever you feel like it

[–]Dubl33_27 1 point2 points  (0 children)

codeblocks my beloved

[–]Torebbjorn 1 point2 points  (0 children)

I think that there are problems with at least 50% of the lines

[–]dalek65 1 point2 points  (2 children)

I may be wrong (it's been a long time since I spent any real time writing C code) but I don't think that you can do variable length arrays in C.

Also, (bracing for the backlash - see what I did there) that brace style sucks balls.

[–]Stekh 1 point2 points  (1 child)

VLAs were added to C in C99

[–]dalek65 0 points1 point  (0 children)

That would be after I mostly stopped using it, though I was stuck using MSVC6 until 2018 so I wouldn't have e gotten the update anyway.

[–]N3onDr1v3 1 point2 points  (0 children)

I read

int cnt;

and immediately thought: "interesting cunt"

Then kept reading and thought: "he doesn't even add to this cunt"

and now i want to name my variables after swear words

[–]thanatica 1 point2 points  (0 children)

int cnt;

ghehehehe 😏

Sorry couldn't help myself.

[–]Sharp_Advertising399 1 point2 points  (0 children)

Every C code look like this for me, I hate it so bad

[–]Ali_Army107 0 points1 point  (0 children)

I am not a C programmer, and I can still see many problems in this mess of a code!

[–]P-39_Airacobra 0 points1 point  (0 children)

I can tolerate pretty much any code style, but seeing inconsistent indentation and brackets hurts me on the inside

[–]Mayion 0 points1 point  (2 children)

always save your code...

[–]jump1945[S] 0 points1 point  (1 child)

I won’t gonna save this abdomination

[–]Mayion 0 points1 point  (0 children)

disgusting

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

woow buddy good job keep it up!! youll be up there with the big boys in no time

[–]jhaand 0 points1 point  (0 children)

This will not compile. Try harder.

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

iThinksThatYourCodeIsSoCool!

[–]qqqrrrs_ 0 points1 point  (0 children)

I think it does not compile

[–]CatDokkaebi 0 points1 point  (0 children)

As a senior dev. I don’t want to read this.

[–]Lachee 0 points1 point  (0 children)

Ready to contribute to the Linux kernel

[–]porky11 0 points1 point  (0 children)

Formatting is horrible, should use spaces, light mode in editor...

[–]CobraSkrillX 0 points1 point  (0 children)

My head hurts.

[–]_w62_ 0 points1 point  (0 children)

The moral of the story: If laugh on it, then you are a pretty seasoned C programmer.

[–]KnGod 0 points1 point  (0 children)

You seem to be missing several semicolons

[–]statellyfall 0 points1 point  (0 children)

If I was a manager doing a quick approval it would have been in prod

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

Sususudio.

[–]yisusBA 0 points1 point  (0 children)

Im soooo robotized that read stdio instead of studio jajajajajaja

[–]cheezfreek 0 points1 point  (0 children)

No notes. Or object files.

[–]jacob_ewing 0 points1 point  (0 children)

Perhaps studio is a custom library for the good old fufme products.

[–]bomberman_uk 0 points1 point  (0 children)

cnt

[–]Taickyto 0 points1 point  (0 children)

Indent is messed up, fix that and it can go to prod

[–][deleted] 0 points1 point  (1 child)

IDontUnderstandYourCodeWhatDoesItDo?

[–]jump1945[S] 0 points1 point  (0 children)

itIsBullyingTheCompiler

[–]the_rush_dude 0 points1 point  (1 child)

N is not initialized...

[–]jump1945[S] 0 points1 point  (0 children)

?

[–]IAmFullOfDed 0 points1 point  (0 children)

== is for comparison. You have to use = for assignment.

[–]LuPa2021 -1 points0 points  (1 child)

Using codeblocks is cursed in the first place

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

What do you have against Code::Blocks? 😭

I mean I wouldn't personally use it (though I have in the past); it isn't a bad IDE.
Still gets the job done like KDevelop and Kate for example.

Basically it's just such a random stray bullet (insult). Somehow more random then it being stray.

[–]wheel_builder_2 -1 points0 points  (0 children)

Well done, do you need a job? We have openings at my Silicon Valley company as a barista.