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=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a02:22c6:: with SMTP id o189mr23351815jao.35.1559930113236; Fri, 07 Jun 2019 10:55:13 -0700 (PDT) X-Received: by 2002:aca:5a05:: with SMTP id o5mr4236843oib.37.1559930112940; Fri, 07 Jun 2019 10:55:12 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!fdn.fr!proxad.net!feeder1-2.proxad.net!209.85.166.216.MISMATCH!g15no253624itd.0!news-out.google.com!l126ni286itl.0!nntp.google.com!g15no253623itd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 7 Jun 2019 10:55:12 -0700 (PDT) In-Reply-To: <60027108-2b92-417e-8083-eef19cc1e64a@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=208.114.128.53; posting-account=MRPdDAoAAADUJmZVjnYaoafXFMadSeY1 NNTP-Posting-Host: 208.114.128.53 References: <60027108-2b92-417e-8083-eef19cc1e64a@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: C++ diaries... From: Olivier Henley Injection-Date: Fri, 07 Jun 2019 17:55:13 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:56542 Date: 2019-06-07T10:55:12-07:00 List-Id: > You would be much more productive if you used non-clashing constant names= . There is nothing clashing here: Whatever::SocketType::Raw=20 Whatever::ProtocolType::Raw Do the word 'Socket' and 'Protocol' looks like the same to you? Ada gets it right and C++ is not 'looking straight' trying to sell me its a= n 'overloading' issue. 'Paths' or the 'chain' of 'named' 'spaces' are unequ= ivocally different; easy breezy. > You would be much more productive if you used non-clashing constant names= . I will not create something like Socket_Raw and Protocol_Raw to satisfy the= original non sense ... oh damn I forgot its standard practice to do so in = C++. I think I will take the time to change all enums to comply to that con= vention for the whole project. Good idea. > And you might be more likely to stay in line with those coding standards = that actually forbid enumeration overloading. The original stuff is company wide and is not my creation in the first plac= e. > Which brings another question: what is the problem, actually? The fact th= at old enums don't support overloading, the fact that transitioning to new = language features requires changes in old code or the fact that there are t= wo kinds of enums in the first place?=20 I already said so, all of the above. The thing, 'straight enums', should ha= ve worked properly day one. The concept of enum in C++ is arguably deceitfu= l, wrong, broken, you name it.=20 By the way, lets talk about C++ enums a tidy bit further. Can you get a str= ing representation of your enums in C++ ... today 2019?=20 This is a great Q&A: =20 https://stackoverflow.com/questions/28828957/enum-to-string-in-modern-c11-c= 14-c17-and-future-c20 (Anyone, take the time to read it, its stand up comed= y. Maybe there is an unknown disease that render people judgement-less...)= =20 >I agree that this third fact is somewhat cumbersome, but since there is no= obligation to use the new one, it should not be a show stopper. You know MenuetOS? They wrote a full fledge OS, graphics included, in ... F= ASM. So yeah, nothing is a show stopper... it's not a reason to deny a dubi= ous endeavor when you cross one. Olivier