Commit 553353ab authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

Add a new introductory notebook to C++.

parent f78b7cee
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"slideshow": {
"slide_type": "-"
}
},
"source": [
"# [Getting started in C++](/) - [A brief introduction](./Introduction.ipynb)"
]
},
{
"cell_type": "markdown",
"metadata": {
"toc": true
},
"source": [
"<h1>Table of Contents<span class=\"tocSkip\"></span></h1>\n",
"<div class=\"toc\"><ul class=\"toc-item\"><li><span><a href=\"#A-very-brief-historic\" data-toc-modified-id=\"A-very-brief-historic-1\">A very brief historic</a></span></li><li><span><a href=\"#Which-standard-will-be-tackled-in-this-lecture?\" data-toc-modified-id=\"Which-standard-will-be-tackled-in-this-lecture?-2\">Which standard will be tackled in this lecture?</a></span><ul class=\"toc-item\"><li><span><a href=\"#C++-11/14/17-rather-than-C++-98/03\" data-toc-modified-id=\"C++-11/14/17-rather-than-C++-98/03-2.1\">C++ 11/14/17 rather than C++ 98/03</a></span></li><li><span><a href=\"#But-which-one?-11,-14-or-20?\" data-toc-modified-id=\"But-which-one?-11,-14-or-20?-2.2\">But which one? 11, 14 or 20?</a></span></li><li><span><a href=\"#And-C++-20?\" data-toc-modified-id=\"And-C++-20?-2.3\">And C++ 20?</a></span></li></ul></li><li><span><a href=\"#A-multi-paradigm-language\" data-toc-modified-id=\"A-multi-paradigm-language-3\">A multi-paradigm language</a></span></li></ul></div>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## A very brief historic\n",
"\n",
"- C++ was first published in 1985 by Bjarne Stroustrup with the idea of extending C with object programming; the first name of the language was _C with classes_\n",
"- The first standard was issued in 1998 and called _C++ 98_\n",
"- A first (minor) update was issued in 2003 (and dubbed *C++ 03*)\n",
"- The plan was to provide a major overhaul for the next version, which was called for a long time *C++ 0x*.\n",
"- The schedule failed, as the next standard turned out to be *C++ 11*. It is a major update, with lots of new features and syntactic sugar introduced.\n",
"- The plan was now to publish a release every three years, alternating minor and major ones. It has proved more successful than for *C++ 0x*, except for the minor/major:\n",
" * *C++ 14* was a polishing of *C++ 11*, as intended.\n",
" * *C++ 17* introduced more new stuff than *C++ 14*, but not as many as initially intended.\n",
" * *C++ 20* should therefore be a major update, almost as groundbreaking as *C++ 11*.\n",
" \n",
" \n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Which standard will be tackled in this lecture?\n",
"\n",
"\n",
"### C++ 11/14/17 rather than C++ 98/03\n",
"\n",
"The new major standard is now widely supported by compilers, and introduces many features that are very useful. As it is much more pleasant to use, it would be a shame to restrict ourselves to the older versions of the standard.\n",
"\n",
"However, you may have to tackle legacy code with is written in C++ 98/03, so we indicated as much as possible for each feature presented when it was actually introduced.\n",
"\n",
"### But which one? 11, 14 or 20?\n",
"\n",
"As indicated above, we tried to specify clearly in which standard specific features were introduced. Few guidelines:\n",
"\n",
"- C++ 14 is now a safe bet for most compilers, so you probably should choose this one instead of C++ 11. Vincent is working on a library named [Gudhi](https://gudhi.inria.fr/) that is rather conservative for the standard use (in the sense they want most users to be able to compile the code without having to install brand new environment) and they switched to C++ 14 a year ago. **check**\n",
"- C++ 17 starts to be widespread as well, but it is still fairly recent for some features (for instance filesystem support in the STL requires bleeding edge gcc compiler). Sébastien is using it for the library he is working on ([MoReFEM](https://gitlab.inria.fr/MoReFEM/CoreLibrary/MoReFEM)).\n",
"\n",
"### And C++ 20?\n",
"\n",
"C++ will not be addressed much in this lecture... essentially as Vincent and I are not using it (yet).\n",
"\n",
"It has not been officially ratified and published, but some features are already available in recent compilers (you may have to specify *c++2a* instead of *c++20* in your command line - as shown in the historic above for *c++0x*, the convention is to use a letter rather than the last digit when the release is not yet officially supported)\n",
"\n",
"We will obviously update this lecture when it becomes widespread, as it will introduce very cool stuff (and the promise of much better compilation errors for templates...)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## A multi-paradigm language\n",
"\n",
"C++ was originally created with the will to provide object programming to C, but it is truly now a multi-paradigm language.\n",
"\n",
"This lecture will cover three of them:\n",
"\n",
"- [Procedural programming](1-ProceduralProgramming/0-main.ipynb)\n",
"- [Object programming](2-ObjectProgramming/0-main.ipynb)\n",
"- [Generic programming](4-Templates/0-main.ipynb)\n",
"\n",
"There are actually even more: functional programming for instance seems to be gaining traction at the moment and will be eased in C++ 20 standard (see \\cite{Cukic2018} for more about functional programming in C++).\n",
"\n",
"This richness is not always perceived as a boon: there is a section in the [Wikipedia page](https://en.wikipedia.org/wiki/C%2B%2B#Criticism) dedicated to the criticisms addressed at C++ for by notorious developers (but also a defense by Brian Kernighan!)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# References\n",
"\n",
"(<a id=\"cit-Cukic2018\" href=\"#call-Cukic2018\">Čukić, 2018</a>) Ivan Čukić, ``_Functional Programming in C++_'', 01 2018.\n",
"\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "C++17",
"language": "C++17",
"name": "xcpp17"
},
"language_info": {
"codemirror_mode": "text/x-c++src",
"file_extension": ".cpp",
"mimetype": "text/x-c++src",
"name": "c++",
"version": "17"
},
"latex_envs": {
"LaTeX_envs_menu_present": true,
"autoclose": false,
"autocomplete": true,
"bibliofile": "biblio.bib",
"cite_by": "apalike",
"current_citInitial": 1,
"eqLabelWithNumbers": true,
"eqNumInitial": 1,
"hotkeys": {
"equation": "Ctrl-E",
"itemize": "Ctrl-I"
},
"labels_anchors": false,
"latex_user_defs": false,
"report_style_numbering": false,
"user_envs_cfg": false
},
"toc": {
"base_numbering": 1,
"nav_menu": {},
"number_sections": false,
"sideBar": true,
"skip_h1_title": true,
"title_cell": "Table of Contents",
"title_sidebar": "Contents",
"toc_cell": true,
"toc_position": {},
"toc_section_display": true,
"toc_window_display": true
}
},
"nbformat": 4,
"nbformat_minor": 4
}
......@@ -78,6 +78,15 @@ isbn = {0-201-70431-5}
}
@book{Cukic2018,
author = {Čukić, Ivan},
year = {2018},
month = {01},
pages = {},
title = {Functional Programming in C++}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment