• Re: What is wrong with C? (and fond memories of VAX)

    From Carlos E.R.@3:633/10 to All on Monday, January 12, 2026 15:44:56
    On 2026-01-07 23:49, rbowman wrote:
    On Wed, 7 Jan 2026 13:30:14 +0100, Carlos E.R. wrote:

    On 2026-01-06 19:57, Charlie Gibbs wrote:
    On 2026-01-06, Lars Poulsen <lars@beagle-ears.com> wrote:

    On 2026-01-06, Carlos E.R. <robin_listas@es.invalid> wrote:

    My C teacher said it was a mistake to use C as an all purpose
    language, like for userland applications. Using C is the cause of
    many bugs that a proper language would catch.

    That was around 1991.

    He knew. He participated in some study tasked by the Canadian
    government to study C compilers, but he could not talk about what
    they wrote.

    What language(s) did he suggest instead?

    I don't remember if he did. Maybe he told samples, but I think he mostly
    told us of quirks of the language, things that were errors, but that the
    compiler did not signal, so that we being aware we would write correct C
    code.

    It is possible that current C compilers signal many more problems that
    back then, but not runtime errors.

    gcc has become pickier. That isn't always a welcome thing when working
    with legacy code and requires a search of the compiler options to get it
    to shut up about such horrible heresies as assuming a function returns an int.

    If the code were mine, I would correct the code. Even back then, I did
    not take the assumption that a function would return an integer :-D

    I wrote explicit prototypes in the header file. :-)


    If the code is not mine, I would use the compiler options instead.
    Unless I got paid to maintain that code, then I would correct the code.

    --
    Cheers, Carlos.
    ES??, EU??;

    --- PyGate Linux v1.5.2
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Lawrence D?Oliveiro@3:633/10 to All on Monday, January 12, 2026 19:59:30
    On Mon, 12 Jan 2026 15:44:56 +0100, Carlos E.R. wrote:

    If the code were mine, I would correct the code. Even back then, I
    did not take the assumption that a function would return an integer
    :-D

    That?s why they call it ?technical debt?. And yes, like any debt, it
    incurs interest -- compound interest, even ...

    --- PyGate Linux v1.5.2
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Chris Ahlstrom@3:633/10 to All on Tuesday, January 13, 2026 06:13:51
    Carlos E.R. wrote this post by blinking in Morse code:

    On 2026-01-07 23:49, rbowman wrote:

    On 2026-01-06 19:57, Charlie Gibbs wrote:

    <snip>

    It is possible that current C compilers signal many more problems that
    back then, but not runtime errors.

    Gcc will tag things that could cause a run-time error, such as
    parameters that don't match the specifiers in a printf() call.

    gcc has become pickier. That isn't always a welcome thing when working
    with legacy code and requires a search of the compiler options to get it
    to shut up about such horrible heresies as assuming a function returns an
    int.

    I periodically also build projects using clang. Clang and gcc each
    catch some problems that the other does not catch.

    If the code were mine, I would correct the code. Even back then, I did
    not take the assumption that a function would return an integer :-D

    I wrote explicit prototypes in the header file. :-)

    If the code is not mine, I would use the compiler options instead.
    Unless I got paid to maintain that code, then I would correct the code.

    Don't fix what ain't broke, you might break it [1] :-D

    [1] I'm speaking from experience.

    --
    You can observe a lot just by watching. -- Yogi Berra

    --- PyGate Linux v1.5.2
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)