433
This is a glass (thelemmy.club)
top 50 comments
sorted by: hot top new old
[-] Jankatarch@lemmy.world 1 points 4 hours ago* (last edited 4 hours ago)

Birb: How the fuck is water doing that °v°

[-] socsa@piefed.social 11 points 9 hours ago

Senior engineer: the glass is self documenting.

[-] UpperBroccoli@lemmy.blahaj.zone 9 points 13 hours ago
/**
 * @brief This is the coffee cup class
 * 
 * This class describes a cup or mug that neatly integrates a
 * container for vectors of cCoffee instances with a fully
 * functional handle to carry the cup or mug around. Used for 
 * pretty much everything.
 */
class cTallGlass : public cGlass {
[-] TheMightyCat@ani.social 5 points 13 hours ago
// This might be a glass
Glass* glass = dynamic_cast<Glass*>(container);
[-] Kolanaki@pawb.social 32 points 19 hours ago* (last edited 19 hours ago)

Unless it is in a vacuum, the glass is full.

50% water, 50% gas mixture.

[-] rmuk@feddit.uk 3 points 10 hours ago

I can't believe no-one else has posted this yet.

Relevant xkcd: https://what-if.xkcd.com/6/

Also, relevant xkcd video: https://youtu.be/0EytSWiKrFg

[-] rockerface@lemmy.cafe 34 points 19 hours ago

Topologist: The glass is full of glass. Everything else is on the outside.

[-] isolatedscotch@discuss.tchncs.de 9 points 18 hours ago

https://what-if.xkcd.com/6/

no, I actually wanted it empty

[-] surewhynotlem@lemmy.world 3 points 18 hours ago

If it were a vacuum the water would quickly boil away with any remaining turning to ice.

[-] cenzorrll@piefed.ca 2 points 17 hours ago

It wouldn't freeze unless you drop the temperature as well.

[-] jerkface@lemmy.ca 9 points 16 hours ago* (last edited 16 hours ago)

The phase transition from liquid to gas absorbs all the thermal energy in the remaining liquid and causes its temperature to drop to freezing point. You are familiar with this effect if you have used a tank of compressed gas; the tank gets cold as you release the gas and you might see condensation on the tank up to the liquid level.

But then the remaining ice in the glass sublimates anyway.

[-] PattyMcB@lemmy.world 4 points 14 hours ago

Who are you who are so wise in the ways of science?

[-] Tlaloc_Temporal@lemmy.ca 1 points 3 hours ago

Just some jerkface.

[-] ImgurRefugee114@reddthat.com 64 points 22 hours ago* (last edited 22 hours ago)

It's not a glass, it's the

hydrationContainerManagerObjectFactory

Not to be confused with the

hydrationContainerManagerTypeFactory

Which is the template

[-] Viceversa@lemmy.world 9 points 17 hours ago

Do developers still code in such a manner?

[-] jaybone@lemmy.zip 13 points 17 hours ago

Some of those patterns were actually good design, until everyone went overboard with them. Now the pendulum has swung the complete opposite way and there’s a ton of duplicate code often generated from actual templates.

[-] Valmond@lemmy.dbzer0.com 26 points 21 hours ago

You forgot the AbstractHydrationManager

[-] Avicenna@programming.dev 19 points 18 hours ago

//don't remove this comment or else

[-] greedytacothief@lemmy.dbzer0.com 14 points 16 hours ago

Load bearing comment

[-] KokusnussRitter@discuss.tchncs.de 7 points 17 hours ago

//what if I remove this comment and else?

[-] AstroLightz@lemmy.world 4 points 14 hours ago

//Then line 368 that checks if the comment exists will fail and will be sad

[-] Ftumch@lemmy.today 35 points 22 hours ago* (last edited 22 hours ago)

That's not a good comment. What it is should be clear from the naming and context. A good comment explains the why when that is not obvious:

// This glass is at 50% capacity because we don't want it to overflow if it rains
[-] one_old_coder@piefed.social 11 points 21 hours ago

And in 5 years you will wonder why the glass is under the rain because someone didn't put that in the specifications.

load more comments (1 replies)
[-] BorgDrone@feddit.nl 20 points 22 hours ago

Engineer: this glass is twice as big as it needs to be.

[-] LovableSidekick@lemmy.world 1 points 12 hours ago

- comedian Gallagher

[-] saxrussell@slrpnk.net 2 points 17 hours ago

Ha, sorry just saw your post! 😆 Wise minds and such… 😉

load more comments (1 replies)
[-] Racoonwithbenefits@lemmy.zip 18 points 21 hours ago* (last edited 21 hours ago)

While filling the glass: glass is half full

While emptying the glass: glass is half empty

Context matters

Comment would be whether glass is being emptied or filled

[-] OwOarchist@pawb.social 5 points 20 hours ago* (last edited 20 hours ago)

Comment would be whether glass is being emptied or filled

What if it's neither (and unknown which it was previously), and the glass is just sitting there?

[-] jaybone@lemmy.zip 5 points 16 hours ago

IllegalStateException

[-] FuglyDuck@lemmy.world 24 points 23 hours ago

Opportunist... "It's an empty glass. I drank it while you were arguing."

[-] jason@discuss.online 6 points 18 hours ago

Scientist.. "it's half empty because the water is slowly evaporating."

[-] saxrussell@slrpnk.net 5 points 17 hours ago

Engineer: The glass is too big!

[-] akunohana@piefed.blahaj.zone 6 points 19 hours ago

IT support chatbot when the client asks how to get an empty/full glass to display: You're absolutely right! I couldn't have said it better myself: This is a glass. 😊🥛

[-] RustySharp@programming.dev 9 points 22 hours ago

The current legacy code I'm dealing with is full of these:

// TODO: Class description here to satisfy linter

[-] Valmond@lemmy.dbzer0.com 5 points 21 hours ago
[-] Jankatarch@lemmy.world 2 points 4 hours ago

That sounds horribe, actually.

load more comments (6 replies)
load more comments (1 replies)
[-] SnotFlickerman@lemmy.blahaj.zone 9 points 22 hours ago* (last edited 22 hours ago)
// This is a Glass class
class Glass {
     filled(halfFull,  halfEmpty) {
         this.halfFull;
         this.halfEmpty;
         }
}
[-] jaybone@lemmy.zip 3 points 16 hours ago

What the hell kind of glass is this?

[-] dan@upvote.au 8 points 22 hours ago* (last edited 22 hours ago)

AI loves inserting comments like this.

Either that or 20-line comments documenting the bugs in the old code, what this code does differently, and the exact implementation.

Comments describing the exact implementation become stale very quickly. Comments shouldn't explain what the code does (eg "add two to rowCount"); they should explain why it does it (eg "include header and footer row in count too"). Extra details are what the commit message is for, and history is what source control is for.

I call it out in a lot of my code reviews ("code looks good but clean up the AI slop comments before landing") but a lot of other developers don't care as much about code and documentation quality.

[-] kalapala@sopuli.xyz 5 points 19 hours ago* (last edited 19 hours ago)

Commented out glass is certainly a problem (if it's not only a comment) as the instance of object is created elsewhere but there's some more problems in the code:

-Software tester removes the glass but the water still stands there in the shape of the glass.

-QA tries to pour the water in to the glass but water doesn't register and the glass doesn't fill.

-Performance testing notes that rendering the glass needs some optimization since the glass doesn't fill over 50% before being out of memory.

-Junior programmer can't get the glass to run since the liquids library wasn't locked down and got an incompatible update.

-Automation testing results in to a crash with a screenshot and logs that point out that glass frontend use the old version of the glass backend API leading the glass to freeze.

-External testing points out that there's a bug in the glass but they can't identify it.

[-] amio@lemmy.world 5 points 20 hours ago* (last edited 20 hours ago)
Glass _glass = new Glass(); //make variable glass of type glass and make a new glass
///<captainusefuldoc>Gets the glass</captainusefuldoc>
Glass getGlass() => _glass; //get the glass in _glass
[-] Codpiece@feddit.uk 5 points 21 hours ago

You guys are getting code comments???

[-] WanderingThoughts@europe.pub 3 points 19 hours ago

Marketing: the glass is perfectly dimensioned to transport that amount of water without spilling anything! Buy yours now for a discount! Terms and conditions may apply.

load more comments
view more: next ›
this post was submitted on 28 Jul 2026
433 points (96.0% liked)

Programmer Humor

32507 readers
1245 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 3 years ago
MODERATORS