From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 476 invoked by alias); 2 Dec 2004 15:36:55 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 406 invoked from network); 2 Dec 2004 15:36:48 -0000 Received: from unknown (HELO psmtp.com) (64.18.1.214) by sourceware.org with SMTP; 2 Dec 2004 15:36:48 -0000 Received: from source ([193.95.148.142]) by exprod6ob4.obsmtp.com ([64.18.5.12]) with SMTP; Thu, 02 Dec 2004 07:35:10 PST Received: from inner-relay-3.corp.adobe.com (inner-relay-3.sea.adobe.com [153.32.251.51]) by outbound-smtp-2.corp.adobe.com (8.12.10/8.12.10) with ESMTP id iB2FgXTG001500; Thu, 2 Dec 2004 07:42:34 -0800 (PST) Received: from iplan-mn (iplan-mn.corp.adobe.com [130.248.25.5]) by inner-relay-3.corp.adobe.com (8.12.9/8.12.9) with ESMTP id iB2FaW0v004231; Thu, 2 Dec 2004 07:36:32 -0800 (PST) Received: from mn-eljay-a51m.adobe.com ([130.248.178.133]) by iplan-mn.corp.adobe.com (iPlanet Messaging Server 5.2 HotFix 1.21 (built Sep 8 2003)) with ESMTP id <0I83008I9Q0U07@iplan-mn.corp.adobe.com>; Thu, 02 Dec 2004 09:36:31 -0600 (CST) Date: Thu, 02 Dec 2004 15:36:00 -0000 From: Eljay Love-Jensen Subject: Re: Question In-reply-to: <1102000290.3682.39.camel@klftdh0f.tn.tudelft.nl> To: Roberto Ausas , gcc-help@gcc.gnu.org Message-id: <6.2.0.14.2.20041202092736.021ad610@iplan-mn.corp.adobe.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii; format=flowed Content-transfer-encoding: 7BIT References: <1102000290.3682.39.camel@klftdh0f.tn.tudelft.nl> X-SW-Source: 2004-12/txt/msg00022.txt.bz2 Hi Roberto, C++ is not inherently slower (nor faster) than C. Keep in mind: bad programs (e.g., slow programs) can be written in any language. What C++ does is provide language constructs for certain paradigms of programming that C doesn't support in the language itself. Although those programming paradigms CAN be done in C, it's just that the language does not provide any assistance with those programming paradigms as part of the language specification. (Paradigms such as generic programming, object oriented programming, and functional programming.) Many scientific programs are written procedurally, and C is really good as a procedural programming implementation language. (So is C++, since C++ is mostly a superset of C.) For scientific programming, the primary language of choice is FORTRAN. (My information may be out of date, but that was the case the last time I checked.) Other "first choice" languages for scientific programming: Mathematica, C, C++, and Ada. My own opinion on scientific programming is to go with Mathematica. Dr. Wolfram's "A New Kind of Science" may not pass the sniff test, but his Mathematica is a beautiful tool/language for scientific and pure mathematics purposes. My next preference is C++ (over C), since I think that object oriented programming and (slightly) stronger typing of C++ can help create correct/complete programs more easily in the scientific arena. If you opt to investigate C++, I recommend adding in the BOOST (www.boost.org) libraries. HTH, --Eljay At 09:11 AM 12/2/2004, Roberto Ausas wrote: >Hi, > >My name is Roberto.I am developing a computational code for scientific >calculations and I am using C and gcc to compile my programs. For >different reasons, I have to decide whether to pass to C++ or not, so I >would like to know if C++ programs (e.g. compiled with g++) are slower >than C programs? > >Thank you in advance > >I look forward to hearing from you soon > >Regards > >Roberto