Now, that is a programmers mug :) Get link Facebook X Pinterest Email Other Apps - October 04, 2013 Now, that is a programmers mug :)Originally shared by Formule by BNFCoffee hour ;) Get link Facebook X Pinterest Email Other Apps Comments Alexander VolchenkovOctober 4, 2013 at 5:35 AMRedundant 'else' detected ;)procedure DoOnIdle;var Coffee: TCoffee;begin Coffee := TCoffee.Reach; if Coffee.Empty then Coffee.Refill; Coffee.Drink;end;ReplyDeleteRepliesReplyStefan GlienkeOctober 4, 2013 at 5:41 AMAlexander Volchenkov Memleak or Singleton detected :pReplyDeleteRepliesReplyAlexander VolchenkovOctober 4, 2013 at 5:43 AMLet's assume TCoffee is a record ;)ReplyDeleteRepliesReplyBill MeyerOctober 4, 2013 at 5:44 AMDefect: It appears to be empty!ReplyDeleteRepliesReplyFrédéric HannesOctober 4, 2013 at 5:45 AMLars Fosdal That's some weird looking code... All of the stuff in the if-else clause is commented out? =PReplyDeleteRepliesReplyBill MeyerOctober 4, 2013 at 6:24 AMFrédéric Hannes And there's no then ;)ReplyDeleteRepliesReplyDorin DuminicaOctober 4, 2013 at 11:08 AMhey, there's something missing, I don't care how you do it, but do it!do { ....} while (! coffee.hadEnough());don't tell me you guys have only 1 coffee!!ReplyDeleteRepliesReplyAdd commentLoad more... Post a Comment
Redundant 'else' detected ;)
ReplyDeleteprocedure DoOnIdle;
var
Coffee: TCoffee;
begin
Coffee := TCoffee.Reach;
if Coffee.Empty then
Coffee.Refill;
Coffee.Drink;
end;
Alexander Volchenkov Memleak or Singleton detected :p
ReplyDeleteLet's assume TCoffee is a record ;)
ReplyDeleteDefect: It appears to be empty!
ReplyDeleteLars Fosdal That's some weird looking code... All of the stuff in the if-else clause is commented out? =P
ReplyDeleteFrédéric Hannes And there's no then ;)
ReplyDeletehey, there's something missing, I don't care how you do it, but do it!
ReplyDeletedo {
....
} while (! coffee.hadEnough());
don't tell me you guys have only 1 coffee!!