Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Janis Papanagnou Newsgroups: comp.lang.c Subject: Re: Other programming languages (Was: Command line globber/tokenizer library for C?) Date: Fri, 13 Sep 2024 04:06:58 +0200 Organization: A noiseless patient Spider Lines: 30 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Date: Fri, 13 Sep 2024 04:07:00 +0200 (CEST) Injection-Info: dont-email.me; posting-host="3ea0b24cb964025b15904d5f352be98d"; logging-data="696541"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+/LwVpg7dRcXFItqWC27RK" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 Cancel-Lock: sha1:1LQMHUGQ7QsanxUJpAKmWOvLkpk= In-Reply-To: X-Enigmail-Draft-Status: N1110 Bytes: 2773 On 13.09.2024 00:32, Lawrence D'Oliveiro wrote: > On Thu, 12 Sep 2024 17:40:17 +0200, Janis Papanagnou wrote: > >> A lot of early C++ programs I've seen were just, umm, "enhanced" "C" >> programs. > > Given that C++ makes “virtual” optional instead of standard behaviour, I’d > say that C++ is in fact designed to be used that way. There's different semantics with and without a 'virtual' specification. Even if you want polymorphism (and have to use 'virtual') there's no need to define it as _default_ (and "disable" it where unnecessary). A language designer is free to have it explicitly specified for that. Given that C++ has its paragon in Simula it's not surprising that it has been defined in a similar way; to explicitly declare it virtual. (Other OO languages may have that differently designed. But I won't engage in any "real" OO languages have 'virtual' defined as default sort of discussions. - It is fine for me as it is in Simula or C++. If you want to program in OO paradigm just specify 'virtual'.[*]) Janis [*] Note: The Simula compiler I use nowadays is Cim. And Cim has a serious bug where specifying 'virtual' does not work as specified; it's actually ineffective. I discovered an alternative non-standard syntax specification that makes polymorphism work in Cim. (Search the Web/Usenet or just ask or mail me if interested in the details.)