You forgot the AbstractHydrationManager
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.
you mean
glass Glass;
which is almost worse than stringing together random fancy words.
(Edit: added backticks for that nice mono font)
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
And in 5 years you will wonder why the glass is under the rain because someone didn't put that in the specifications.
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.
Topologist: The glass is full of glass. Everything else is on the outside.
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
If it were a vacuum the water would quickly boil away with any remaining turning to ice.
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.
Who told you about hot vacuums? That was a secret!
Ha, sorry just saw your post! 😆 Wise minds and such… 😉
- comedian Gallagher
Load bearing comment
//what if I remove this comment and else?
//Then line 368 that checks if the comment exists will fail and will be sad
No :(
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?
// This is a Glass class
class Glass {
filled(halfFull, halfEmpty) {
this.halfFull;
this.halfEmpty;
}
}
Quantum, obviously
The current legacy code I'm dealing with is full of these:
// TODO: Class description here to satisfy linter
"""
only one line for your comment?
fucking amateur
this comment uses five lines
"""
That sounds horribe, actually.
Don't you have stuff like // NOLINTNEXTLINE to explicitely disable some lints?
/**
* @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 {
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.
Engineer: The glass is too big!
// This might be a glass
Glass* glass = dynamic_cast<Glass*>(container);
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.
How can you be so sure other readers will understand floating point numbers? Better include the entire IEEE 754 standard just in case.
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.
Birb: How the fuck is water doing that °v°
Capacity = 0.5
@programming.dev
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.
go to feed...
@programming.dev
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.
go to feed...
It's not a glass, it's the
hydrationContainerManagerObjectFactory
Not to be confused with the
hydrationContainerManagerTypeFactory
Which is the template
save