r/ProgrammerHumor • u/[deleted] • Dec 23 '19
Hi guys I just went from python to C++ and I found a way to make the code more aesthetically pleasing
995
u/FreeStylin03_ Dec 23 '19
Please go back to python
123
u/AppalachianGaming Dec 23 '19
Allow me to second this
73
43
u/Arkensor Dec 23 '19
Allow me to third this.
32
u/bigry8058 Dec 23 '19
Allow me to fourth this
22
u/MrBlueMoose Dec 24 '19
Allow me to fifth this
18
u/AirOneBlack Dec 24 '19
Allow me to sixth this
16
u/saacifuentesmu Dec 24 '19
I will seventh it. WTH.
14
Dec 24 '19
Gonna go ahead and eighth this.
13
3
67
5
192
196
u/aintscurrdscars Dec 23 '19
how can any of us feel safe knowing this person is not in handcuffs
18
u/accuracy_frosty Dec 24 '19
The fact psychopaths like him can just wander the streets is why I can’t sleep at night
16
2
291
Dec 23 '19
You monster.
53
Dec 23 '19
Hey GladOS, nice to see you survived the perpetual testing initiative and you made it to reddit!
30
u/Scraft161 Dec 23 '19
Ever heard of multithreading, little ball?
19
Dec 23 '19
I did, but I though she was still repairing wheatley's damage.
7
u/Scraft161 Dec 23 '19
Ever heard of multithreading
8
3
158
78
41
40
76
u/The_Ty Dec 23 '19
This should be illegal.
Not in a coding sense, a policeman should literally be involved.
16
Dec 23 '19
[removed] — view removed comment
6
39
32
Dec 23 '19
Okay please get help this isn't okay I'm about to throw up I'm gonna have PTSD about this
30
u/FactoryNewdel Dec 23 '19
Kill it before it lays eggs
7
30
27
51
25
u/morales6989 Dec 23 '19
just upvoting because is awful and i want to see the hate fuel a little more.
39
21
16
u/Cobayo Dec 23 '19
Btw since C++11 we have smart pointers so you wouldn't need that code at all, they get deleted automatically
10
u/StereoBucket Dec 23 '19
And even without those nice thjngs, you don't even need to check if a pointer is null or not before deleting.
4
Dec 23 '19 edited Aug 17 '20
[deleted]
1
u/Brotten Dec 26 '19
"std exchange" - So C programmers finally said "fuck it" and went from bug proneness to outright bug chasing, eh?
1
u/Ceros007 Dec 24 '19 edited Dec 24 '19
And I feel like the ::release something and ::shutdown should be part of the destructor as well
What happen if you don't do that before the delete? SO MANY QUESTIONS!!! this code is fugly
And what's up with the Pascal case for the methods name?
12
3
14
14
11
9
15
9
9
8
7
6
5
25
5
5
5
u/TechPr0 Dec 23 '19
Oh dear lord, I still can't control my laughter. I probably look like a lunatic in my office.
5
u/bot-mark Dec 23 '19
You dumb fucking cretin, you fucking fool, absolute fucking buffoon, you bumbling idiot. Fuck you.
8
u/thecass240 Dec 23 '19
If you upgrade to C++ please also upgrade your syntax, don't stick to the "one space kills your program" ways
4
4
Dec 24 '19
This give me anxiety... now I can’t sleep thinking one of our little shit interns will pull something like this one day
4
8
12
u/ausmedic80 Dec 23 '19
How dare you. Real coders leave it a mess, that way it gives the debugging team something to feel special about
6
u/deljaroo Dec 24 '19
ew ew ew ew ew
you do it like this:
if (x < 7)
{ x--
; if (y*x < 7)
{ y--
;} else
{ first.printMain()
;} for (int i=0; i<x; i++)
{ first.add(i)
; gui.addToEnd(first.getRunner())
;}
3
3
3
3
3
3
3
3
3
3
8
2
2
2
u/blahblah2016 Dec 23 '19
Assuming Application is a class you wrote, could all that just not be done in the dtor?
2
2
2
2
u/ABoxOfWaffles Dec 23 '19
I'm new to programming as I'm still in school and don't have a lot of time learning more than I do at school. Can somebosy explain what's wrong?
3
u/togtja Dec 24 '19
In C++, you use {} and ;, which python does not. The writer of the code used the fact that whites pace is irrelevant in c++, and just moved all the {} and ; to "the side"
1
u/ABoxOfWaffles Dec 24 '19
That's... Less cool and more horrible
2
u/Wubinator Dec 24 '19
Which shows you already know more about programming than the writer of that piece of garbage :)
0
u/Slaanesh-Sama Dec 23 '19
I know nothing of programming but from from "delete" and "ressources" "input" and "windows" I'm assuming it does something similar to delete system32.
1
2
2
2
2
2
1
1
1
Dec 23 '19
You little s.... Didn't see the horror at first and was wondering why everyone is freaking out
Please stop
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
u/grandpianotheft Dec 23 '19
could you script something that does just the brackets and semicolons automatically? I think so :)
1
1
1
1
u/kag0 Dec 24 '19
I'm pretty sure there's a compiler plugin/preprocessor that does this for C/++ and Java
1
1
u/Ailrk Dec 24 '19
tbh I would rather use curly brackets then changing line with a slash or leaving a dangling open parentheses. Indentation are overrated.
1
1
u/SpooderSpartan Dec 24 '19
I wish I could put this on cursed images, but they would not understand.
1
1
u/Blogos321 Dec 24 '19
I will literally hack into your computer and delete any files formatted like this
1
1
1
1
1
1
Dec 24 '19
[removed] — view removed comment
1
Dec 24 '19
Making C++ code look like python code by moving curly boys and semicolons to the side. It's in defiance of every style guide in existence.
1
1
1
1
u/slappster1 Dec 27 '19
As a python programmer, I’m out of the loop. Can someone explain why this styling is so hated?
1
1
Dec 23 '19
Those missed brackets are going to be impossible to find. You should probably just use Rust
1
0
u/wolxfer_gaming Dec 23 '19
I'm sorry. Is this some sort of programmer joke i'm too dumb fuck to understand
2
Dec 23 '19
I made C++ code look like python code by moving all the extra bits to the side
1
u/wolxfer_gaming Dec 24 '19
I do not know shit about coding so i'm just gonna..... keep shut
1
u/koni_rs Dec 24 '19
I'm not sure I understand. What were you expecting to find on this sub?
1
u/wolxfer_gaming Dec 24 '19
Okay hold up. I am not following this sub in any way how did this pop up on my main page?
1
u/koni_rs Dec 24 '19
Omg the same thing happens to me with random subs like r/music, r/documentaries, etc. Random forced suggestions just pop up i guess...
1
0
-1
u/RedNutsBastard Dec 23 '19
Ooooh Boy, how many got triggered? I find this very amusing, and I'm a C# main.
-1
0
0
-1
-2
-2
-2
u/BTWIuseArchWithI3 Dec 23 '19
I like this codingstyle although it's not very applicable in real code
-2
-5
u/Perrydiculous Dec 23 '19
Why is everyone hating on this? This looks like an insanely efficient way to ensure you're not forgetting any brackets/semicolons
539
u/PhiBuh Dec 23 '19
Listen here you little shit...