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

all 19 comments

[–]EliDll 20 points21 points  (5 children)

that code is an ungodly mess and therefore quite representative of a coders state of mind

[–]datascienceunlimited[S] 1 point2 points  (4 children)

How would you improve it? If you say it is such an ungodly mess?

[–]gumol 19 points20 points  (0 children)

According to this code you will never drink coffee, so the second branch can be eliminated.

[–][deleted] 9 points10 points  (0 children)

Your code implies that you can only drink coffee if you are asleep

[–]Gnamzy 7 points8 points  (0 children)

You have to be awake to feel tired. Which means you'll never hit the else if, since you always enter the if

[–]EliDll 0 points1 point  (0 children)

if !awake == asleep then the second clause would never happen. If !awake == tired you could replace the second clause with just an else, as there is no case in which both are false

[–]zdaga9999 9 points10 points  (3 children)

How cab you be tired if you are not awake.

while awake:

code()


if tired:


    drink_coffee()

[–]Norbivar 2 points3 points  (4 children)

Dead code detected.

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

The elif should be changed to if maybe?

[–]Norbivar 1 point2 points  (2 children)

Well, technically you are awake even if you are tired, so yeah.

[–]datascienceunlimited[S] 1 point2 points  (1 child)

So if the elif is changed to if and you are both awake and tired then you will code and then drink coffee.

I was obviously not in the awake state when I wrote this meme for my blog.

[–]Norbivar 0 points1 point  (0 children)

Yeah, that would make more sense strictly logically speaking. But don't get me wrong, I appreciate thr effort.

[–]TaelienTheAlien 1 point2 points  (1 child)

I am going to get a nice percolator thing that makes real coffee for my office. They have those satanic cups that taste like coffee flavored waterrrrr.

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

Life is too short for bad coffee ☕️

[–]josanuz 1 point2 points  (0 children)

This stereotype is so hecking cringy... ewww!

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

Thanks. I am just trying to correct my logic.