This is a glass

3 months ago by CodyIT to c/programmer_humor

ImgurRefugee114 73 points 3 months ago

It's not a glass, it's the

hydrationContainerManagerObjectFactory

Not to be confused with the

hydrationContainerManagerTypeFactory

Which is the template

path: 0 24995142, hotness: undefined, score: 73, children: 4
Valmond 29 points 3 months ago

You forgot the AbstractHydrationManager

path: 0 24995142 24995381, hotness: undefined, score: 29, children: 0
Viceversa 11 points 3 months ago

Do developers still code in such a manner?

path: 0 24995142 24997948, hotness: undefined, score: 11, children: 1
jaybone 16 points 3 months 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.

path: 0 24995142 24997948 24998710, hotness: undefined, score: 16, children: 0
unwarlikeExtortion 2 points 3 months ago

you mean

glass Glass;

which is almost worse than stringing together random fancy words.

(Edit: added backticks for that nice mono font)

path: 0 24995142 25014348, hotness: undefined, score: 2, children: 0
Ftumch 40 points 3 months 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
path: 0 24995276, hotness: undefined, score: 40, children: 3
one_old_coder 15 points 3 months ago

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

path: 0 24995276 24995549, hotness: undefined, score: 15, children: 2
xthexder 3 points 3 months ago

Inevitably whatever is under the glass gets wet anyway... because it's raining.

path: 0 24995276 24995549 24996746, hotness: undefined, score: 3, children: 0
hakunawazo 1 point 3 months ago

A software tester walks into a bar

Runs into a bar.
Crawls into a bar.
Dances into a bar.
Flies into a bar.
Jumps into a bar.

And orders:

a beer.
2 beers.
0 beers.
99999999 beers.
a lizard in a beer glass.
-1 beer.
"qwertyuiop" beers.
Testing complete.

A real customer walks into the bar and asks where the bathroom is.

The bar goes up in flames.

path: 0 24995276 24995549 25019003, hotness: undefined, score: 1, children: 0
Kolanaki 37 points 3 months ago

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

50% water, 50% gas mixture.

path: 0 24996678, hotness: undefined, score: 37, children: 9
rockerface 42 points 3 months ago

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

path: 0 24996678 24997169, hotness: undefined, score: 42, children: 0
rmuk 6 points 3 months ago path: 0 24996678 25005389, hotness: undefined, score: 6, children: 0
surewhynotlem 4 points 3 months ago

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

path: 0 24996678 24997742, hotness: undefined, score: 4, children: 6
cenzorrll 2 points 3 months ago

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

path: 0 24996678 24997742 24998373, hotness: undefined, score: 2, children: 5
jerkface 12 points 3 months 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.

path: 0 24996678 24997742 24998373 24998805, hotness: undefined, score: 12, children: 3
PattyMcB 5 points 3 months ago

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

path: 0 24996678 24997742 24998373 24998805 25001613, hotness: undefined, score: 5, children: 2
cockmushroom 1 point 2 months ago

Who told you about hot vacuums? That was a secret!

path: 0 24996678 24997742 24998373 25093465, hotness: undefined, score: 1, children: 0
FuglyDuck 26 points 3 months ago

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

path: 0 24994728, hotness: undefined, score: 26, children: 1
jason 7 points 3 months ago

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

path: 0 24994728 24997328, hotness: undefined, score: 7, children: 0
BorgDrone 22 points 3 months ago

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

path: 0 24995349, hotness: undefined, score: 22, children: 3
saxrussell 3 points 3 months ago

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

path: 0 24995349 24998071, hotness: undefined, score: 3, children: 0
XLE 1 point 3 months ago
path: 0 24995349 24995692, hotness: undefined, score: 1, children: 0
LovableSidekick 1 point 3 months ago

- comedian Gallagher

path: 0 24995349 25002975, hotness: undefined, score: 1, children: 0
Avicenna 22 points 3 months ago

//don't remove this comment or else

path: 0 24997569, hotness: undefined, score: 22, children: 4
greedytacothief 17 points 3 months ago

Load bearing comment

path: 0 24997569 24999158, hotness: undefined, score: 17, children: 0
KokusnussRitter 7 points 3 months ago

//what if I remove this comment and else?

path: 0 24997569 24998020, hotness: undefined, score: 7, children: 2
AstroLightz 5 points 3 months ago

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

path: 0 24997569 24998020 25000784, hotness: undefined, score: 5, children: 1
KokusnussRitter 1 point 3 months ago

No :(

path: 0 24997569 24998020 25000784 25007925, hotness: undefined, score: 1, children: 0
Racoonwithbenefits 20 points 3 months ago
path: 0 24995566, hotness: undefined, score: 20, children: 2
OwOarchist 6 points 3 months 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?

path: 0 24995566 24996272, hotness: undefined, score: 6, children: 1
jaybone 5 points 3 months ago

IllegalStateException

path: 0 24995566 24996272 24998785, hotness: undefined, score: 5, children: 0
socsa 18 points 3 months ago

Senior engineer: the glass is self documenting.

path: 0 25005555, hotness: undefined, score: 18, children: 0
SnotFlickerman 11 points 3 months ago
// This is a Glass class
class Glass {
     filled(halfFull,  halfEmpty) {
         this.halfFull;
         this.halfEmpty;
         }
}
path: 0 24995053, hotness: undefined, score: 11, children: 2
jaybone 3 points 3 months ago

What the hell kind of glass is this?

path: 0 24995053 24998866, hotness: undefined, score: 3, children: 1
cockmushroom 1 point 2 months ago

Quantum, obviously

path: 0 24995053 24998866 25093514, hotness: undefined, score: 1, children: 0
RustySharp 11 points 3 months ago

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

// TODO: Class description here to satisfy linter

path: 0 24995220, hotness: undefined, score: 11, children: 10
Valmond 7 points 3 months ago

// I'm paid by the line

path: 0 24995220 24995396, hotness: undefined, score: 7, children: 8
OwOarchist 4 points 3 months ago
"""
only one line for your comment?
fucking amateur
this comment uses five lines
"""
path: 0 24995220 24995396 24996303, hotness: undefined, score: 4, children: 5
xthexder 5 points 3 months ago
/*
 * this five line comment
 * is formatted C plus plus
 * and is a haiku
 */
path: 0 24995220 24995396 24996303 24996906, hotness: undefined, score: 5, children: 4
jerkface 3 points 3 months ago

A haiku has to use elements of the natural world in a symbolic manner.

path: 0 24995220 24995396 24996303 24996906 24998867, hotness: undefined, score: 3, children: 3
Jankatarch 3 points 3 months ago

That sounds horribe, actually.

path: 0 24995220 24995396 25010537, hotness: undefined, score: 3, children: 0
staircase 1 point 3 months ago
path: 0 24995220 24995396 25005345, hotness: undefined, score: 1, children: 0
one_old_coder 2 points 3 months ago

Don't you have stuff like // NOLINTNEXTLINE to explicitely disable some lints?

path: 0 24995220 24995539, hotness: undefined, score: 2, children: 0
UpperBroccoli 10 points 3 months 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 {
path: 0 25002723, hotness: undefined, score: 10, children: 0
dan 8 points 3 months 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.

path: 0 24995350, hotness: undefined, score: 8, children: 1
partofthevoice 1 point 3 months ago
path: 0 24995350 25013657, hotness: undefined, score: 1, children: 0
saxrussell 5 points 3 months ago

Engineer: The glass is too big!

path: 0 24998046, hotness: undefined, score: 5, children: 0
TheMightyCat 5 points 3 months ago
// This might be a glass
Glass* glass = dynamic_cast<Glass*>(container);
path: 0 25002363, hotness: undefined, score: 5, children: 0
kalapala 5 points 3 months 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.

path: 0 24996634, hotness: undefined, score: 5, children: 0
amio 5 points 3 months 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
path: 0 24996542, hotness: undefined, score: 5, children: 0
Codpiece 5 points 3 months ago

You guys are getting code comments???

path: 0 24995760, hotness: undefined, score: 5, children: 0
Shalien 5 points 3 months ago

//This a glass // To get the quantity and type of content use
// glass->qty : float
// glass->content : glass_content

path: 0 24994732, hotness: undefined, score: 5, children: 3
LeFrog 5 points 3 months ago
if glass.empty?
  make_sad_noise
else
  homi.hydrate(glass.qty)
end
path: 0 24994732 24995086, hotness: undefined, score: 5, children: 1
rbn 3 points 3 months ago

You should check against homi.healthyCapacity first unless you want to drown them.

path: 0 24994732 24995086 24995693, hotness: undefined, score: 3, children: 0
red_tomato 4 points 3 months ago

How can you be so sure other readers will understand floating point numbers? Better include the entire IEEE 754 standard just in case.

path: 0 24994732 24995189, hotness: undefined, score: 4, children: 0
akunohana 5 points 3 months 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. 😊🥛

path: 0 24997170, hotness: undefined, score: 5, children: 0
WanderingThoughts 3 points 3 months 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.

path: 0 24997072, hotness: undefined, score: 3, children: 0
sunbeam60 2 points 3 months ago

Feel like we’re missing an overflow joke here!

Or something like: // initialise a glass using max water value as indicator that glass is unused

path: 0 25013202, hotness: undefined, score: 2, children: 0
Jankatarch 1 point 3 months ago

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

path: 0 25010485, hotness: undefined, score: 1, children: 0
observes_depths 1 point 3 months ago

Capacity = 0.5

path: 0 25014981, hotness: undefined, score: 1, children: 0
programmer_humor
programmer_humor

@programming.dev

login for more options
33644
2564
7638

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

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
    • If the mod doesn't find it funny, you're banned. Ha-ha!... For real: do not use the community for "statements". There are other places for such content. Keep it chill and funny.

go to feed...