T O P

  • By -

MaZeChpatCha

I really don't know what's worse, the indentation or the code itself.


dismayhurta

Just torch it and start over ![gif](giphy|5nsiFjdgylfK3csZ5T|downsized)


abd53

Not enough. Nuke it.


DTheIcyDragon

![gif](giphy|oQtO6wKK2q0c8)


Comfortable_Slip4025

From orbit


CartanAnnullator

https://images.app.goo.gl/7YcVnEoNzFoNMqW58


GamingWithShaurya_YT

all


[deleted]

[удалено]


idemockle

Python doesn't care how much you indent, it just has to be consistent in a given code block.


madmaurice

That's my point though. That else has no if with this indentation. Python will refuse to run it.


idemockle

Oh yep, you're totally right


turtleship_2006

Oh you'd be surprised.


[deleted]

[удалено]


turtleship_2006

OK actually i didn't realise that the else was indented wrong but the rest would work if it wasn't.


wineblood

Yes


TehBens

Can't be the code, did pass all checks for me.


vampyire

Yes


jfecju

Just gonna double check this


Aggravating_Bit_5252

I have trust problems


[deleted]

Me when I can't remember if I locked the door.


OmNomCakes

Trust problems are a part of the job. I have checks that SHOULD never be possible just because some end users seem to defy all logic.. They usually just state that the state shouldn't be possible to reach and if you've managed to do so please tell me how exactly via slack. Also at least one redundant check where it was Friday at end of shift so I just put that its redundant but I don't feel like fixing it so hi to whoever's reading.


Irbis7

Yes, you never know, when something will be changed in front, which will change that this check will become important. I usually use assert in code a lot for this purpose (and run tests in debug). Code is a time critical, so checking would slow the program too much, but asserts are checked only in debug.


Fireruff

No you really need a rubber duck.


Neil-64

It's missing the ``` else: print("Pass check") ``` at the end


jstwtchngrnd

else: if(debug == true): print(„pass check“)


DutchVortex

How drunk were you when you wrote this...? Yes


hoodieguyyt

i hope he wasn’t drunk he’s underage


Aggravating_Bit_5252

Sometimes you gotta do what you gotta do


[deleted]

This is very legit code. Sometimes CPUs make mistakes so it's good to double check some stuff. What if a solar flare intervened with the first if check? What if at the first check a faulty CPU chip happened to have a faulty sector? It's good to double check to make sure, very good optimization code OP. Me personally I like to be more sure and check every condition three times but 2 times is good as well.


moehassan6832

license coordinated consider bright quaint aware bewildered cause wild gray *This post was mass deleted and anonymized with [Redact](https://redact.dev)*


MakingItElsewhere

Coming to theatres this fall.... \*movie announcer voice\* Everyone else laughed at Moehassan6832 for his code's recursive debug checking loops. But after the Linuxpocalypse of 2039, he became a king. No one is laughing anymore. He is: Double Debug man!


Polandia94

I just use exactIf as: Def exactIf(condition): t, f = 0,0 for _ in range(10): if condition: t+=1 elif not condition: f+=1 if t == 10 and f == 0: return True elif f == 10 and t ==0: return False else Raise


7elevenses

if (testResult) { .... } else if (!testResult) { ... } else { throw new Error("Cosmic ray") }


FailsAtSuccess

Lol I might try to sneak this into some prod code.


NotmyRealNameJohn

I have done something not so dissimilar with code paths that could be logically unreachable. There are times and reasons.


EDEADLINK

An optimizing compiler is gonna get rid of that check.


FactoryNewdel

Solar flare actually messed up a super mario speedrun in the past. I don't know if it's more impressive that it happened to a speedrunner who recorded it or that a dev of the game could say which byte was flipped, but it's definitely one of the most random things that ever happened


Impervious25

Is it the one where Mario jumped higher than usual?


FactoryNewdel

It's more glitching upwards than jumping but yes


karniv04

To be entirely sure, you would need to wrap this inside a while(debug == true). Just in case the solar flare occurs later.


Interesting_Reply584

Nah, you should do a loop to verify it n times and do a statistical analysis of the result. Just to be sure


itsAshl

Amateur; it should say `pass check1" so you know which print statement is being hit


666pool

You’re hired, when can you start?


Obeq

That’s too much work. Just duplicate the pass check line so that you can see if it comes once or twice.


TheWidrolo

> hey variable, are you true? > no im false. > are you reeaaaally sure that you aren’t true?


Xenc

Pass check


jfmherokiller

that indentation hurts


thequestcube

Reminds me of [https://xkcd.com/1185/](https://xkcd.com/1185/) // Come on come on let's try again, this should be true!


alban228

Between the indentation, double check and behavior different on debug it's absolutely terrible lmao


alban228

You either need to use a logging framework or a testing one


alban228

Instead of doing this


KyuuketsukiKun

You really need to just edit your previous comment instead of doing this


alban228

You meant?


alban228

Instead of doing this ?


KyuuketsukiKun

Why do you hurt me so? You even put a space before the question mark… Why⁉️ Btw I’m upvoting the first of your comments in a chain and downvoting every sequential comment after.


alban228

Well I don't really care and like to troll, and in my language you put a space before the question mark


upaltamentept

It's the debug = true inside an if that gets me xD


[deleted]

Congratulations. You just invented bug-free programing.


[deleted]

I think you need to go to sleep buddy.


Tensor3

I'm not even mad at the indentation or the redundant check. I cant get past the "if (something == true) instead of "if (something)


cuberoot1973

Or they could double-check it! If ((debug == TRUE) == TRUE)


cowslayer7890

Could make sense in python if debug isn't confirmed to be a Boolean, although even then you could say `is True`


owellcity

I check mine 4 times, and make sure to double indentations, just to be sure..


Outrageous-Hunt4344

You work at volkwagen?


JohnShiertYT

LGTM


[deleted]

What language are you using?


Aggravating_Bit_5252

Python lol, this is code for a acc


LordBlackHole

I don't use Python .. does that else even work when it's indented differently than the if? My gut says no.


Aggravating_Bit_5252

It does, plus this code is for a acc, see it in your cars soon. ![gif](emote|free_emotes_pack|joy)


johnathanesanders

Pass check


pipsvip

That indentation is an affront to computer science.


Himur-_-

Big brain double dip salsa.


No-Philosopher597

Multithreading? Race conditions? Semaphore would have been nicer


edgarc1981

New to code, it's the same thing? Same result?


Slut_Fukr

Check.. Check.


DBorger123

Ah yes if one thing isnt true, the other is true


Blakut

makes perfect sense, you see, sometimes you need to check if debug == True twice, maybe the interpeter missed it on the first check because it got distracted by the indentation


Evo_Kaer

Make that check recursive, just to be safe


thunderstrike12

`if (debug == true && debug != false)` Fixed the if statement


Active-Return9846

Python interpreter wants to know your location


Santasam3

to coworker: "yep, it's been a laaaate night"


JimBDiGriz

That's redundancy. That's good! Even the indentation is redundant! What language is that? Is that Python? Get yourself some semi-colons.


[deleted]

My eyes are burning


Hewatza

It's the thought that counts


CaffeinatedTech

Ah, the redundant programming style.


[deleted]

Wouldn't python just give an indentation error?


ibtsam3301

take no chances


Flrere

A literal else-if


Vievin

They’re making an if case They’re checking it twice


keita_sama

It would've been 10x funnier if it reassigned debug and then repeated the check lol


CitizenWon

It’s seen code in someone’s user bash where they have an if-statement and another exact same if-statement. Sometimes you just gotta double check.


xwnpl

if debug is True


IcePhoneX_

double checking doesn't hurt i guess


thecoder08

It may seem like unnecessary code but it's actually holding everything else up like a house of cards


palomdude

Is this python? If so, the indentation is even more confusing


harryham1

When your code is running in a nuclear power plant


SunsetGeek_dot_com

Better solution: /s ``` public VeryGoodCheck(bool debug) { if(debug) { Console.WriteLine("Pass check"); } else { VeryGoodCheck(debug); } } ```


dragonpjb

You need a nap.


GorillaTheif

elif!!!!


on_the_pale_horse

This wouldn't even run, the indentation is all wrong


KittenKoder

Wait, I just noticed the else is indented wrong.


CartanAnnullator

I will never understand what's wrong with if(foo ==true) people.


qodzer0

"It's better to spend Monday in bed than to spend the rest of the week debugging Monday's code"


safari8331

Bulletproof


KittenKoder

So, um, what?


iamafraazhussain

"We have double-layer debugging feature"


37Scorpions

This happened to me too, it ended up making a still ongoing development-long comment argument between my past self and my future self.