Please share your Opinion on a C++ Syllabus

Hi there,

I am trying to bring the C++ track to V3. For starters I want to define a syllabus tree to map the journey ahead. I looked at similar tracks and it inspired me to produce the (work in progress) tree beyond:

I already covers a lot of ground, so I do want to reduce it to a minimum viable product by prioritizing the double bordered concepts first (e.g. Basics and Functions). These should get a new learner to a level, where they might be able to solve a great variety of exercises.

  • What do you think?
  • Would you put more focus on other elements?
  • Do you feel that the order is sensible?

Even if you don’t know a lot about C++ your comments are very welcome, as my perspective might be very skewed by taking much of the language for granted.

Edit(s):

  • Split Functions, thanks to @BethanyG for the suggestion
  • Enums are added
  • Strings should be covered
2 Likes

This looks great. Maybe strings should be included too as a long of Exercism exercises touch on strings. But as a starting point this looks fantastic and all of those concepts should be well covered in other languages so lots of copy/paste/edit can occur :slight_smile:

Check out this page for lots of info on that bit! :slight_smile:

Are C++ and C similar enough for sizeable portions of their syllabuses to be shared? If so, this might inform the design for both.

This looks awesome! Really excited for a learning mode for C++. :smile:

One observation: everything at the beginning flows to functions , but in order to complete any of the exercises, my assumption would be that students would need to know about functions from the get-go. Would the formal functions concept then go into depth/more detail about the uses and abuses of functions? Or would that be the spot that students take on creating their functions from scratch, rather than having boilerplate?

Asking this because Python has an analogous structure - we introduce function definition in basics (we have to), but have another functions concept further down our proposed “tree” that covers additional scoping rules and nesting, in prep for higher order functions and other FP “tools” and modules. But I struggle with that a bit - especially since the Python basics exercise is rather bulky.

Nice!

A learning mode for c++ is really welcome from my side and could make me pick up on the language.

I don’t see unions on that tree, is that something you planned for later, or is it in some concept that is already on the tree?

Yes, I thought a lot about including strings. I left them out because I always consult other languages for string manipulation. When you come from Python, C++ strings feel rather “clumsy”. It is not as painful as C-style strings, but still not really a fun thing to start a language journey.

On the other hand, there are quite a bit of string exercises on Exercism and a few are already available on the C++ track. I should definitely add them to make the start more rounded.

Yes, they do share a lot of common ground. I am not up to date with modern C, but I think it has a special relationship. I had to read a lot of HPC code and it was a breeze compared to Fortran which was a bit harder to guess around. Of all the mainstream languages C and C++ have probably the biggest intersection of usable material. I should reach out to the C maintainers.

Yes, you are right, I think there have to be some concepts that need to be split up. The basics of classes for example are easy to teach. But inheritance, access modifiers and abstractions can be confusing.

With boilerplate you don’t have to teach all about functions from the beginning. I think it is nice to play with arithmetic and loops a bit before you have to think about pass-by-value. You might be on to something with the time of introduction though. I should move it up a bit.

An ideal world would have the track ready to go in the appropriate month. Is it in mechanical march? That wouldn’t be reasonable :smiley: Maybe for Jurassic July?

To be honest, I never use unions in my day to day C++ job. I have them filed as “if you really need locality, you could look into that”. They should be known, so they are not confusing, when you read other people’s code.

I also should add (class) Enums.

By the way: it’s an easy trap to fall into (in my experience at least), but a syllabus need not teach a language completely from scratch. As it stands, Exercism’s target audience is people with already some experience with at least one programming language. You can and I think should make use of this. The alternative is writing another 1000+ page book.

Most popular languages are descendants of C, or at least distantly related. Plenty of opportunity for analogies and comparisons. No need to reinvent the C spec.

Will you have a section that introduces Make?

That is such a difficult topic, isn’t it? I think the introduction of the new exercism programming language will help a lot with complete beginners. I am still stunned by how many people stumble upon the hello world exercise. So I am a bit torn on that. I have seen a good “Clojure on five slides” presentation and was also super annoyed with a click-by-click SolidWorks course. It’s like the tabloid press. It seems super basic at first glance, but it is actually very difficult to write short and simple paragraphs that are still able to capture complex topics.

That would be useful, right? I don’t know how that would be implemented, but it should be on the “nice to have” list.

Make could (should?) be discussed in the track docs.

I’m not hopeful. But then again 1) I haven’t seen any of it, and 2) I’m a gloomy person anyway. I’m very interested though, and would gladly help think stuff over.

I started by extracting concepts from the existing exercises. Is anyone here interested in reading and checking my pull requests for this? I think mentors would be best suited for that task, so I will go through the exercises and ask them in my sessions for input.

The first one would be [v3] Extract Concepts from v2 exercise: collatz-conjecture by vaeng · Pull Request #564 · exercism/cpp · GitHub to get started. Maybe @BethanyG or @MatthijsBlom as this one is not overly C+±specific, but shares a lot of concepts with other languages?

Looks good!

Only thing that jumps out to me is that there probably is some sort of relationship between references and pointers. I also assume that exceptions are what you mean by errors?

High level observation is that you likely need to be very opinionated about the style of C++ you want to teach. I think user-mode portable ISO C++ in the latest version written to C++ Core Guidelines is probably the right move.

I personally like Josh Lospinoso’s “C++ Crash Course” from No Starch Press. It’s probably a bit polarizing because it skips traditional inheritance, but I personally think that with C++ you need to be willing to subset a bit to make it approachable. The fact that we have a C track makes me think that our C++ track can be much more future-focused.

FWIW, this year might even be the inflection point where the track can drop headers and preprocessor stuff entirely in favor of modules.

1 Like

You seem to have an opinion as well. You are very welcome to join the efforts. :slight_smile:

And you are indeed correct. There are dozens of courses that teach you C-like C++, and have C++11 as a chapter in the appendix. If I were to decide I would push a lot of the old stuff into footnotes and start right with:
int some_value{6} instead of all the ways you might be able to do something similar. This is one of the reasons I would put learning about pointers after references. In my experience, that seems to establish the basic ideas first but has frustrating debugging sessions a lot later.

This is a topic that needs to be discussed. I would love to have the latest C++ standards here at Exercism. One of the arguments against this is the availability of the respective compilers on older machines.

1 Like

Alas, I’m a kernel developer that is one of those folks using Super C! C++ 14, no exceptions, in-house templates and smart pointers, weird Windows NT macros, etc. I don’t really think I have enough Modern C++ experience to be helpful at this level. I might be open to more tactical maintenance work on the track though.

I do think you may like the Rust-like approach in C++ Crash Course. It probably aligns closely with your vision (and it does also mention in the Introduction that it hopes the second edition could be module-centric). Perhaps Josh Lospinoso might have some materials he’d be willing to share. I’m happy to try to make an introduction if you want.

It feels like many of the professional developers belong to some sort of specialized subset. The control system framework I am mostly working on my day-to-day is properly very, very different from other C++ developers. I know I will not be able to give an all-encompassing overview of the language, but I hope with the community we will be able to show many crevices of modern C++.

That would be a great addition. I would really appreciate it.

I haven’t heard back from Josh, so I wouldn’t count on assistance from.

This is awesome! I think it’s a good thing that languages like C++ also get a learning mode and a syllabus. The syllabus looks great, but I suggest putting in a topic about I/O as this is used a lot by beginners just picking up the language.

Other than that, great job!

I am not sure if there are already any exercises of that kind on Exercism, but if they are there, we can surely put them in.

1 Like