We do hope you have fun and learn things when coding up your solution. If you want to learn more about C++17,Barteks bloghas a ton of useful information about it. A good starting point is his collaborative post onC++17 features. And to get inspired on writing expressive code, thecontents of Fluent C++are waiting for you.
To win the challenge, your code must also be as clear as possible (you can write about what you did to achieve this too if you want).
Coding challenges are a fun way to learn together. You may have participated to a couple of them on Fluent C++ already. But this time Bartek and I are organizing ajoint challengesimultaneously on the two blogs.
Definitely. With compilers catching up recently (Clang 5 came outjust a fortnight ago), and the ink barely dry enough so that you dont smudge it when you touch it, not many people actually have C++17 in production today.
the filename where the output will be written.
Now how do we learn all those new additions to the language? And how do we know to use them to write even more expressive code?
How to Reduce the Code Bloat of a Variadic CRTP
More specifically, this command line tool should accept the following arguments:
The Expressive C++17 Coding Challenge
So the purpose of this challenge is to write a piece of code that contains as many features of C++17 as possible, and that is as clear as possible.
105 STL Algorithms in Less Than an Hour
The task proposed in the challenge is to write a command line tool that takes in a CSV file, overwrites all the data of a given column by a given value, and outputs the results into a new CSV file.
7 More Ways to Get Better at C++ This Summer (2018 Edition)
Variadic CRTP Packs: From Opt-in Skills to Opt-in Skillsets
if the input file does not contain the specified column, the program should write column name doesnt exists in the input file to the console.
the string that will be used as a replacement for that column,
GCC 7.2, note that parallel algorithms arent supported we couldnt find a platform supporting them yet
If you dont want to display your email address on your solution you cansend it to meorto Bartekprivately. The same goes for your entire solution, if youd like.
So we need to learn it, and wed better start now as C++17 adds a lot of new features. Plus, knowing what features are coming in the language show usthe direction the language is steering to. And whatever the version we use now, knowing this is helpful for making our current code follow this direction right away, to fit into the bigger picture of C++ and write better code.
But as Raoul Borges says, C++17, like Winter, is Coming.
The contests ends on the 15th of October at midnight GMT. So the 15th is ok, the 16th is too late. The results will be published on the 23th of October.
To submit a solution, paste your code into thisempty coliru(
Were going to make you CRAM new C++17 features into your code, and make it as expressive as can be! Its time for a new challenge: the
if the input file is empty, the program should write input file missing to the console.
Im thrilled about this challenge because you can find useful resources on C++17 on Barteks blog (he has been very intense on C++17 lately), and Fluent C++ has growing contents about writing expressive C++. This is as much material to put into practice to write expressive C++17!
To be registered in the contest, add your email address at the beginning of your code so that we can get in touch with you. Well be sure to add you to the mailing lists of and Fluent C++ (you can unsubscribe at any time, but youll get notified when the results come out).
Please dont use another library than the standard library.
The Expressive C++17 Coding Challenge
If youd like to write code directly on the page you can use this tech.io playground (this is used for coding, not for submitting see below for how to submit your solution via Coliru):
Actually it had drieda few timesalready. But the drier the ink, the sooner we get to use this new standard in production code.
the name of the column to overwrite in that file,
In both cases, there shouldnt be any output file generated.
Here are smallinputandoutputCSV files that can serve as a test case.
Hello, my name is Jonathan Boccara. Im your host on Fluent C++. I have been a C++ developer for 6 years, working for Murex which is a major software editor in the finance industry. My focus is on. Im happy to take your feedback, dont hesitate to drop a comment on a post,follow meorget in touchdirectly !
Its time to write some code now! Should you have any question of feedback, dont hesitate to get in touch witheither one of us.
Here is how to deal with edge cases:
Share this post! Dont want to miss out ?Follow: Receive regular updates to make your code more expressive.
To win the challenge, your code must have as many features of C++17 as possible, as long as they are useful to solve the above case. Please write all those youve used in a comment section at the top of your .cpp file.
Weve been thinking about that lately with Bartek , and we came up with something.
And if the program succeeds but there is already a file having the name specified for output, the program should overwrite this file.
For instance, if the CSV file had a column City with various values for the entries in the file, calling the tool with the name of the input file,City,Londonand the name of output file would result in a copy of the initial file, but with all cities set equal to London:
The World Map of C++ STL Algorithms
Published September 25, 2017- 15 Comments
) to make sure it compiles, click the Share! button and add the generated link to the comment section of this post, or onBarteks post.
Variadic CRTP: An Opt-in for Class Features, at Compile Time
If two people submit an equivalent solution, the first one wins.