2) In addition to the width as well as length, and some code if-else where if-else in the if-else code too much, you do not know the middle of the middle read code is the result of what the layers of checks came here.
C++ has template functions written for you called min and max. Second best would be a rare case where the ternary operator makes for nicer code (but of course min or max should be used instead).
An error message is being logged to cout instead of cerr.
Not really a problem, but the line that outputs the max and min value uses endl twice. Technically, each one forces the flush of the buffer. It's more efficient to avoid unneeded calls to endl and instead use \n. Speaking of which, the person is lucky cin flushes that buffer as the messages sent to cout all do not require the buffer be emptied, meaning the program could have sat there with no output on the screen waiting for input.
Hard to tell if a smarter algorithm can be used since I can't read what the outputs are, but there's nothing insanely wrong with checking tons of conditions if it's needed.
I'd personally write a comment after else that explains the case implies y==0 && x != 0 (and one in the case above that says && y != 0.
Modern C++ shouldn't be using cout. It's such a bad thing that c++23 will now have std::print. There are open source replacements until then like fmt::print.
Regarding what this code does. First part takes 2 variables and outputs max. Second part takes point coordinates and returns in which quadrant it is, this is why it has this many checks.
It's kinda obvious, too. I wrote plenty of code like this when I was learning. When the only tool in your toolbox is an if statement, that's what you use.
It is a school style. Output messages also contains pretty dumb orthography errors which in its turn means that whoever wrote this code, he or she is bad in multiple disciplines at the same time.
Called every C++ application ever.. wild wild west, do whatever you feel like that day and just leave it for some poor bastard that have to look at it years later.
Тут не только ошибки синтаксиса по типу cout << "...\n"; и того огромного айсберга if но и максимально тупые орфографические ошибки. "точка находитЬся в начале координат". Орфографический инсульт.
Instant legacy style. The most popular among some beginners after “learn {lang_name} in 2 hours”. In fact, the person doesn’t even know well Russian and I bet it’s the dev’s native lang.
52
u/Clean-Fish6740 Apr 01 '23
Desperately avoiding a case or switch statement style.
3
u/Pshock13 Apr 02 '23
https://ibb.co/PrH10Vc
I seen someone post this the other day. No Idea where I got this, I had just so happened to send this image to a coding friend.
307
u/PoisonedChips Apr 01 '23
Psychopath style
2
u/NickWrigh Apr 04 '23
"How I keep my job by making my code so messed that noone can navigate it, so my boss just won't fire me CAUSE I CAN.
Mostly"
2
u/DrAnthonySFauci Apr 04 '23
Special coding operation
183
u/stopleaksfast Apr 01 '23
пиздец
71
u/saro476 Apr 01 '23
Looks like one of my heavy debugging sessions where nothing works and I don't know why
59
u/geon Apr 01 '23
Homework
20
u/Quod_bellum Apr 01 '23
Self-hate
17
u/Ok_Wrongdoer409 Apr 01 '23
Pyramid of doom?
30
u/FarEngineering7130 Apr 01 '23
I would say arrow code https://medium.com/@mena.meseha/how-to-refactor-the-arrow-type-code-8c40c21db85f
13
u/tedbradly Apr 01 '23
minandmax. Second best would be a rare case where the ternary operator makes for nicer code (but of courseminormaxshould be used instead).coutinstead ofcerr.endltwice. Technically, each one forces the flush of the buffer. It's more efficient to avoid unneeded calls toendland instead use\n. Speaking of which, the person is luckycinflushes that buffer as the messages sent tocoutall do not require the buffer be emptied, meaning the program could have sat there with no output on the screen waiting for input.elsethat explains the case impliesy==0 && x != 0(and one in the case above that says&& y != 0.cout. It's such a bad thing that c++23 will now havestd::print. There are open source replacements until then likefmt::print.12
u/anonymouscoder555 Apr 01 '23
Terror. The fastest way to send a programmer running&screaming
70
u/[deleted] Apr 01 '23
Seems like pretty standard malware. I can tell because it has Russian output
8
u/[deleted] Apr 01 '23
Shit Mcgoo
8
u/Sweet-Ad668 Apr 01 '23
How about OBI style ? (Obfuscation By Incompetency)
8
u/hansvi-be Apr 01 '23
This is definitely written by a pregnant woman.
You can clearly see the nesting instinct.
7
u/alfredr Apr 01 '23
Spaghetti
7
u/enginerd0001 Apr 01 '23
Bad
7
u/m0rphiumsucht1g Apr 01 '23
It is a school style. Output messages also contains pretty dumb orthography errors which in its turn means that whoever wrote this code, he or she is bad in multiple disciplines at the same time.
7
u/[deleted] Apr 01 '23
Shitty Russian school computer science lesson. I hate those... We learn pascal. But there they decided to use C++
5
u/Narrow-Ad2915 Apr 01 '23
The yandereDev
4
u/[deleted] Apr 01 '23
I'd call it "stupid", tbh
4
u/AnAntsyHalfling Apr 01 '23
Zero Fucks
4
u/IIIKingEdwardIII Apr 01 '23
War crime
4
u/MarinoAndThePearls Apr 01 '23
College homework
4
u/TotalledZebra Apr 01 '23
First year CS student
1
u/Gold-Environment-259 Apr 02 '23
I wonder if the variables are called "xx" and "yy" because they are double... would floats be "x" and "y"? :D
3
u/[deleted] Apr 01 '23
Demon
3
u/Charming_Reporter_18 Apr 01 '23
Spaghetti code
3
u/Aperture_Executive2 Apr 01 '23
“Eating shit” comes to mind
3
u/_Spooker_ Apr 01 '23
Yanderedev style
3
u/practisevoodoo Apr 01 '23
Undergraduate
3
u/elno_17 Apr 01 '23
Junior style 😁
3
u/[deleted] Apr 01 '23
hadouken code
3
u/Cootshk Apr 01 '23
C--
3
u/Opening_Tomatillo325 Apr 02 '23
Called every C++ application ever.. wild wild west, do whatever you feel like that day and just leave it for some poor bastard that have to look at it years later.
3
u/DarkSilux Apr 02 '23
Pain
3
u/[deleted] Apr 02 '23
1st year college students do this. I call it coding diagonally. Some never grow out of it.
3
u/fr-fluffybottom Apr 02 '23
Tabitha
3
u/OmnemVeritatem Apr 03 '23
Crap, the word you're looking for is crap.
3
u/iblamefps Apr 04 '23
C**
3
u/[deleted] Apr 01 '23
When you 1C developer and trying to use normal technologies.
4
u/blackpaiak Apr 01 '23
govnocode
2
u/[deleted] Apr 01 '23
you vs the company they paid less for the same job
2
u/SpaceWizard360 Apr 01 '23
old tumblr
2
u/beaubeautastic Apr 01 '23
wrong
2
u/jamiejammas Apr 01 '23
Horribly formatted Boolean dungeon
2
u/4sent4 Apr 01 '23
Stairway to hell
2
u/Designer-Yam-2430 Apr 01 '23
Stair to hell
2
u/turkish-disco Apr 01 '23
Is this your homework Larry?
2
u/TheMusicalArtist12 Apr 01 '23
Pain
2
u/insaneguitarist47 Apr 01 '23
I call it the ladder...
2
u/DJPokis Apr 01 '23
We call it christmas tree, as it branches to side like a tree of that type
2
u/KaxyOP Apr 01 '23
Unreadable
2
u/[deleted] Apr 01 '23
Staircase to hell.
2
u/[deleted] Apr 01 '23
Shit
2
u/Insani0us Apr 01 '23
Unnecessary indentation since these are else ifs.
2
u/RideARaindrop Apr 04 '23
“I already put in my two weeks notice”
2
u/[deleted] Apr 04 '23
None is the only answer. There is no style since it handles the same cases differently.
2
u/ign1fy Apr 01 '23
I call this the flying formation. It's like a flock of birds.
1
u/KingParity Apr 01 '23
kill them
1
u/drdivw Apr 01 '23
There’s a setting in clang-format that does this. It’s fugly
1
u/kotothebest Apr 01 '23
LookmomIamacoder it called according to my classification, lol.
1
u/il-est-la Apr 01 '23
C++ common style
1
u/[deleted] Apr 01 '23
YandereDev style
1
u/The_ReComp Apr 01 '23
Complicated
1
u/Skarsburning Apr 01 '23
indentation hell
1
u/hiddentruthonaway Apr 01 '23
(;
1
u/-Konrad- Apr 01 '23
Cancer
1
u/_Vicix Apr 01 '23
Hell… it’s called hell.
1
u/wotanica Apr 01 '23
Revenge of the tabulator?
1
u/Left_Papaya_9750 Apr 01 '23
The stairway to bugs
1
u/abrams666 Apr 01 '23
curlophobia
1
u/jithi121 Apr 01 '23
Dirty
1
u/alban228 Apr 01 '23
Mental illness
1
u/Cybasura Apr 01 '23
Nuclear
1
u/thedarklord176 Apr 01 '23
The yandere dev method
1
u/kgon1312 Apr 01 '23
Sbaghetti
1
u/nanocyte Apr 01 '23
It makes me think of the hook apparatus Vincent D'Onofrio used to suspend himself from the ceiling in The Cell.
1
u/programmator-dominum Apr 01 '23
Vodka Style?
1
u/phlebface Apr 01 '23
If-then-else-pron
1
u/franciscoscaramucci Apr 01 '23
Cowboy style
1
u/thanatica Apr 01 '23
Light mode and unreadable.
1
u/StockRepeat7508 Apr 01 '23
blyat++
1
u/oj_mudbone Apr 01 '23
This is a Russian machine learning framework called Stalingrad
1
u/Desamax1 Apr 01 '23
Insanity
1
u/Twosided13 Apr 01 '23
aWFuL
1
u/7YM3N Apr 01 '23
Unreadable garbage
1
u/Needleroozer Apr 01 '23
This is that waterfall development technique you've heard about.
1
u/Polskidezerter Apr 01 '23
Warcrime It's weirdly popular amongst russian and german programmers
1
u/The_Linguist_LL Apr 01 '23
Better than mine
1
u/ma_ria_ Apr 01 '23
A code style that will make programmers instantly hate you
1
u/laikadeservedbetter Apr 01 '23
2014 controversial tumblr post
1
u/sendvo Apr 01 '23
it's called shit
1
u/nagmatez58 Apr 01 '23
Html lol
1
u/Ekumify Apr 01 '23
We call it Handicaps Lock
1
u/FirstNameIsLast Apr 01 '23
My eyes!!
1
u/[deleted] Apr 01 '23
Every line of code got worse and worse. Damn
1
u/jumpingmustang Apr 01 '23
Bad
1
u/[deleted] Apr 01 '23
Russian?
1
u/cheebusab Apr 01 '23
Double-double, animal style.
1
u/DangyDanger Apr 01 '23
Most readable C++ code
1
u/[deleted] Apr 01 '23
pain
1
u/Express-Procedure361 Apr 01 '23
"functions and OOP scares me because I don't know how they work"
1
u/spir2 Apr 01 '23
The real IA neural networks 😂
1
u/[deleted] Apr 01 '23
I think it is called the "Haduket Style"
1
u/badhombrez Apr 01 '23
Depression
1
u/ivansstyle Apr 01 '23
This is called soyuz-ascent
1
u/Big_Virgil Apr 01 '23
It's called HATE
1
u/wwelna Apr 01 '23
Looks like normal everyday computer science homework from an obviously gifted future graduate
1
u/thelolbr Apr 01 '23
Hadouken.
1
u/getshrektdh Apr 01 '23
Russian style.
1
u/[deleted] Apr 01 '23
This is what the code would look like if the Soviet Union conscripted a car mechanic to write it
1
u/tamafuyu Apr 01 '23
yandere dev
1
u/Asleep_Shopping9373 Apr 01 '23
🤷♀️
1
u/suskio4 Apr 01 '23
Mental disorder
1
u/VegasNightSx Apr 01 '23
Fubar
1
u/THUNDERSTRUCK___ Apr 01 '23
На это больно смотреть
Тут не только ошибки синтаксиса по типу cout << "...\n"; и того огромного айсберга if но и максимально тупые орфографические ошибки. "точка находитЬся в начале координат". Орфографический инсульт.
1
u/Lolandreagm Apr 01 '23
Hurts my eyes 😐😵💫😵💫😵💫
1
u/[deleted] Apr 01 '23
Holy indentation batman
1
u/knanshon Apr 01 '23
It is not a style, it is just a horrible mistake
1
u/DonKapot Apr 01 '23
Crazy else
1
u/Ok_Communication884 Apr 01 '23
this is how they teach us to write code in mother russia
1
u/novastosha Apr 01 '23
Bug Maze, CPU bottleneck, Debug Nightmare, Eye seizure
1
u/KYLEmaxARG Apr 02 '23
Shit
1
u/Electronic_Minimumz Apr 02 '23
Russian shit style!
1
u/Pigleteabear Apr 02 '23
Reverse guard
1
u/-IoI- Apr 02 '23
Recursive fuckery
1
u/Enkoteus Apr 02 '23
Instant legacy style. The most popular among some beginners after “learn {lang_name} in 2 hours”. In fact, the person doesn’t even know well Russian and I bet it’s the dev’s native lang.
1
u/[deleted] Apr 02 '23
Mental disorder.
1
u/Pleasant-Dogwater Apr 02 '23
insanity
1
u/Bobtheblob2246 Apr 02 '23
Курсед
1
u/InternetMountain903 Apr 02 '23
🗑️
1
u/Manlostech Apr 02 '23
Hell
1
u/CLOVIS-AI Apr 02 '23
LISP
1
u/Sanduhr32 Apr 02 '23
The vodka shot stair of delirium.
1
u/DrChaosMcKinnon Apr 02 '23
There was an attempt at obfuscation
1
u/strictphinx Apr 02 '23
Shit
1
u/SPMcs Apr 02 '23
Python programmer tries c++
1
u/yeahthatpatch Apr 02 '23
Chaotic evil
1
u/[deleted] Apr 02 '23
insanity
1
u/Unturnet Apr 02 '23
Russian style
1
u/SpecialistBig4609 Apr 02 '23
Hadouken code style
1
u/Vollgrav Apr 02 '23
Pyramid of Doom.
1
u/FranklinMayoyo Apr 02 '23
if-elsplosion
1
u/Equivalent-Win-1294 Apr 02 '23
It’s the fackinshit coding standard
1
u/[deleted] Apr 02 '23
Masochism
1
u/Fjolswir Apr 02 '23
Indian spicy spaghetti
1
u/xneyznek Apr 02 '23
Outsourced
1
u/Avacado_Cat666 Apr 02 '23
Mental disorder
1
u/CaptainSketchy Apr 02 '23
Bad
1
u/R3GENERATion_NATion Apr 02 '23
Bug inducing
1
u/nick837464 Apr 02 '23
Ah the RIP style 🪦
1
u/speedy_scripter Apr 02 '23
Looks like russian 👍
1
u/_tmfy_ Apr 02 '23
It's called "говнокод"
1
u/gesterom Apr 02 '23
Hell
1
u/Different-Corner-485 Apr 02 '23
Java …
1
u/Mystic--Rain Apr 02 '23
Bilangual.
1
u/RogerGodzilla99 Apr 02 '23
"bad"
1
u/Nizzzzzzzzles Apr 02 '23
Legacy maintenance
1
u/none-exist Apr 02 '23
A hate crime
1
u/Solindek Apr 02 '23
what is this shit, my eyes hurts so much
1
u/The_Hitchenator Apr 02 '23
Birdhouse programming.
1
u/[deleted] Apr 03 '23
Russian
1
u/usualguy123 Apr 03 '23
YandereDev Style
1
u/wannamit Apr 03 '23
Logical Ladder
1
u/garlicpastee Apr 03 '23
If tre blyad
1
u/StarCoder666 Apr 03 '23
I'd call it "Abomination of Desolation".
1
u/Inside_Dimension5308 Apr 03 '23
Criminal Mind
1
u/Komdodge Apr 03 '23
Russian codes I didn’t even think this existed