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 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!news1.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Fri, 12 Aug 2011 10:32:09 +0200 From: Georg Bauhaus User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.18) Gecko/20110613 Thunderbird/3.1.11 MIME-Version: 1.0 Newsgroups: comp.lang.c++,comp.lang.ada Subject: Re: Why use C++? 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> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <4e44e50a$0$7619$9b4e6d93@newsspool1.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 12 Aug 2011 10:32:10 CEST NNTP-Posting-Host: 9905964f.newsspool1.arcor-online.net X-Trace: DXC=[bO0dlb6K6XV;Ef1`Jk54\ic==]BZ:af^4Fo<]lROoRQ<`=YMgDjhgR2A@5h?dhfKUnc\616M64>ZLh>_cHTX3j]QU^ab>]kEaV X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.c++:92603 comp.lang.ada:21528 Date: 2011-08-12T10:32:10+02:00 List-Id: On 12.08.11 07:03, Jed wrote: > "Dmitry A. Kazakov" wrote in message >> Ada does not have predefined modular types in the package Standard, >> because >> any modular type can be constructed using "type T is mod N" construct. > > OK, I plainly see what you meant now even without your example. It's > amazing what a good night's sleep will do. Last night, I was keying-in on > the word "algebra" too much and it blinded me to the overall meaning. > > I'm not sure I'd want that level of flexibility in a language. I think it > may be too much effort for too little benefit. It seems it may be doing > something in software that could be supported in hardware but isn't (?). > Maybe too much of a "purist" approach. I'd need more info about it and be > convinced it is worth it before I'd put that on my shortlist of > compelling features for a language to have. Perhaps it is info if beginners in embedded systems programming consistently produce much better results (statistics collected and testedover some 6 years) when they have an expressive and likely more intuitive type system for fundamental types. My guess is that the absence of representation riddles is a boon. Put yourself in the position of a beginner who is woken up at 5p.m. They would not recall the rules regarding enum vs int, or the collection of traditional idioms for declaring arrays in C, autotruncation of numeric values to fit in the space of LHS; and likely neither the more modern classes addressing hardware things. Then, will understanding the type declarations type Intensity is range 0 .. 255; for Intensity'Size use 8; type RGB is (Red, Green, Blue); type Pixel is array (RGB) of Intensity; require much besides what is written? Compare #define RGB_LIMIT 3 typedef unsigned char Intensity; enum RGB {Red, Green, Blue}; typedef Intensity Pixel[RGB_LIMIT]; and switch (1) { case 0: break; case CHAR_BIT == 8: break; } somewhere. If I am a beginner, what is the number of technicalities I must know it order to understand the second way of declaring things? (I'll leave out that the declare-like-used rule in typedef is confusing many. Maybe that's because the typdef-ed name isn't in some fixed position in the typedef.)