From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31307 invoked by alias); 22 Feb 2008 16:20:19 -0000 Received: (qmail 31288 invoked by uid 22791); 22 Feb 2008 16:20:18 -0000 X-Spam-Check-By: sourceware.org Received: from mail.artimi.com (HELO mail.artimi.com) (194.72.81.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 22 Feb 2008 16:19:52 +0000 Received: from mail.artimi.com ([192.168.1.3] RDNS failed) by mail.artimi.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 22 Feb 2008 16:19:47 +0000 Received: from rainbow ([192.168.8.46] RDNS failed) by mail.artimi.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 22 Feb 2008 16:19:47 +0000 From: "Dave Korn" To: "'The Cygwin-Talk Maiming List that turns into a Lobster when you try and dress it'" References: <00b001c873fd$58137750$2e08a8c0@CAM.ARTIMI.COM> <47BD1AF4.6010602@sh.cvut.cz> <20080221102754.GA18802@calimero.vinschen.de> <47BD6E01.3020303@etr-usa.com> <20080221134914.GA20633@calimero.vinschen.de> <47BE89ED.6090306@alcatel-lucent.it> Subject: RE: Why I love C++ so much. Date: Fri, 22 Feb 2008 16:20:00 -0000 Message-ID: <004b01c8756e$be00e080$2e08a8c0@CAM.ARTIMI.COM> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Mailing-List: contact cygwin-talk-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cygwin-talk-owner@cygwin.com Reply-To: The Vulgar and Unprofessional Cygwin-Talk List X-SW-Source: 2008-q1/txt/msg00086.txt.bz2 On 22 February 2008 16:14, Igor Peshansky wrote: > On Fri, 22 Feb 2008, Danilo Turina wrote: > >> Corinna Vinschen wrote: >>> On Feb 21 05:26, Warren Young wrote: >>>> Corinna Vinschen wrote: >>>>> Really? Show me an example which isn't much harder to understand than >>>>> the equivalent C code. >>>> template >>>> std::string foo(const T& x) >>>> { >>>> std::ostringstream outs; >>>> outs << x << and << maybe << other << stuff; >>>> return outs.str(); >>>> } >>>> >>>> (Aside: This looks pointlessly trivial, but it's a simplified version of >>>> real code in MySQL++ (http://tangentsoft.net/mysql++/). It would just >>>> muddy the waters to talk about the reason MySQL++ does this.) >>>> >>>> To do that with C functions (maybe strto*() instead of printf()) you'd >>>> have to create a set of template specializations for every T you know >>>> about to call the right C function with the right arguments. Any time >>>> you add to the list of supported T's, you have to add template >>>> specializations. >>> >>> Argh. Using templates as an example for simplicity is somewhat daring. >>> Templates, liberally used, are a good way to make code unreadable. >>> >>> IMHO. >>> >>> FWIW. >>> >>> YMMV. >>> >>> YMCA. > > "Young men, no need to feel down"... That brings back memories. :-) Didn't bring back the memory of the word "there's", I note! >> C++ is like Unix, people that don't like it is because they don't >> understand it. > > C++ is for people who want to be able to not just shoot themselves in the > foot, but do it with a rocket launcher. Unix allows one to throw a > grenade under their own feet. So yes, they are very similar. But it wasn't a rocket-launcher when I picked it up, it was a bar of soap, it only overloaded itself into a rocket launcher when I tried to wash my feet with it instead of my hands! cheers, DaveK -- Can't think of a witty .sigline today....