The Programming Husband
Sources: 9Gag
3rd April 2010 by Boris
Boris is a blogger, speaker and serial entrepreneur. He founded The Next Web but also V3 Redirect Services (sold), HubHop Wireless Internet Provider (sold), Twitter Counter, Spread.us and several other companies. Boris is very active on Twitter as @Boris, on Google+ and Facebook.
FollowComments are closed.
[...] Enlace original. Comparte esta entrada: [...]




If I ever had a husband that did that I would love it~ so dorky and adorable. <3
you are such a pervert!
Why would that make her a pervert?
Haha… stumbled here and literally laughed out loud at that.
I'm not a pervert, I just love my geeks at their geekiest. ;)
This story is actually quite wrong. The if statement is as follows:
Buy some bread
If (eggs) {
Buy 6 //bread (assumed)
}
So the husband whould show up with AT LEAST 7 loaves.
You are incorrect. The story is accurate in that, the overall task is to buy bread, therefore the program's name would be buy bread. The code would be just one if statement.
if eggs
buy 6 loaves
else
buy 1 loaf
end if
Not necessarily. If buying bread was defined as the function of the trip, which in this case it is, then the story makes sense.
function buyBread(int loaves){
// buy bread
}
if(eggs)
buyBread(6);
Stumbled this and lol'd. Can I get some Ruby in this bitch!?
if eggs > 0 then bread += 6 else bread += 1 end
SO TRUE
You can't just do bread+=, that'd be simply stealing the bread. You need to call the store's buy method, (assuming OOP design), or a global static function (assuming procedural design).
int breadCount = 1;
if dairy.checkStore(“eggs”) //returns bool true if 'string' > 0
breadCount = 6;
buyItem(“Bread”, breadCount); //buy the item 'string', int number of times
I'd do this in COBOL but there wouldn't be room on the page.
Travelan,
I disagree with a 7 total here, the preposition 'some' can in reality mean 1 to infinity – as this is not a definitive quantity the number 6 would also clasify as 'some'. It is assumed that the initial quantity that 'some' refers to is actually 1, however in such case that there are eggs he is to buy 6 – the above image is psuedo code in theory.
Item Bread = Store::Item('bread'); //Store item, Bread (return null if none);
Checkout Till = new Checkout(); //Checkout process
Bread.Quantity = (Store::ItemQuantity('eggs') > 0) ? 6 : 1; //Store::ItemQuantity returns int value with number of items of type in store – in this case how many boxes of eggs
Till.AddItem(Bread); //Add item to checkout
…
This could go on … lol.
And there it is a bunch of examples of how geek we all are (i'm a programmer)…
Only geeks would try to convert a every day life situation into PROGRAMMING CODE…
LOL
and in actual code language…
Well… i'm guilty too. LOOOOL
I believe that might be called a 'non-sequi-slam'.
This joke was made by a jockey
The joke is great, but the comments are even better :)
Actually the solution is as below..
int BuyBread(void)
{
int x; // Number of loaves to buy
if (eggs)
x = 6;
return x;
}
The key here is that x is initially undefined and initialised. Only if the eggs condition is met, then it is actually defined. If the condition is not met, the husband could come with a random amount of bread depending on what was in that register or memory location at the time.
This will usually come up as a compiler warning in most languages – thus instructing the wife to be more specific in the future.
i would say
return ((eggs>0)?6:1);
LOL Like it
Shoddy design. The programmer's designer clearly neglected to keep track of the null transitive object (which should contain all referents and conversation partners with whom it applies, and the time of reference). When a function that looks for an object but does not require one (such as is the case with buy() – the function would be written def buy(object = None, time = None, location = None, manner = None …) and would check the relevant referents for null arguments), the program ought to try to buy each previous potential referent (matching on conversation partner, with a call to check_deixis run asynchronously (which would break the loop on a return that does not raise a ContextError)), and break if it the call goes over the programs max_response_time variable. If it encounters a ContextError after this, the program should handle it buy calling request_clarification. This would have resulted in six eggs and 1 loaf of bread (or however many loaves of bread the husband's default buy function would buy) instantly on all but the very slowest of processors, which would require a call to the wife's clarify function (with associated communications delays). And as an aside, good design would have us parsing the input as it's received for clarity rather than coming back to it as it's being executed. If I were the wife of the program that returned as written above, I'd be looking for an upgrade.
Me, too!
me 3!!!!!!
Me 4!
Me 6!
“which would require a call to the wife's clarify function “
clarify functions do not come with the wife models…
Me 7!
It made sense to me.
Me 8!
me 5!! No one ever claimed number 5.
I don't know whats funnier the joke above or how nerdy i am for laughing xD!
Me 0! It's the start of every int.
me 9!!
me 10!
me sqrt(121)
i cant believe i read ALL comments ,hilarious. good show
There's something seriously wrong here! Surely it should be:
if (wifeExpectsHusbandToDoShopping()){
getDivorce();
BeenMarriedBefore = true;
startLookingForGirlfriend(BeenMarriedBefore);
}
me 761
Hahaha good joke and even better comments
import math
math.sqrt(196)
thats me!
HAHAHA… I love the comments more than the joke itself…
I Disagree. I think donkey kong is better!
post funny, the comments funnier… and anyway who only goes out for bread a milk… ??
you guys are such fags.
we all got the joke. get over it.
:)
var totalLoafsOfBread:int = 0;
var totalEggsAtGroceryStore:int = 6;
public function purchaseBreadFromGroceryStore():int
{
for (var eggCounter:int = 0; i < totalEggsAtGroceryStore; eggCounter++)
{
totalLoafsOfBread++;
}
return totalLoafsOfBread;
}
trace(purchaseBreadFromGroceryStore());
HOly COw, that was hilarious. . . I vote for tall guy’s solution. . . she did say “goto” afterall.. . .
NERDS!
Get a Life!! Inno w eir!!!
hehe 3anjad w eir!
tlat 2yoora kamein!!!!!
Truly, you aren’t going low-level enough:
“directors”
unit = 32;
“programme”
a = 0; (bread bought so far)
? b > 0 -> a + 6; (if eggs are greater than 0, then a = 6)
show registers;
lol at this shit…stumble once again got the better of me….comments are hilarious..especially the one that chris wrote about wifeexpectsshopping
yes, that is quite hilarious, it makes total sense too
What? I don’t get it.
Stumbled from the UK!
Naka:
if eggs = 0 then
buy 1 bread
elsif eggs > 1 then
buy 6 bread
end if
Get it? Got it!
awesome
The language here is English, therefore he should get bread then if there are any eggs, get 6 eggs. This is because in English the subject of the sentence changes from bread to eggs when eggs are mentioned. (Tragically I have a degree in Computer science, I was young and foolish).