January 2019

Functional Programming Is Not a Silver Bullet--Jonathan Boccara

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...

Getting You There - Your C++ Standardization Efforts in 2019--JeanHeyd Meneide

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...

REPL (Read-Eval-Print-Loop) in C++: hands-on session--Pascal Thomet

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...

CppCast Episode 181: ISO Papers and Merged Modules with Isabella Muerte

Episode 181 of CppCast the first podcast for C++ developers by C++ developers. In this episode Rob and Jason are joined by Isabella Muerte to discuss her experience presenting multiple papers at her first ISO meeting in San Diego and her thoughts on Merged Modules.

CppCast Episode 181: ISO Papers and Merged Modules with Isabella Muerte

by Rob Irving and Jason Turner

About the interviewee:

Isabella Muerte is a C++ Bruja, Build System Titan, and an open source advocate. She cares deeply about improving the workflow and debugging experience the C++ community currently has and is designing and implementing an experimental next-generation build system called Coven based on ideas mentioned in her CppCon 2017 talk "There Will Be Build Systems", while also simultaneously ripping CMake apart and putting it back together again with a library titled IXM. She recently launched aliasa.io, a small URL routing service intended for the CMake FetchContent module. She enjoys playing Destiny 2, acquiring tattoos, and is currently trying to master the five elements of earth, wind, water, fire, and gun (but she makes no promises). She bows to no entity but the terrifying Eldritch Daystar we call the "sun", and hopes to one day own two german shepherds named Rip and Tear.

A Simple Timer in C++--Jonathan Boccara

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...

What is an Allocator?--Vanand Gasparyan

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...

C++, C# and Unity

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.

Ranges, Code Quality, and the Future of C++--Jason Meisel

Very intersting comment about ranges.

Ranges, Code Quality, and the Future of C++

by Jason Meisel

From the article:

Many of you have seen the recent blog post by Eric Niebler about the acceptance of his C++ Ranges proposal to the C++2a standard. This is a feature set I’ve wanted in C++ for some time. In fact, using C#’s standard LINQ library, I’ve become accustomed to writing code in this style.

I found it unfortunate, then, to see people respond to this post on Reddit and Twitter by complaining that this feature makes code unreadable. Apparently, C++ is becoming more complex and less useful.

I think this is completely untrue. C++2a is going to be the best version of C++ yet, and a big reason for that is Eric’s Ranges library.

But even to me, his Pythagorean Triples example is bad code. This is not because this range library makes code harder to read, but because he utilizes the library very poorly...

A Free Ebook on C++ Smart Pointers--Jonathan Boccara

Nice way to learn more.

A Free Ebook on C++ Smart Pointers

by Jonathan Boccara

From the article:

To write expressive code in C++, mastering smart pointers is a necessity! Without them, our code becomes littered with memory management, news and delete, and unclear semantics about who owns what resources.

If you’re part of my mailing list (which you can join at the bottom of this post), you will get as a Christmas gift a free ebook of more than 50 pages of selected contents of Fluent C++ about smart pointers. Of course, you also get access to the ebook if you’re a Patron of Fluent C++...