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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 109fba,cd8ed9115942852f X-Google-NewGroupId: yes X-Google-Thread: 103376,b92b95c9b5585075 X-Google-NewGroupId: yes X-Google-Attributes: gid4f1905883f,gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Ian Collins Newsgroups: comp.lang.c++,comp.lang.ada Subject: Re: Why use C++? Date: Sat, 13 Aug 2011 21:29:05 +1200 Message-ID: <9amuf2FdetU3@mid.individual.net> References: <1e292299-2cbe-4443-86f3-b19b8af50fff@c29g2000yqd.googlegroups.com> <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> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net mmkIXkF7Gudn5VKsmJpQMg9wC1BmVuNlWiiEhqQpf5A5H2zrfG Cancel-Lock: sha1:/NLQbktJ41pqD6bbaUZMTnbiGcQ= User-Agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.9.2.9) Gecko/20101021 Lightning/1.0b2 Thunderbird/3.1.4 In-Reply-To: Xref: g2news2.google.com comp.lang.c++:92675 comp.lang.ada:21566 Date: 2011-08-13T21:29:05+12:00 List-Id: On 08/13/11 09:15 PM, Dmitry A. Kazakov wrote: > On Sat, 13 Aug 2011 02:53:32 -0500, Jed wrote: >> "Dmitry A. Kazakov" wrote: > >>> BTW, if you aim at this application domain, note endianness and encoding >>> stuff. You have very little chance that int is the type the protocol or >>> hardware uses. >> >> Picking on int? > > int, long, unsinged represent an example of wrong language design. The > point was that the semantics of an [integer] must be derived from the > application domain. They are an example of a specific language design decision, not a wrong one. It's pretty rare for the application domain to be concerned about the semantics of an integer beyond those specified by the language. In those rare cases where it does, the language provides a means of doing so though user defined types. >>> In each such case I will have to use a type different from the machine >>> type. This is just another argument why types need to be precisely >>> specified. I addressed this issue above. >> >> But they are precisely specified on any given platform. > > 1. They are not. In order to see the specification of int, you have to read > the compiler documentation. My point was that the program code does not > specify the properties of int. The answer that it is defined somewhere > somehow is not an argument at all, anything works in this or that way. If you want to get the best performance out of a given platform (which many C and C++ programs do), you have to program to the characteristics of the platform. > 2. I don't care about the platform, I care about what the program is > supposed to do. The type's properties shall be defined by the application > domain. Can you give an example of where that would be an issues not solved by user defined types? -- Ian Collins