const is a contract--Arthur O’Dwyer
And it may be respected.
const is a contract
by Arthur O’Dwyer
From the article:
Here’s a slogan that needs more currency...
September 13-19, Aurora, CO, USA
October 25, Pavia, Italy
November 6-8, Berlin, Germany
November 3-8, Kona, HI, USA
By Adrien Hamelin | Jan 9, 2019 12:56 PM | Tags: basics
And it may be respected.
const is a contract
by Arthur O’Dwyer
From the article:
Here’s a slogan that needs more currency...
By pkeir | Jan 9, 2019 10:56 AM | Tags: None
Swapping arguments using a fold expression.
Swapping the Contents of n Variables
by Paul Keir
From the article:
C++11's
std::swap
is a binary function template which exchanges the contents of its two reference arguments. In C++20std::swap
will likely also permit execution at compile-time. In this post we consider a version which can swap the contents of an arbitrary number of arguments using a C++17 fold-expression...
By Anastasia Kazakova | Jan 9, 2019 10:54 AM | Tags: None
In JetBrains we feel it is important to keep monitoring the changing patterns and trends going on in the Software Development industry. That's why we run this survey yearly, trying to better understand the evolving world of development.
Developer Ecosystem 2019 Survey by JetBrains
by Anastasia Kazakova
About the survey:
In 2017, when we first started, the numbers of C/C++ developers in the survey were quite low:
- total number of C developers in the survey is 1174, number of developers who use C as a primary dev language is 166
- total number of C++ developers in the survey is 1713, number of developers who use C++ as a primary dev language is 348
A year after we got more impressive numbers:
- total number of C developers in the survey is 3371, number of developers who use C as a primary dev language is 1254
- total number of C++ developers in the survey is 4763, number of developers who use C++ as a primary dev language is 2036
We've learned a lot about language standard usage, compilers, build systems, unit testing frameworks, and other important aspects of C/C++ development from these surveys. Help us make it again this year!
By Adrien Hamelin | Jan 7, 2019 12:12 PM | Tags: intermediate community
Nothing is perfect.
Functional Programming Is Not a Silver Bullet
by Jonathan Boccara
From the article:
The past few years have seen a boost in popularity of the functional programming paradigm. Languages that were used mostly in academic circles for decades are now in broader use amongst programmers. And every couple of months, another functional language hits the news and gets its trail of followers.
Why is that? Functional programming allow for safer and more robust code, in part due to one of its core principles: values are not mutable. A consequence of this is that there is no side effects. We can apply this principle in any language, including in C++, by coding with the least side effects possible.
While it certainly helps putting together a better design of code, it’s important to realize that it’s not the panacea, that this principle doesn’t solve in itself all design issues. Nothing is the panacea anyway, but in this time of gold rush towards functional programming, we could be tricked into thinking it will automatically lead to good design.
Functional programming is known to reduce coupling in code. We’ll briefly go over what coupling is, what sort of coupling functional programming prevents, and how some other dangerous forms of coupling can still sneak in even with functional programming. You want to pay attention to those to preserve the design of your code...
By Adrien Hamelin | Jan 7, 2019 12:10 PM | Tags: community
You can also do it!
Getting You There - Your C++ Standardization Efforts in 2019
by JeanHeyd Meneide
From the article:
If you’re facing Financial Hardship, are a student, are self-employed, and have written a proposal that the chairs of the C++ Standardization Groups (Library Evolution, Evolution, Core, Library, Parallelism/Concurrency, and similar study groups) deem necessary to help move the language forward (in large or small ways), you can apply for Grant Assistance from the C++ Standards Foundation. If you have an employer but that employer will not cover the full cost, you have papers to present (yours or on behalf of others) and similar, you can apply for Travel Assistance.
I will talk about Travel Assistance, because that is what I have applied for and successfully received. A huge thanks to the Standard C++ Foundation for making something like this available! I can only hope that my work will continue to be things that they need, and that I can continue to write papers and do work on behalf of the C++ Community to move our various industries forward...
By Adrien Hamelin | Jan 7, 2019 12:01 PM | Tags: community
New way to program?
REPL (Read-Eval-Print-Loop) in C++: hands-on session
by Pascal Thomet
From the article:
A Read-Eval-Print-Loop (REPL) enables to leverage very rapid and robust application development, prototyping and testing. This kind of development environment originates from the early days of functional programming (Lisp machines and the like), and is common in functional and scripting languages.
As a compiled language, C++ was out of the loop for a long time...
By Adrien Hamelin | Jan 4, 2019 02:56 PM | Tags: community
Simple indeed.
A Simple Timer in C++
by Jonathan Boccara
From the article:
Some languages, such as JavaScript or Visual Basic, offer the feature of a timer, that is to say an object that calls some code at defined intervals. At the time of this writing (C++17) and to my knowledge, C++ doesn’t offer such a feature...
By Adrien Hamelin | Jan 4, 2019 02:50 PM | Tags: intermediate
Basic, but complex.
What is an Allocator?
by Vanand Gasparyan
From the article:
This is one of the many beautiful questions you can think on or be asked at interviews if your native coding language is C++. The beautiful thing about this question is that you answer it again and again as you grow and gain more experience. Similarly, when you’re being interviewed for an internship, knowing that there is such a thing somewhere in STL might be enough, whereas later you’ll be expected to write your own custom allocator...
By Adrien Hamelin | Jan 4, 2019 02:48 PM | Tags: intermediate
Did you know?
Don’t forget: std::pair does lexicographical ordering, so you don’t have to
by Raymond Chen
From the article:
A feature perhaps not as widely known as I thought is that the std::pair type performs lexicographical ordering, so you don't have to...
By Jordi Mon Companys | Jan 3, 2019 03:56 PM | Tags: community
The place C++ will have at Unity:
C++, C# and Unity
by Lucas Meijer
From the article:
C++ is not great at this task. I want my loop to be vectorized, but a million things can happen that might make the compiler not vectorize it. It might be vectorized today, but not tomorrow if a new seemingly innocent change happens. Just convincing all my C/C++ compilers to vectorize my code at all is hard.