From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,b92b95c9b5585075 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder.news-service.com!feeder.news-service.com!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.c++,comp.lang.ada Subject: Re: Why use C++? Date: Tue, 16 Aug 2011 12:58:07 +0200 Organization: cbb software GmbH Message-ID: <17sfxzivd6ba0.1lpjrmelcfuoa$.dlg@40tude.net> References: <1fd0cc9b-859d-428e-b68a-11e34de84225@gz10g2000vbb.googlegroups.com> <9ag33sFmuaU1@mid.individual.net> <1d8wyhvpcmpkd.ggiui9vebmtl.dlg@40tude.net> <150vz10ihvb5a.1lysmewa1muz4$.dlg@40tude.net> <1q4c610mmuxn7$.1k6s78wa0r8fj.dlg@40tude.net> <1vn800hbyx8k4$.1lsveclj56197$.dlg@40tude.net> <1gu6ni1yb54k3$.4nbvfqqndl8m$.dlg@40tude.net> <4e4a4534$0$7629$9b4e6d93@newsspool1.arcor-online.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: dsaj9gsnv4Trut6ZJ84waw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: g2news2.google.com comp.lang.c++:92807 comp.lang.ada:21618 Date: 2011-08-16T12:58:07+02:00 List-Id: On Tue, 16 Aug 2011 12:23:48 +0200, Georg Bauhaus wrote: > Is changing only the representation of types, not the types, > necessarily premature optimization? The answer depends on the time the change is made. "Premature" in its original meaning (Knuth) means: during design, before functional requirements are met. > Compilers, or their writers, try to achieve good representations. > Why shouldn't programmers at least try the same when the program > has matured and can be polished without hurting any of the system > functions? Because this requires heavy machinery: static analysis/coverage tests to prove consistency and profiling of the most frequent use cases in order to show performance gains, while the actual gain is usually marginal when integral types are involved. It is beyond the capabilities of an average programmer to estimate the effect of a representation change for a modern machine with its caches, pipelines etc. > In this sense, I think any kind of representation specification is > somewhat like a pragma that says optimize space or optimize time. > Anything wrong with pragmatic hints? Compiler hints (switches) should not appear in the program code. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de