Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!us.feeder.erje.net!feeder.erje.net!eu.feeder.erje.net!goblin1!goblin.stu.neva.ru!news.astraweb.com!border5.a.newsrouter.astraweb.com!border2.nntp.ams.giganews.com!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.bt.com!news.bt.com.POSTED!not-for-mail NNTP-Posting-Date: Mon, 28 Jul 2014 07:25:52 -0500 From: "Chris Uppal" Newsgroups: comp.lang.java.programmer References: <53cef75d$0$291$14726298@news.sunsite.dk><7s6vs9p395bretqrtdvh9i6til83vfk52p@4ax.com><53d04b5f$0$291$14726298@news.sunsite.dk><53d19752$0$295$14726298@news.sunsite.dk> <7lcat9t8j6tuo1v2tm1od8rhvhcgf5i7g9@4ax.com> Subject: Re: Java blunders Date: Mon, 28 Jul 2014 13:22:49 +0100 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512 Message-ID: Lines: 27 X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-YsptUatLuIGbE805DaJR4gCfQMBA9g7UEZ8IA2xR96HJQS7/SaG1b71O04npJg5BQVQWQJVrfwkQTAg!IAVq/StH2pMVHdx705S5TBLrHUINyOD5twJZ/TunIYFaWT7qxQ1Nr6Ai9mh/Q6OZAe8fSkDm/A== X-Complaints-To: abuse@btinternet.com X-DMCA-Complaints-To: abuse@btinternet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2374 Xref: csiph.com comp.lang.java.programmer:29389 Martin Gregorie wrote: > > Same applies to operator overloading: given a CurrentAccount object ca > and a Payment object p there 's little or no difference in clarity > between writing > > ca.acceptPayment(p); > > and > ca += p; The latter pattern is used a lot in C# / .Net framework. For instance you use += to add listeners for events. It keeps the code short, but does nothing for clarity IMO. Your example of adding a depost to an account using += may make more sense, but even there I think it's more "cute" than "clear". OTOH, if Java had (say) "->" and "<-" as generic (not Generic) operators for "putting stuff into places" and "getting stuff from places" (pace the discusion elsethread about notation for IO), then I'd be all for: ca <- p; -- chris