Felix Petriconi

Felix Petriconi

Apr 172018
 

So, I am back home from my fourth ACCU 2018 conference in Bristol, UK. It has taken place from 2018-04-10 until 2018-04-14. This was my third conference as a speaker and the second as conference committee member. I will try to sort all the impressions from the recent five fantastic days.

Before I go into details on the individual sessions that I attended, I want to look back at the beginning of December 2017. Back when we, the conference committee, sat together, partly on location in London, partly we did attend via video conferencing to assemble a conference schedule. We had the difficulty to select from about 120 session proposals just about 60, where the majority was of high and very high quality. From my point of view, it was much more difficult than the year before – when it was the first year for me to attend the assembling meeting as a committee member. The quality of the abstracts was much higher this year. At the end of the day, we had a rough schedule of three C++ tracks and two with non-C++ content. I felt very sad, those good proposals of excellent speakers did not make it into the schedule.

Unfortunately, some accepted speakers have withdrawn their session so that we had to try to find replacements. In the end, unfortunately, we had even an empty 90 minutes slot. We had especially a high rate of withdrawn short 20 minutes sessions. But later more about this.

So the conference started as usual with a day of pre-conference tutorials. Since I did not attend any this year, I have to refer to other trip reports. Later in the evening the local Agile Bath & Bristol user group held their meeting in the conference’ venue and Seb Rose spoke about why User Stories should be made “RIVETing” and not “INVEST”.

The conference was opened on Wednesday with a short welcome by our conference chair, Russel Winder. Then Gen Ashley held the opening keynote with the title Diversity & Inclusivity in Tech. This keynote turned out not to be a traditional style of keynote but was structured as an introduction to the person and the organization and then a question and answer session. Whilst this seemed to work for some in the audience, it really wasn’t what I was expecting, seemed to miss an opportunity to address the issues, and thus it didn’t really
work for me.

After a short break I listened to Louis Dionne about Runtime Polymorphism: Back to the Basics. Even that he stated, that one should not listen to him,

Louis refers to Sean’s “Inheritence is the base class of all evil” talk

I kept doing it. Although the slides contained quite a lot of template code, he described very clearly in a well-structured form different approaches how to circumvent the disadvantages of runtime polymorphism through inheritance.

After lunch, I followed Roger Orr‘s Nothing is better than copy or move. It was easy to follow his explanations how passing of arguments to C++ functions and returning values from them have changed from the beginnings of C to recent C++17.

For the last session of the day, I chose a non-C++ topic and followed Charley Bay on his journey of A Quantum Data Structure For Classical Computers. He described very well the basics of quantization without going into much details of physics. At the end of his session, he took an outlook into quantum computing. Since I am interested in this topic, I will later take look at his slides, because they contained more information than I could catch during the session.

The day closed with a welcome reception.

Hadi Hariri opened the next day with his keynote Kotlin/Native – Embracing existing ecosystems. He gave the audience an overview of this newer programming language, that first was written for the JVM and that just got recently a native binding as well. Even that this language has some nice features and eases certain things compared e.g. to C++, it did not convince me to walk further in that direction.

Since I am personally very much interested in asynchronous programming and I am a co-author of the stlab concurrency library, I attended Detlef Vollmann‘s session Finally Executors for C++. He gave a good overview how the executor’s proposals have evolved and about the current state of the standardization process. But I could imagine that some attendees would have liked here a bit more introduction into the C++ standardization process and its terms.

During the lunch break, interested attendees could get an introduction to the charity organization Code Club. It is a worldwide organization and in the UK, they have already 6563 clubs and teach over 91,000 kids in programming. We could choose from different projects, should try to think like 8 to 13 years old kids and follow their first steps in programming. It was fun.

John Lakos made the point in his session C++ Modules and Large-Scale Development, that the upcoming C++ modules only help those who clean up their dependencies. Otherwise, they will gain nothing from the new language feature.

Procedural Programming: It’s Back? It Never Went Away by Kevlin Henney was my last session of the day. As all of his sessions before, that I have seen, it was brilliant! When its recording is set online, I recommend to view it.

During the second round of Lightning Talks, Robert Smallshire picked up the diversity topic from the first keynote and gave us a glimpse of an overview of a large international gender study. I would have expected to see this kind of information and more in the first keynote.

The day closed with the conference dinner. Besides an entertaining performance by a magician, I had very interesting discussions with the other attendees. Since we had this year again the rule, that the tables were mixed after each course, everybody came automatically into contact with different attendees.

Russel Winder – not Saruman or Sauron – is announcing changing of seats for the next course

The Friday’s opening keynote by Lisa Lippincott about The Shape of a Program followed more the format of a keynote, that I expected. She talked about her work to apply mathematical topology theory on procedural programs.

Kate Gregory spoke in her Simplicity: not just for beginners session afterward how important, but never the less much more difficult it is to write simple code. In her brilliant way, she established a connection to her keynote at the recent Meeting C++ conference so that those who have seen it, get a wider view on the overall story that she is telling, without losing those, who could not attend that conference or has seen it later online.

After lunch, I attended a slot of four short sessions. Gail Ollis spoke about What’s new about fake news? There she laid nicely out, that the phenomenon of fake-news is nothing new, but it is a problem that is already known for a longer time and that especially in a dictatorship it was and still is a widely used practice. Then I spoke about Can I change my organization?. Jim Hague spoke after me about The Clacks in Discworld and Roundworld, where he took a historic view on the origin of semaphores, a mechanical – optical system to transmit information over a great distance in France, invented by Claude Chappe. Jim compared it with the similar system that was later used in the UK.

As I have mentioned before, several speakers had withdrawn their short sessions, so we, the conference committee, decided that we ask the attendees in the whole plenary, if someone wants to step in and give a short talk. Fortunately, some were so kind and volunteered. One of them was Ahto Truu. He explained in a humorous way – the slides were photos of hand drawings on paper napkins, because of his spontaneous stepping forward for a short session – What are hash trees and why you should care. He did it in an excellent way and I hope that I might attend in the future a full 90 minutes session by him.

Even not so many attendees were present throughout this four sessions, we had some nice discussions in the short period of available time.

The last session of the day that I attended was by Daniel James where his topic was Cryptography for Programmers. Here he gave a good overview of the different standards and techniques to encrypt data. His presentation was very well structured. But at the end, it was sad that he could not show all of his slides, because of a lack of time. But whenever I have to follow up on this topic I will use his slides as a starting point.

Before an event sponsored by Bloomberg in a local brewery took place, we had a final set of Lightning Talks, presented by Pete Goodliffe. It was again a great fun. Pete, please come back next year!

The final day started for me with my own session on There Is A Better Future. I had only about 20-30 attendees, but many of them were very nicely participating in a lively discussion. Before the closing keynote, I went to Odin Holmes session about How to be polite to unicorns. In this expert session about template metaprogramming, he discussed ways to improve the compilation speed of TMP code. As an example, he used the heavily overloaded std::tuple constructor and std::tuple_cat. After a little harsh dive into a very complicated topic, his explanations become better and better and he had shown ways to improve the compilation times of such code.

The closing keynote Software development – learning to walk again by Seb Rose was a very nice and humorous presentation. With the help of an analogy of a hiking tour he did recently in the south of France, he went through the complete cycle of a software development project.

Overall I am really happy that I attended this conference. It was a pleasure to meet again so many nice people after one year and get to know new ones! I can recommend this conference as a place to deepen your knowledge in so many different areas and get an idea of new techniques out there.

And if you are interested in speaking at ACCU and you are afraid of giving a 90 minutes talk, then I recommend starting to present e.g. at your local user group or submit next year a short 20 min. presentation. From my personal point of view, doing a good Lightning Talk in 5 minutes is much more difficult than doing one in 20 minutes. So look out for Call For Papers next October.

 

 

 

Feb 042016
 

I just read Jens Wellers article regarding raw loops vs. STL algorithms.

At the end he states “When I work with Qt, there are some cases, when you only get the count and a method to access item n, like in a QListWidget:” with the example:

And that is the point where I want bring in the possibility to use Qt widget container like objects in range based for loops or in STL algorithms. The only thing that one needs for this, is a small proxy that provides the begin(), end() interface:

So how to use it in the example from above?

For better readability and perhaps later reuse at other places let’s define this type:

And now the example becomes:

The template might be simplified in regard of the interface. But Visual Studio 2013, the compiler I have to use currently, lags certain C++11 features.

What do you think? So feedback is welcome.

 

 

Mar 262015
 

I just finished the first draft of the implementation of my enum_extend library. It is available via github.

It offers

  • Ranges over all defined enumerated values
  • Filtered ranges over a subset of enumerated values
  • ++ and — pre- and postfix operators
  • Attaching a textual representation to each enumerated value

Some examples:

Only this specialization and the implementation of the operators is necessary:

There exists a set of macros that simplifies the process of specializing the extender and implementing the operators.

Much more details and examples can be found in this first tutorial

Feedback is welcome!

 

Jan 232015
 

Sean Parent posted today via Twitter this small neat algorithm:

 

 

Problem:

During my today’s work I came across the problem that inside a predicate there was a check if a specific enum value is equal to a set of possible values.

So the code looked like this:

I don’t like this collection of comparisons for equalness. From my point of view it is some kind of semantically copy-and-paste.

So with Sean’s code in mind I started thinking and I searched for alternatives. The first used a std::initializer_list:

So the example from above would read like this:

That is already better, but it does not read so fluently. So I tried to solve this with a builder like pattern:

The code example would then be like this:

That’s much better, but the curly braces inside the parameter are annoying. It would read much better this way and would be less typing, don’t you think?

So this is my next attempt to solve it with variadic templates:

My next idea was, that there must be a way to do it with variadic templates without the recursion terminating bool in(T)  method.

 

So I played around a bit with Sean’s code, after I understood what it is actually doing, this is the result (thanks to cpplearner for the improvement hint):

One disadvantage of this solution is, that the order of evaluation of the arguments is not defined.

But with Jay Miller’s comment, based on Eric Niebler’s improved version of the for_each_arg, this keeps the order of evaluation of the arguments.

Conclusion:

The last version is the most compact one, but it has the disadvantage compared to all the others, that the internal comparisons does not terminate early. So the code will compare all possible values, even a match was already found. As long as the value to be checked against the set of values cannot be evaluated during compile time, I don’t see a way to do it in a similar way like the last version. If you see one, please let me know.

Unfortunately the code does not fulfill Sean’s challenge: “Goal for Better Code: Fit each function in a tweet”. Never the less I think it is worth sharing it.

Since this is almost my very first experiment with variadic templates, all ideas for improvements or comments are welcome.

 

Note:

Please use “crayon” to enter source code in he comment. The “code” tag removes all “<” and “>”.

This code does not compile with Visual Studio 2013 update 3 in release mode, only in debug. It works fine with update 4 and VS2015 CTP and the recent Clang and GCC.

 

Oct 212014
 

I am happy to announce that I published a C++ library that offers a lightweight version of a Design by Contract functionality. You can find it under http://github.com/FelixPetriconi/contract_light.

Here is a simple example for the beginning. More to come later