• Re: C++20+

    From feoh@VERT/SDF1 to All on Friday, February 06, 2026 18:04:00
    auto seems SUPER compelling and looks like it might take some of the drudgework out of using C++, at least for whimps like me who generally reach for gc languages like Python first.

    I knew C++ pretty well in the 90s. Hopefully one of these days I can dust off those neurons and enjoy some of the newer features that have come along since I last checked.

    --- Mystic BBS v1.12 A48 (Linux/64)
    * Origin: SDF-1 BBS: bbs.sdf1.net (ssh: 5022, telnet: 5023)
  • From Nightfox@VERT/DIGDIST to feoh on Friday, February 06, 2026 13:30:51
    Re: Re: C++20+
    By: feoh to All on Fri Feb 06 2026 06:04 pm

    auto seems SUPER compelling and looks like it might take some of the drudgework out of using C++, at least for whimps like me who generally reach for gc languages like Python first.

    I knew C++ pretty well in the 90s. Hopefully one of these days I can dust off those neurons and enjoy some of the newer features that have come along since I last checked.

    The 'auto' keyword has been around in C++ since 2011 (added to the C++11 standard).

    I've been using C++ a while (professionally since 2003, and started learning it in college in 1999-2000). I like many of the additions to C++ since the C++11 standard, though I feel like I still shy away from 'auto' sometimes. I see the usefulness of it, but I hesitate to use it liberally in my code. I think one of the strengths of C++ is that it's a strongly-typed language, and before 'auto', that meant you would know the type of all the variables just by reading the code. With 'auto', I think the code is a bit less readable, as you now need to look more closely at what the code is doing in order to determine what type it (probably) has.

    There are also times when you really need a variable to have a specific type - For instance, if you're reading & writing audio data, you need a variable that's specifically a number of bits wide. At some point, you'd need to declare a variable with a specific type. Although higher up in the code, you could still use 'auto' (and I think that could be useful).

    The 'auto' keyword helps in allowing the code to deal with changing return types. I think it's mostly useful if you're using a library function and that function's return type ends up being changed at some point.

    Nightfox

    ---
    þ Synchronet þ Digital Distortion: digitaldistortionbbs.com
  • From Digital Man@VERT to Nightfox on Friday, February 06, 2026 16:30:28
    Re: Re: C++20+
    By: Nightfox to feoh on Fri Feb 06 2026 01:30 pm

    Re: Re: C++20+
    By: feoh to All on Fri Feb 06 2026 06:04 pm

    auto seems SUPER compelling and looks like it might take some of the drudgework out of using C++, at least for whimps like me who generally reach for gc languages like Python first.

    I knew C++ pretty well in the 90s. Hopefully one of these days I can dust off those neurons and enjoy some of the newer features that have come along since I last checked.

    The 'auto' keyword has been around in C++ since 2011 (added to the C++11 standard).

    The 'auto' keyword actually dates back to the pre-standard (i.e. 1978) C Programming language. It was a storage class modifier (the opposite meaning of 'static' when declaring a function-local variable). Since 'auto' was the default storage class, you didn't see it used much at all in C. So it was kind of safe to reuse for a different purporse in C++ and now the newest version of C (2023?) has a similar (but not identical) repurposing of the 'auto' keyword as how its used in C++.
    --
    digital man (rob)

    Synchronet/BBS Terminology Definition #46:
    IMAP = Internet Message Access Protocol
    Norco, CA WX: 66.3øF, 67.0% humidity, 8 mph W wind, 0.00 inches rain/24hrs
    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Nightfox@VERT/DIGDIST to Digital Man on Friday, February 06, 2026 18:18:28
    Re: Re: C++20+
    By: Digital Man to Nightfox on Fri Feb 06 2026 04:30 pm

    The 'auto' keyword has been around in C++ since 2011 (added to the C++11
    standard).

    The 'auto' keyword actually dates back to the pre-standard (i.e. 1978) C Programming language. It was a storage class modifier (the opposite meaning of 'static' when declaring a function-local variable). Since 'auto' was the default storage class, you didn't see it used much at all in C. So it was kind of safe to reuse for a different purporse in C++ and now the newest version of C (2023?) has a similar (but not identical) repurposing of the 'auto' keyword as how its used in C++.

    Ah.. Interesting to know. Though I was thinking of "auto" just in its current use in C++. :)

    Nightfox

    ---
    þ Synchronet þ Digital Distortion: digitaldistortionbbs.com