• Re: Other programming languages (Was: Command line globber/tokenizer li

    From Kenny McCormack@21:1/5 to [email protected] on Thu Sep 12 14:07:46 2024
    In article <vbus74$9k96$[email protected]>,
    Bonita Montero <[email protected]> wrote:
    Am 12.09.2024 um 15:20 schrieb Kenny McCormack:

    It has always been CLC policy that C++ is just as off-topic as Fortran or
    C# or any other language (other than C, of course). And, of course, that
    being "off topic" is the highest and most unforgivable sin.

    A switch to C++ is much more likely than to Fortran.

    Doesn't matter. I'm talking policy, not personal feelings.

    --
    "Only a genius could lose a billion dollars running a casino."
    "You know what they say: the house always loses."
    "When life gives you lemons, don't pay taxes."
    "Grab 'em by the p***y!"

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Bonita Montero on Thu Sep 12 17:40:17 2024
    On 12.09.2024 16:14, Bonita Montero wrote:

    C and C++ are programmed with the same mindset.

    Careful! This is depending on the background and experiences of the
    respective programmer(s). If you come, say, from Simula you'd most
    likely have another (OOP) perspective than if you'd come from "C".

    Programming C++ with only a "C" mindset I'd not consider advisable.
    That's what I've generally observed; with sole knowledge of X there
    seems to be an impetus and preference to infer those techniques to
    programming in Y. A lot of early C++ programs I've seen were just,
    umm, "enhanced" "C" programs.

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Bonita Montero on Thu Sep 12 17:59:01 2024
    On 12.09.2024 17:48, Bonita Montero wrote:
    Am 12.09.2024 um 17:40 schrieb Janis Papanagnou:

    Programming C++ with only a "C" mindset I'd not consider advisable.
    That's what I've generally observed; with sole knowledge of X there
    seems to be an impetus and preference to infer those techniques to
    programming in Y. A lot of early C++ programs I've seen were just,
    umm, "enhanced" "C" programs.

    I'm using most new language facilities, but the mindset is still the same.

    You already said that in your previous posting. See my reply in my
    response to that post.

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Janis Papanagnou on Thu Sep 12 22:32:10 2024
    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James Kuyper@21:1/5 to Lawrence D'Oliveiro on Thu Sep 12 18:50:11 2024
    On 9/12/24 18: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.

    Like many other aspects of C++, that was dictated by a necessity of
    remaining a certain minimum level of backwards compatibility with
    existing C code. You shouldn't draw any larger conclusions from that choice.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Lawrence D'Oliveiro on Fri Sep 13 04:06:58 2024
    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.)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to James Kuyper on Fri Sep 13 01:37:08 2024
    On Thu, 12 Sep 2024 18:50:11 -0400, James Kuyper wrote:

    On 9/12/24 18: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.

    Like many other aspects of C++, that was dictated by a necessity of
    remaining a certain minimum level of backwards compatibility with
    existing C code.

    No it wasn’t. OO was an entirely new feature, with no counterpart in C, so there was nothing to maintain “backwards compatibility” with.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Janis Papanagnou on Fri Sep 13 02:58:07 2024
    On Fri, 13 Sep 2024 04:06:58 +0200, Janis Papanagnou wrote:

    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.

    Precisely. And consider what the meaning of a non-virtual destructor is:
    it is essentially always the wrong thing to do.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Lawrence D'Oliveiro on Fri Sep 13 03:38:59 2024
    On 2024-09-12, Lawrence D'Oliveiro <[email protected]d> 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.

    That is half right, goofy. C++ is certainly designed to be used without
    virtual functions. But it's also designed to be with virtual functions,
    too. Both ways are by design!

    Moreover, a VIRTUAL keyword was already present in Simula-67, which
    inspired C++. Virtual functions were not added as an afterthought into a language that was originally designed otherwise. But even if they were,
    such an addition is a design change. If you design a thing to be used
    one way, without envisioning another way, and then some time later hit
    upon the idea for that other way and add it to the design, then both
    ways are now designed in, and intended to be used.

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @[email protected]

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kaz Kylheku@21:1/5 to Janis Papanagnou on Fri Sep 13 04:18:36 2024
    On 2024-09-13, Janis Papanagnou <[email protected]> wrote:
    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).

    Thd development of C++ follows, or at least used to, a "don't pay for
    what you don't use" principle: programs not using certain mechanisms
    that have an implementation cost should not ideally bear the cost of implementing them.

    When a class doesn't use virtual functions, that class doesn't need the "vtable" implementation mechanism. And even if functions are called
    through pointers or references to the object, the dispatch is static.
    That would not be the case with virtuals, because a class must be
    suspected of being a base class.

    This "don't pay for what you don't use" principle doesn't mean that
    the language is designed to be used with a preference toward
    the cheap choices. It's just pragmatics. Programs do not all use all
    available features, so why turn them on? A program which needs no
    special features that have an implementation cost would then have to
    verbiage to opt-out of all of them. Moreover, old programs would have to
    be maintained to add more verbiage to opt out of newer hidden expenses
    that have been made default.

    We can imagine the "ls" program was designed such that a large number
    of options were enabled at the same time, such that users
    have to turn off what they don't need. It does not follow that just
    because things are not that way (options sanely optional)
    that doesn't imply that ls is designed to be used with no options.

    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @[email protected]

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael S@21:1/5 to Lawrence D'Oliveiro on Fri Sep 13 11:30:29 2024
    On Fri, 13 Sep 2024 01:37:08 -0000 (UTC)
    Lawrence D'Oliveiro <[email protected]d> wrote:

    On Thu, 12 Sep 2024 18:50:11 -0400, James Kuyper wrote:

    On 9/12/24 18: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.

    Like many other aspects of C++, that was dictated by a necessity of remaining a certain minimum level of backwards compatibility with
    existing C code.

    No it wasn’t. OO was an entirely new feature, with no counterpart in
    C, so there was nothing to maintain “backwards compatibility” with.

    Agreed.
    Method syntax was entirely new with no backward compatibility
    restrictions.
    BTW, in these sort of discussion I'd rather avoid in-concrete words,
    like "OO".

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Lawrence D'Oliveiro on Fri Sep 13 14:31:06 2024
    On 13.09.2024 04:58, Lawrence D'Oliveiro wrote:
    On Fri, 13 Sep 2024 04:06:58 +0200, Janis Papanagnou wrote:

    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.

    Precisely. And consider what the meaning of a non-virtual destructor is:
    it is essentially always the wrong thing to do.

    I've used both design patterns depending on what I intended,
    so I cannot say that one would be "wrong" in any way.

    (Upthread I seem to have rightly sensed that this might lead
    to a "right/wrong" ("real" OO) sort of discussion. I abstain.)

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)