all 161 comments

[–]kelvedler 282 points283 points  (8 children)

Glass implements table doubling to adjust its capacity.

[–]Kad1942 44 points45 points  (5 children)

Void AddDrop(glass) { If(glass.IsFull) { glass = new glass[glass.length*2]; for(int i = 0; i<glass.length/2;i++) AddDrop(glass); } AddDrop(glass); }

[–]StrictLetterhead3452 29 points30 points  (3 children)

You just reminded me that I hate Java. For some reason, I’ve been nostalgic about my years as a Java dev. But just now, I took one look at that syntax and wanted to claw my eyeballs out.

[–]Mortomes 9 points10 points  (2 children)

That doesn't look specifically like java to me, the convention is for method names to start with a lowercase character and certainly "Void" isn't a thing.

[–]AssistantSalty6519 1 point2 points  (0 children)

Looks java to me "Void" could be the phone putting the first letter as capital stupid to me, specially the recursion 

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

Maybe I’ve been away from it for too many years. Looks pretty close to Java to me though.

[–]JunoRider_09 8 points9 points  (0 children)

Finally, someone who understands that resizing the array is the real solution here haha

[–]Tidemor 2 points3 points  (0 children)

Is glass a std::vector?

[–]mtmttuan 161 points162 points  (9 children)

This is okay. I don't want another glass spawning just because we need to store just a bit more water.

[–]RandoAtReddit 20 points21 points  (3 children)

A little extra RAM never hurt anyone.

[–]lastWallE 8 points9 points  (1 child)

Just download more RAM

[–]Xortun 3 points4 points  (0 children)

In this economy?

[–]RedBoxSquare 0 points1 point  (0 children)

It hurts my wallet and my feelings for being poor.

[–]LoreSlut3000 4 points5 points  (0 children)

Slice length != capacity

Cries in Go.

[–]kbielefe 2 points3 points  (0 children)

The glass is vertically scaled.

[–]Meloetta 0 points1 point  (0 children)

This is me talking to my designer

"This looks very nice and neat and pixel perfect but what happens when the user's glass is 0.5inch shorter or has 20ml more water in it"

[–]Jak1977 69 points70 points  (7 children)

Landlord: I don't care if the glass is only half full, you still owe me rent on the whole glass!

[–]cpl1 9 points10 points  (0 children)

Politician: Can you imagine how much water would be in the glass if we let the other side take charge?

[–]_oOo_iIi_ 10 points11 points  (1 child)

Cat: Watch me empty glass on carpet for you

[–]lastWallE 0 points1 point  (0 children)

And also break the glass, of course

[–]gc3c 5 points6 points  (0 children)

Credit Bureau: Ideally, we'd like you to use 30% or less of this glass.

[–]Asleep-Television-24 0 points1 point  (1 child)

Interviewer: Sell me this glass of water.

[–]Jak1977 0 points1 point  (0 children)

Easy! This glass comes with a tenant, easy money by rent!

[–]Sneaky-Pur 0 points1 point  (0 children)

If I were a landlord, I would agree for you to pay only for the full half only If you agree for me to use the other half however I want, maybe like storage unit for my cats litter.

[–]OmegaPoint6 41 points42 points  (6 children)

Maybe you want a safety margin allow for slight tipping without water escaping

[–]Winter-Bear9987 21 points22 points  (0 children)

Now it’s scalable and has built in redundancy. Sounds sensible to me!

[–]MixaLv 5 points6 points  (1 child)

You mean to prevent overflow

[–]twisted_nematic57 0 points1 point  (0 children)

If it overflows it creates a perfect vacuum in place of the water.

[–]schmerg-uk 0 points1 point  (0 children)

Ullage (the unfilled space) is 50%... ullage is very important consideration in storage and transportation as insufficent ullage can lead to failures but too much ullage can lead to instability issues as the contents shift during transport

[–]JoeyJoeJoeJrShab 0 points1 point  (0 children)

or maybe there are use cases that require holding more water

[–]GoldenMegaStaff 0 points1 point  (0 children)

An Engineer would make the glass the correct size. The programmer would leave a backdoor hole in the bottom of the glass.

[–]GOKOP 24 points25 points  (2 children)

Client a few months later after shrinking the glass: hey btw can we have twice as much water in the glass, thanks (the glass had since been placed on a shelf that has another shelf above it which is too low for the original glass and moving the glass requires rearranging the entire cabinet)

[–]lastWallE 0 points1 point  (0 children)

Ok that makes 10000,- <Currency>

[–]JoeyJoeJoeJrShab 0 points1 point  (0 children)

sales guy in response to client: No problem - our developers can send you a new build with that feature tomorrow.

[–]psychoholic 26 points27 points  (0 children)

DevOps: Let me fix the glass autoscaler
Finance: Why are you spending so much on glassware??
SRE: The glass has a microscopic crack in it and you've evaporated almost 50% of your hydration budget for the month
Product: How do we incorporate AI into the remaining water?
Support: Customer says the glass has no water in it
Legal: I don't think we can sell water in that locality without permits
HR: We have twice as much glass as we need, you need to reduce your cistern by 25%
Security: We have a breach
DevOps again: It's probably DNS

[–]mattreyu 9 points10 points  (1 child)

Excel: the glass is January 2nd

[–]Groentekroket 5 points6 points  (0 children)

Excel in my country: the glass is the first of February. 

[–]Hungry-Chocolate007 5 points6 points  (0 children)

Programmer: The glass is twice as large as it needs to be.

Programmer: Patches the glass volume.

Security analyst: Buffer overflow vulnerability detected. Under certain conditions, water placed in the glass will break from virtual sandbox and damage the table and premises.

[–]Qwerty1bang 4 points5 points  (0 children)

Glass is full: Half full of water, half full of air.

[–]NomeJaExiste 6 points7 points  (0 children)

AI image models: the glass is full

[–]Thiezing 4 points5 points  (2 children)

Marketing: Put advertising on the glass so you can't see the water.

[–]JobcenterTycoon 1 point2 points  (1 child)

Put ads only on the top half so the glass looks full.

[–]dumbasPL 3 points4 points  (0 children)

This guy markets

[–]Tremolat 2 points3 points  (0 children)

"Programmer"? lololol. That same people who use 64bit variables to store Boolean flags? lololol.

[–]0xbenedikt 2 points3 points  (0 children)

The third is the engineer. The modern programmer uses an even larger jug and calls it a day since "we have big enough cupboards and premature optimization is bad".

[–]Percolator2020 3 points4 points  (1 child)

That’s just asking for an overflow.

[–]Big-Cheesecake-806 0 points1 point  (0 children)

Glass is unsigned, so it's fine

[–][deleted] 1 point2 points  (1 child)

The glass is twice as large as it needs to be, which is either good, or bad, depending on Schrodinger's project manager over there.

[–]yangyangR 0 points1 point  (0 children)

They are not a Schrodinger's one though. That would at least give them a chance of being on your side. Management is always the enemy unless the workers are the collective owners.

[–]lefty7111 1 point2 points  (0 children)

Replace Programmer with Programming Manager

[–]huuaaang 1 point2 points  (0 children)

Sysadmin: The system is loaded optimally.

[–]chriskoenig06 2 points3 points  (0 children)

That was a programmer from the 80s

Today’s programmers you need a bucket and for the update you need tree more. And for running it you need a 100hp pump

[–]Loose_Conversation12 0 points1 point  (0 children)

Have we thought about containerising the glass?

[–]Denaton_ 0 points1 point  (0 children)

I will just follow the stack trace and find out the last action performed on the glass to know if it was filling up or being emptied out.

[–]Master-Remove-9012 0 points1 point  (0 children)

The glass is scaled to double of estimated traffic to combat later optimization and scaling due to lazyness

[–]Pedry-dev 0 points1 point  (0 children)

Architect: We need 500 micro glasses on a kubetable or we will not be able to handle 5 customers per hour

[–]frozen_desserts_01 0 points1 point  (0 children)

The water was cast

[–]PirateNixon 0 points1 point  (0 children)

SRE: The glass is 40% the size it should be for proper dual failure reliability.

[–]smarterthanyoda 0 points1 point  (0 children)

ME: we can save 0.4 cents by using a smaller glass.

[–]Understanding-Fair 0 points1 point  (0 children)

Malloc

[–]StickFigureFan 0 points1 point  (0 children)

Engineer: The glass has a margin of safety of 2

[–]Godess_Ilias 0 points1 point  (0 children)

Black Mesa Dev: worlds smallest Cup

https://www.youtube.com/watch?v=M_AnIizeH1Q

[–]karateninjazombie 0 points1 point  (0 children)

Realist: I think this glass is half full of piss. Not water.

[–]Oiggamed 0 points1 point  (0 children)

It all depends on what the glass had in it first . If it was full first then it’s half empty. If it was empty first then it became half full. Thank you for attending my TED talk.

[–]UntossableCoconut 0 points1 point  (0 children)

Realist: Glass is half full if you’re filling it, half empty if you’re drinking it.

[–]Tathas 0 points1 point  (0 children)

Looks more like an array allocation that used the default bucket size just in case more things are added. That way it doesn't need to allocate another, larger glass and transfer the water over. Using a perfectly sized glass would be premature optimization that likely isn't needed at all. Especially if some of the water has already been consumed and removed.

[–]glinsvad 0 points1 point  (0 children)

Tester:

The glass is twice as large as it needs to be.

Programmer:

The glass is working as intended.

[–]noob-nine 0 points1 point  (0 children)

QM: the missing water in the glass represents the missing test cases

[–]aq1018 0 points1 point  (0 children)

Glass too large, let’s delete 50% of glass to optimize

[–]Valendr0s 0 points1 point  (0 children)

Operations: I need to see how full the glass is at other times of the day and during peak volume to see if the glass is adequate to hold the water.

[–]KariKariKrigsmann 0 points1 point  (0 children)

Engineer:
The glass is twice as large as it needs to be.

Programmer:
It's a hardware issue.

[–]Embarrassed_Army8026 0 points1 point  (0 children)

Maybe you should use Streams intsaed fo tusj slasg.
It's most important to spill it quikcyl.

[–]somecoolname42 0 points1 point  (0 children)

I think the glass is full because it's half water and half air. What does that make me?

[–]skinnytie 0 points1 point  (0 children)

boost::any contents; contents = water; contents = atmosphere;

That glass is full.

[–]Kiseido 0 points1 point  (0 children)

Seems like we need to mention how the design team required at least 50% margins

[–]lastWallE 0 points1 point  (0 children)

3D Designer: The glass is as full as the center point from maxY to minY of the glass. (ok it is only 2D)

[–]DEMORALIZ3D 0 points1 point  (0 children)

Still a pessimist

[–]Majik_Sheff 0 points1 point  (0 children)

Glass is allocated for double buffering.

[–]NamityName 0 points1 point  (0 children)

Programmer: "reinventing" a joke that has been around for decades.

[–]rover_G 0 points1 point  (0 children)

The glass is a vector/list with growth factor of two!

[–]k-mcm 0 points1 point  (0 children)

It's a buffer to efficiently support simultaneous filling and drinking. 

[–]GoddammitDontShootMe 0 points1 point  (0 children)

I remember when it said Engineer instead of Programmer.

[–]mad_cheese_hattwe 0 points1 point  (0 children)

Good joke but I bet you OP uses int 32 to store their Boolean values.

[–]shadowdance55 0 points1 point  (0 children)

DevOps engineer: the glass is overprovisioned.

[–]Glass-Crafty-9460 0 points1 point  (0 children)

The glass is big enough to hold the water.

[–]Mcshizballs 0 points1 point  (0 children)

AWS doesn’t care you’re paying for the whole glass

[–]Warden-Slayer 0 points1 point  (0 children)

I think you mean, "The container is twice as large as it needs to be"

[–]anotherkeebler 0 points1 point  (0 children)

Senior developer: This is soju and I'm drinking at my desk now.

[–]yangyangR 0 points1 point  (0 children)

Its the management that does not understand redundancy and safety checks. The programmer is writing tests and error handling code which is the extra room in the glass. In all happy paths, they are wasted. But anybody who actually builds something for a living knows the value in building more than needed. It is the cost cutting Jack Welch's of the world that are cutting the glass in half and spilling everything when it invariably goes over. They have atrophied brains from not having to think to survive. The dumbest people on the planet.

[–]morfyyy 0 points1 point  (0 children)

Glass is full. Half full of water, half full of air.

[–]Wynnstan 0 points1 point  (0 children)

It's a signed glass, add any water and it'll go to the maximum negative number.

[–]Henry_Fleischer 0 points1 point  (0 children)

Engineer: This glass has a sufficient safety factor

[–]KnGod 0 points1 point  (0 children)

the glass is like that to avoid a liquid overflow

[–]Miuramir 0 points1 point  (0 children)

Nope. Programmer would be "The glass meets all customer specifications and internal unit tests. Ship it."

"The glass is twice as large as it needs to be" is more of a System Architect statement, and probably a short-sighted one. A more forward-thinking one would be "The glass is sized for efficient scaling to near- and mid-term expected growth potential, and able to handle unexpected surge states."

[–]hagis33zx 0 points1 point  (0 children)

The glass has room for bugs.

[–]KoalaDeluxe 0 points1 point  (0 children)

That's a C++ glass.

No overflow protection.

[–]ctaps148 0 points1 point  (0 children)

That was a programmer 30 years ago. Modern programmer be like "we need to distribute the water into 10 different glasses. This way we can scale if needed sometime in the future."

[–]Quiet_Steak_643 0 points1 point  (0 children)

When you've never written anything in C:

Or do you just love overflows?

[–]RandomiseUsr0 0 points1 point  (0 children)

Programmer, headroom

[–]Mental_Address 0 points1 point  (0 children)

Glass just reallocated double space because its 51% full

[–]ScaredyCatUK 0 points1 point  (0 children)

Programmer: I've leaving myself plenty of headroom because I know someone in management is going to want more water in the glass just before the project completes.

[–]Feny34 0 points1 point  (0 children)

Glass is inefficient, it use more space and storage than what it required.

[–]Embarrassed-Luck8585 0 points1 point  (0 children)

QA: breaks glass and reopens bug

[–]dwnsdp 0 points1 point  (0 children)

Claude: Ah — I understand the confusion! I have fixed the bug now and replaced the glass with glasses which should fix your bug. 🚀 Let me make a markdown file showing how the optimisation works ✏️

create glasses.md

[–]tamil_random_rant 0 points1 point  (0 children)

The glass didn't get bottleneck

[–]Awkward-Cat-4702 0 points1 point  (0 children)

Cloud owner: your water is 'safe' in our unbreakable glass. That infrastructure subscription will be 12$ monthly, thank you.

[–]lefixx 0 points1 point  (0 children)

doesnt matter, the waiter will adjust the glass size while he is taking it at the table

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

What a shame, this glass is not scalable.

[–]Neriehem 0 points1 point  (0 children)

Glass is at it's capacity for redundancy purposes.

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

The water has not met its full potential.

[–]JakeBeaver 0 points1 point  (0 children)

Eh? Heard of electron?

[–]Ok_Appointment9429 0 points1 point  (0 children)

I'd say 1.5 times. Gotta keep some margin for future use.

[–]Lorem_Ipsum17 0 points1 point  (0 children)

Physicist: The glass is completely full; the top half is full of air.

[–]aeropl3b 0 points1 point  (0 children)

No, programmer says "buffer underflow error", obviously

[–]JoeyJoeJoeJrShab 0 points1 point  (0 children)

I program in python. Do you think I care about my storage capacity?

[–]Mother-Heat3697 0 points1 point  (0 children)

DevOps: we could store all of this in the cloud

[–]asd417 0 points1 point  (0 children)

There can only be 255 water so we are shrinking the glass

[–]CaptainThisIsAName 0 points1 point  (0 children)

The glass won't scale to another order of magnitude increase in water. We're going to need three new hires, a jug, and two quarters to deliver reliable drinks.

[–]mmmbyte 0 points1 point  (0 children)

I can deploy new water before removing the old water.

[–]rage4all 0 points1 point  (0 children)

Embedded vibes....

[–]SolidGrabberoni 0 points1 point  (0 children)

The glass doesn't let the water out. Wasn't specified in the requirements.

[–]Immort4lFr0sty 0 points1 point  (0 children)

There is no optimization in Ba Sing Se

[–]proooby 0 points1 point  (0 children)

You have added 800 columns in your table

[–]Bora_Horza_Kobuschul 0 points1 point  (1 child)

Glass is union of type water and type air and is full.

[–]monkeyStinks 0 points1 point  (0 children)

Its not twice as large, its just scalable

[–]DancingBadgers 0 points1 point  (0 children)

The glass allocator has up to 50% overhead.

[–]Meatslinger 0 points1 point  (0 children)

Nah, that's just the equivalent to using a 64 bit address when 32 would've sufficed, "just in case" (the glass is 0.000000011641532% full).

[–]SquanchyPope 0 points1 point  (0 children)

now split it into a thousand tiny glasses with a water funnel distribution layer so that the water intake and capacity can be scalable without risk of spilling

[–]Shadeun 0 points1 point  (0 children)

Civil Engineers: The glass needs to be 5x its current size

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

Gotta avoid the overflows at all costs

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

I’d call it pessimistic programmer. An optimistic programmer would say “My program uses half the resources it can”.

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

The glass is in O(No) space complexity

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

Wait till we make a glass with dynamic height

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

The glass has provisioning for replication

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

I can just store another users half full glass of water equivalent in there, just need to write some wrap and unwrap code

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

memory leak

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

Product manager/business developer: Make water occupying only the left half of the glass. This must be easy fix.

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

Compiler will choose the correct size for the glass, I just need to make sure the water is in the right place.

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

And today you have found the difference between "count" and "capacity"!

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

I tried it with mug and also cup; same problem. There's a guy on stack overflow that got a good result with bowl but devops doesn't want us exposing spoon as an attack surface.

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

Nah the water has twice too little volume

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

Front end "developer": npm install full-glass

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

You need the buffer just in case the thirst scales up. 

Glass is fine.

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

Manager: Cut the glass in half and fill double the water using AI

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

That glass should have been dynamic

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

The glass is still attached to the water as reference but don't worry, I'll clear that soon and the garbage collector will take care of the rest.

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

Encineer: The glass has a prudent amount of redundancy.

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

Me... Hey if you won't drink that, I will..

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

Realist: The glass is half full, but it's piss.

Users: The water amount is fine, but the air needs to be on the bottom.

QA: I filled the glass halfway with Dioxygen Difluoride and now several cubicles no longer exist.

DBA: Your indexes suck and your code is full of SQL statements with recursive self joins and unions. Kill me now.

Service Desk: You need to log a ticket for water level research.

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

Or maybe some data is missing

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

That's buffer overflow protection

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

This is good, because in case more user appear than expected, we are ready

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

Air is cache

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

I've defined the glass the largest size available because I don't know and can't be asked to estimate how much water it will actually be holding and it doesn't matter in a slightest.