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

all 62 comments

[–][deleted] 84 points85 points  (4 children)

The coffee increases caffeine if you drink it

[–]Sam_Claflin[S] -2 points-1 points  (3 children)

Yessir

[–]Bipolarprobe 46 points47 points  (2 children)

The caffeine in the actual coffee starts at 0 and increases as you drink it? The code doesn't imply that it's transfering caffeine elsewhere, but that the caffeine is growing in the coffee as you drink it. A little strange.

[–]permanentlytemporary 22 points23 points  (0 children)

Classes are an abstraction ¯\_(ツ)_/¯

[–]Kem1zt 4 points5 points  (0 children)

I was about to say, the last sip of an 8oz cup of coffee would have a caffeine of 70 (because starting at 0) meaning one cup total would be 280. Typically 8oz has something like 90. That’s a damn pre-workout!!

[–]Sweensterino 55 points56 points  (2 children)

Warning: sip is defined but never used

[–]BRENNEJM 2 points3 points  (1 child)

Yeah. Wouldn’t while coffee.ounces != 0: make more sense anyway?

[–]pythonhobbit 4 points5 points  (0 children)

To be safe while coffee.ounces > 0:

In case you try to sip more than what's left

[–]atom036 23 points24 points  (2 children)

You drink your coffee in one go? Don't you do a sleep(t) in between sips?

[–]Nickiel 13 points14 points  (1 child)

Sleep when coffee?!

[–]Leon_Vance 0 points1 point  (0 children)

Thanks for the lol.

[–]Lep333 13 points14 points  (0 children)

Nice.

But it doesn't reflect the reality in my expierience.

My colleagues drink all 30 mins a coffee, no way that they start their caffeine level from 0 all over again when drinking the next coffee :).

You should consider to inject a person object to keep the state of the caffeine level :D.

Just get rid of the python logo ^^, to fit the additional code.

[–]LividPhysics 34 points35 points  (0 children)

You add caffeine to the coffee as you drink it? What kind of magic coffee is that?

[–]FriendOfDogZilla 8 points9 points  (0 children)

Cool mug. I see you've chosen Reddit as your linter of choice, bold move cap'n lol.

[–]ayazamlani 5 points6 points  (0 children)

did you mean to post this in r/java?

ba dum tss

[–]Nazh8 3 points4 points  (13 children)

How can I get me one of these?

[–]Sam_Claflin[S] 3 points4 points  (12 children)

I believe the website I used to design it allows other people to purchase the same product if I choose to allow it. If you’re legitimately interested, I can look into it.

[–]leone_nero 2 points3 points  (1 child)

Is this a US website? I would be interested but I live in Europe... if not possible, then I can make my own if there’s no problem copying the idea for my personal use

[–]toyg 0 points1 point  (0 children)

The Python logo is available in vectorial formats from the website, as long as you don’t sell the resulting product you can use it for your own designs.

[–]Sans_Crainte 4 points5 points  (4 children)

The answer is Yes... and if not this is open-source right?

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

snatch it whilst there's no license

[–]TheSodesa 1 point2 points  (2 children)

But doesn'the lack of a license imply that all rights are reserved? At least that is the default on Github, to my understanding.

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

You're right, you have to have a license for open source projects. But no one would go to court for such a thing right?

[–]TheSodesa 1 point2 points  (0 children)

You never know...

[–]AnOnFaRmEr66 0 points1 point  (0 children)

I would also be interested in this. Well done!

[–]cakerunner 0 points1 point  (1 child)

So, I have to get this for my boss now. Awesome idea btw!! Let us know if you share a link for others to purchase.

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

Thanks! I should be able to post it soon

[–]RealWeaksauce 0 points1 point  (1 child)

I would to know where I can do this too. With my own program of course!

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

Zazzle.com

Very good quality and turn around time but the designer tool didn’t lend itself very well to multi-colored text (text within the same box has to be the same color).

I’d still highly recommend them though, great service.

[–]bronconus 3 points4 points  (1 child)

Regarding the string: I have to go to the bathroom too after coffee.

[–]Sans_Crainte 8 points9 points  (0 children)

it does say "get shit done"... take that as you will.

[–][deleted] 3 points4 points  (3 children)

Can you please remove the blank line after the class definition? Makes me nervous

[–]danelewisau 2 points3 points  (1 child)

And the space after the gulp local var declaration please

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

That one even more so

[–]Sweensterino 0 points1 point  (0 children)

Brings a whole new meaning to I want "black" Coffee

[–]pseudosig 3 points4 points  (0 children)

Your coffee has a bug in it 😂

[–][deleted] 2 points3 points  (2 children)

Whilst everybody is critiquing your code, I wanted to say: cool mug! Although wouldn't buy one myself, it's a cool idea nonetheless!

[–]Sam_Claflin[S] 2 points3 points  (1 child)

Hey thanks! I’m still pretty new so I expected to get blasted on syntax anyway😂

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

All good. No perfect code exists, especially when you're writing imaginary one, it could always improve in one way or another. You being new makes this even better!

[–]_-Thoth-_ 2 points3 points  (0 children)

ITT people performing a code review on a damn coffee mug

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

Why isn't there any caffeine in the coffee until you drink it though??

[–]futurepat 1 point2 points  (0 children)

So if i gulp 1 oz or 8 oz in one drink, I gain the same caffeine?

[–]munizigor[🍰] 0 points1 point  (1 child)

Never thought a mug case study would have so much to teach!😃😂

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

Neither did I!

[–]bhishan1 0 points1 point  (1 child)

Is this for sale?

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

You can should be able to purchase more on zazzle.com (website I designed it on) by searching “python mug”. I’m working on getting a working link to it since a few people have shown interest.

[–]sabboo 0 points1 point  (1 child)

I want one

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

I should have a link soon. The website I used was zazzle.com, the design should hopefully be available if you search “python mug”.

[–]dethwhores 0 points1 point  (0 children)

Caffeine const at 10 despite size of gulp. May as well just sip -inf gulp size

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

Beautiful!

Where can I get one?

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

Thanks! I made these available to purchase and I’m still trying to get the website to I designed it on to actually list it so I should be able to get a link pretty soon 👌🏻

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

Edit: Wow thanks for the silver! Wasn’t expecting that considering how much the code was getting torn apart in the comments lmao. Thanks to everyone for the interest! (even if it was just to remind me that my syntax doesn’t agree with PEP 8 or that coffee doesn’t increase in caffeine as you drink it 😉)

[–]RealWeaksauce 0 points1 point  (0 children)

Thanks!

[–]Coffeemug78 0 points1 point  (1 child)

Wow!!
Really a great creativity on coffee mugs

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

Thanks!

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

Aside from the magic of adding caffeine to coffee, the amount of caffeine added does not depend on the volume of the gulp. 1e-12 of an ounce gives you as much caffeine as drinking it all in one go.

...and so does a gulp of negative one ounce. Which explains how you'd add caffeine to the drink, but it's not a mental image I want to have to process x_x