Giter Club home page Giter Club logo

Comments (6)

jtepe avatar jtepe commented on May 26, 2024 2

@wolf99 Non-hosted environments are a valid point. However, I look at it from the other side. Learning C as it is now should be the goal. Later you can easily restrict the features you use and adapt to a more limited environment. IMO, learning the language should not be restricted because of that.

@siebenschlaefer No, the exercises (haven't solved all yet) are also solvable with older versions. But I found using newer features often made it easier.

from c.

jtepe avatar jtepe commented on May 26, 2024 2

I thougth that most of the "quality of life" improvements I use came from C11 onwards, but looking it up it appears most of them have been introduced by C99 already.

For example, compound literals:

int *p = (int [2]){1, 2};

Or array initialization with designators:

int a[] = { [2] = 3 };

For C11 I can only point to anonymous struct members:

struct foo {
    int i;
    struct {
        int a;
        int b;
    };
};
...
struct foo f = { .i = 10, .a = 200, .b = 300, };
...

Other than that, I regularly use bounds-checking versions of functions (e.g. strcpy_s instead of strcpy) were appropriate.

IMO multithreading is a major addition from C11 that is worth learning. But that can be an extension to the already existing exercises. Would a PR that adds such types of exercises be welcome?

I think we can close this issue ;)

from c.

siebenschlaefer avatar siebenschlaefer commented on May 26, 2024 1

But I found using newer features often made it easier.

That's what I wanted to know. Do you have an example for that?

from c.

wolf99 avatar wolf99 commented on May 26, 2024

Hi!
Thanks for the good question and for finding and referencing the past question!

GCC and Clang do indeed support recent C standards in hosted environments (e.g. environments with an OS).

However C is still used heavily in non-hosted environments (bare-metal, RTOS, near-hosted, etc). These environments usually only support much older versions of C. Additionally Microsoft's MSVC only supports C to C99 (last I looked, the situation may have changed since; but C is always second citizen to C++ for MS).

Thus having an older standard caters to the lowest common denominator of students that may use the track.

That said, I don't know if this is something we specifically aim for. FWIW I have no specific objection to moving to newer standards.

Off the top of my head however I can't think of any currently existing exercise on the track that would make use any of the features of the newer standards (I'm not super familiar with the new features either!).

Are there any specific features that you had in mind?

from c.

siebenschlaefer avatar siebenschlaefer commented on May 26, 2024

No objections from my side, I'm fine with either.

Just out of curiosity: Would that have any impact on the solutions?
I'm not aware of any exercise where a C11 or C17 solution would look significantly different.

from c.

wolf99 avatar wolf99 commented on May 26, 2024

It would be good to have a submission for an exercise that demonstrates multithreading!

However I don't know if we have a way of requiring a multithreaded implementation to any exercise via the test framework.

If you have ideas for how to do it it would be good to hear it

(Bear in mind that exercises on any track are implementations of problem specifications from the problem specs repo)

from c.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.