Monday, 4 August 2025

C++ on Sea 2025 trip report

I'm writing this up a while after the event, because life got in the way. I hosted the lightning talks again, which distracted me for some parts of the first two days. I also gave a talk on the first day. The third day allowed me to just sit back and listen. 

We started with a keynote by Herb Sutter. He talked about "Three cool things in C++". The title was a way to decide last minute what those things would be. 


He covered reflection. std::execution and "EB" (erroneous behaviour) (mentioning standard library hardening and relocation too). My brain wandered off a bit because he was encouraging us to imagine what might be possible with the new features. So I day dreamed. I do think having reflection to generate some boilerplate will stop the trend to use GenAI for boilerplate, which is high up on my wish-list. 

 Next, I went to Sandor's "Namespaces 101" talk. He's written a trip report too, which has more details on the talks than I'm going to manage here. He asked why I was in his talk, because it was aimed at beginners. I was interested to see how he introduced the topic. As I expected he covered some basics I had forgotten. It's worth reminding yourself of the basics once in a while. I took a picture of one slide, because it summarised important stuff:



  • Using declaration are fine in .cpp files
  • Limit using directives to (and even in) .cpp files
  • Avoid namespace aliases, especially in header files
  • No more than 4 level nested namespaces
  • Differentiate between impl, detail, potentially detail or api
  • Always fully qualify in macros
  • Opening up a foreign namespace is often a code smell (it can happen sometimes)
I do enjoy beginner talks. Expert level talks are great too, but sometimes going back and thinking through the basics is important. Thanks for a great talk Sandor.

I gave my talk after lunch:

I demonstrated how to implement a simple form of reinforcement learning, letting my machine figure out how to play snake. I wasn't 100% polished, because I had lightning talks to sort for the evening. I got loads of intelligent questions from the audience. Thanks to all who came along. Hopefully I showed the so-called AI isn't magic (and isn't limited to GenAI). 

Steve Love talked after me about CMake. He usually brands himself as a C# programmer: go check out his C# Brain Teasers book. However, he was a C++ coder when we first met, and keeps his hand in with C++. Many CMake tutorials are too complicated and the docs are hard work, so his talk is a really useful introduction if you want to learn the basics of CMake quickly. 

The lightning talks were as follows:
  • Cassio Neri, Algebra, Algorithms, Alakazan!
  • Andrew Drakeford, Better Performance Through Structured Problem Solving: The Pólya Approach 
  • Robert Schimkowitsch, Start a User Group, in 5 Easy* Steps
  • Tom Tesch, Teaching the NES: What 6502 Assembly Reveals About Modern C++
  • Sandor Dargo, A recipe for designing your week
  • Guy Davidson, Dying for your language
  • Alex Vanden Abeele, Let's make VLD great again
  • Koen Samyn, Teaching GameDev: A C++ centric approach
  • Conor Spilsbury, How to Cook Your CPU with C++
  • Rashmi Khetan, Terminating your bugs with Time travel and AI
My laptop decided to speed through Andrew's slides. I must stop using PowerPoint. It does things. Bad things. Sometimes. Sorry Andrew!

On Tuesday, I started with Sebastian Theophil talking about To Err is Human: Robust Error Handling in C++26. He started with C-style error handling, moving on to C++ exceptions, std::expected, contracts and then library hardening:

"Hardening allows turning some instances of undefined behavior in the standard library into a guaranteed termination of the program."

See Open-std. He ended by discussing how and what to handle. 

Next I went to listen to Mateusz Pusz on The 10 Essential Features for the Future of C++ Libraries. I can't make sense of my notes properly. I don't have a list of ten things! But I did jot down non-type template parameters and his units library. He talked about variable templates and contracts (a little), and attempting compile time debugging with constexpr and consteval - which is hard. (Does anyone else pronounce consteval as const evil, or is it just me? (It's not evil, but can make your head hurt)) . He also mentioned scnlib. I'm currently writing an introductory C++ book for O'Reilly. Having a mix of std::println for output and std::cin for input is kinda weird. Here's hoping the new scan library becomes part of C++ one day. 

I couldn't get a consistent WiFi signal in the next session so went back to the hotel to piece together the lightning talks for that evening. I did get back in time to listen to Timur Doumler's KEYNOTE: Contracts, Safety, and the Art of Cat Herding. He promised a blog about Eiffel and completeness/correctness at some point. 

Tuesday's lightning talks were as follows:

  • Tina Ulbrich, Naming is Hard - a Field Study
  • Gil Hoben, GPU programming with Triton and C++
  • Evgenii Seliverstov, Conan Strikes Back: Easy Migration to Conan 2.0
  • Andrew Drakeford, Simple Compile Time Dynamic Programming
  • Björn Fahller, It *is* a pipe, but should it be? (Sorry Magritte)
  • Nico Eichhorn, From Wide to Wrong: Spotting Dangerous Conversions in C++
  • Florent Castelli, A note about safety
  • Robert Leahy, To Flush or Not to Flush? That Is the Question
  • Braden Ganetsky, Shimming OpenSSL Out of Necessity
  • Damien Buhl, Not Many option()s Left: Surviving CMake with Toolchain Files
  • Timur Doumler, Design by intuition
You notice Andrew came back for more? Pleased to report we used his pdf instead and it just worked. Thanks to everyone brave enough to talk. 

Wednesday was more relaxed for me. I started with Jason Turner on The Power and Pain of Hidden Symbols. He started by talking about ABI and related diff tools and then went on to LTO. A new angle for me was using LTO to find bugs.  His C++ Weekly YouTube has an episode which covers some of this. It was so nice to sit at the front and not be distracted by looming talks!

Next I went to listen to Nicolai Josuttis on Rethink Polymorphism in C++. He compared OOP with vtables to using std::variant and std::visit. People have Opinions about this. As I mentioned, I'm writing a beginner's book about C++. Trying to explain all the parts you need to get OOP working is C++ is hard work. There are so many details. Using a variant instead is much simpler, but does have drawbacks. For example, it only works on a closed set of types. I haven't quite decided how to introduce the variant in my book yet. I might stick to extending behaviour rather than showing an alternative to vtables, to avoid controversy. Nico' talk is worth listening to when it's out though. 

I went to see Tristan Brindle next. He talked about Faster, safer, better ranges. He showed various ways the standard could be improved. On example was filters and multi-passes causing trouble:


 (I will copy the code from the slide and play with it one day: basically reversing a range caused trouble). His flux library explores several ways to speed up and improve ranges, without nasty surprises like reversing a range causing trouble. 

I next ended up in Björn Fahller's talk Will your program still be correct next year? I had intended to go the green programming talk, but the schedule got switched. Björn 's talk was great. Another start simple thing: write some tests! He talked about prints then asserts first, and moved on to using testing frameworks. A really nice talk starting from something most of us have done: prints for debugging, to why actual tests are better.  We all know that but the reminder is always useful.

The final KEYNOTE: Why Software Engineering Interviews are Broken and How to Actually Make them Better was given by Kristen Shaker. She's left IT to become an estate agent. This gave her freedom to take down the interview process. Go watch the talk when it's out. We are doing it wrong, and I personally can't face another "homework question (it will only take 40 minutes)". Coding challenges always take hours, and most people lie about the time they spent. 

I had a great time, and learnt lots. The variety of talks, from beginner to expert is great. If you get the chance to go, you should. 

Tuesday, 8 April 2025

ACCU 2025

 I spoke at ACCU 2025 this year. It took place in Bristol, but was hybrid, so I also gave an online poster presentation. 

The schedule is here: https://accuconference.org/2025/schedule. The opening keynote was given by Anastasia Kazakova about  The Next Coding Horizon: Proactive LLMs for Enhanced Productivity. She shared some stats about what tools etc programmers are using and told us some Jetbrains tools related to LLMs. Anastasia kept telling us to wait for more details at Daisy's keynote talk on Thursday. 

I went to Heaps Don't Lie - Guidelines for Memory Allocation in C++ by Mathieu Ropert next, which talked through malloc being slow and some alternatives, which ended up being worryingly close to writing your own malloc! Meanwhile, Dom Davies filled a slot in the room next door, because the intended speaker couldn't make it. He played some music which almost drowned out Mathieu, who handled this very well. 

Mathieu pointing out allocations in code


I took some time out after lunch to use the gym at the hotel, so missed the next slot. After that I went to A Very Small Language Model by Jez Higgins. He explained Markov chains: what happens next depends on the current state, not how you got to the current state. He used these to build a text generator, in JavaScript, using n-grams, starting with 2, and then increasing. This means using the last two words to predict the next word, based on a corpus (or document, like the Complete Works of Sherlock Holmes or Jane Austin). You tokenise the text (break into words), and build a lookup table of what follows 2-grams (or 3-grams etc). That gives you a probability of the next word, so you can probabilistically select what to generate next. Many silly sentences were generated. 

Jez explaining predictive text

There were 10 lightning talks that evening. A speaker gets up to five minutes, and is kicked off stage if they go on for too long.  You had to be there (but they may be online at some point). 

First session of lightning talks

The second day started with KEYNOTE: C++ Exceptions are Code Compression by Khalil Estell. This went into some depth, but showed how to use exceptions in systems people claim you can't use exceptions in, and furthermore how the code might be smaller and more efficient. Khalil started by saying he told his student the accepted wisdom that exceptions are slow and bloat code, but when his students kept asking why he wanted to demonstrate why. It took some fiddling to make the exceptions work, but it turned out the common claim is wrong, sometimes. Khalil has talked about this before: for example https://www.linkedin.com/posts/khalil-estell_new-exception-performance-pr-reached-activity-7289806930766675968-KCyG/. I suspect each version has more details. 

Khalil starting his keynote


After an in-depth start, I went to C++ Coroutines - Gods from the Machine by Phil Nash. I did attend a workshop he ran, taking a similar approach at CppOnSea a couple of years ago. He starts by adding co_return to a function and follows the compiler error messages from there to get a working coroutine. If you need help writing a coroutine, listen to his talks when it's online. 

There was a poster session, and a student, Jacob Farrow, from Bradford University had his poster proposal accepted. His poster title was "Tracking Success: Enhancing Visual Tracking Skills in Children with Cerebral Visual Impairment through Interactive Digital Tools". I attempted to join, but couldn't find a quiet spot with enough WiFi coverage, so couldn't listen in. A shame. (I'm an industrial advisor at the Uni, so I shared the call of proposals with some CompSci lecturers, who persuaded the student to join in.) By this point, my brain had overloaded, so I skipped a session and went for a walk. 

In the afternoon I went to How old am I in Seconds and other insights from the C++ chrono library by Nicolai M. Josuttis. He gave a great introduction to using std::chrono for time and durations in C++. He didn't really answer the questions posed in the title - he lied about his date of birth, allegedly, and pointed out the different leap seconds used by different clocks. Howard Hinnant has a blog about leap seconds: https://howardhinnant.github.io/date/d0355r4.html, if you can't wait for Nico's recording on YouTube. (The blog covers much more than leap seconds.)

Nico counting in seconds

There were more lightning talks that evening, followed by a pub quiz (which I didn't attend because I needed some tea). I shared my poster and pointed out to attendees the conference was hybrid, so some people were online. 

More lightning talks (including me)

Thursday began with a  KEYNOTE: Learning to stop writing code (and why you won't miss it) by Daisy Hollman. She told us about Claude and Anthropic. Many people know ChatGPT, but not Claude. They are both LLMs, generating various types of output. Daisy explained how they work, and told us some inside information (Think harder). She put an emphasis on agents: at a high level, using several smaller parts rather than one big framework. What I found interesting was trying to wire in json or similar so the "AI" can use tools too. This might generate better code. Watch this space.

Daisy talking about agents


I went to / Error Handling Omitted / by Roger Orr next. I was speaking afterwards, so my mind wasn't 100% focused. And Dom was in the room next door, and his microphone was coming out through the speakers in this room to begin with! However, Roger did suggest you at least hint at error handling in docs or code examples. He explored various ways to report errors, and maybe he'll write it up for Overload one day. (Or 'll look at my notes and add more details here, later). 

I attended some of the ACCU's AGM over lunch, but had to leave early to set up for my talk afterwards. My talk was called An introduction to reinforcement learning: Snake your way out of a paper bag. I used a simple type of reinforcement learning, called Q-learning, and demonstrated an agent (that word again), moving in space. I gradually got it to play a game of Snake. Reinforcement learning doesn't use labelled data. Instead, agents trying actions, and either get a reward or penalty. They can then probabilistically pick an action next time. They look as though they are learning, but this begs a question about what learning really means. 

After my talk, Steve Love talked about C#: Puzzling C#. He's written a book for PragProg: https://pragprog.com/titles/csharpbt/c-brain-teasers/, which will be in paper form soon. His talk went through a few puzzles from the book in depth, and introduced some new puzzles. I know some C#, but have lost track recently, so this was a good way to get a glimpse of newer features and things to watch out for. 

Steve ready to give his talk


There was a speakers' dinner on Thursday evening, so the final day started with slightly later sessions, leaving the keynote to the end. I had a late breakfast, so I missed the first sessions. I did make it to How to write a Rubik's cube solver by Sam Saariste. He used Python for his code. He's been working on this with his son, who has entered speed cubing competitions and is doing very well at these. I had to leave before he finished, but his talking made me think, both about how to represent a Rubik's cube and how to enumerate moves. His visualisations were lovely. 

Sam's cube image, which he could rotate to demo playing. The numbers are a way to represent the cube which his son helped invent.

I had to leave early to be in my poster session. I sat in the backstage area, hoping the WiFi would work better, which it did. I shared some details about my Learn C++ by Example book, listing the table of contents and ways to try to (re)learn C++ over the various new standards. I believe writing small programs that do something, for example games, are a great way to learn. Only one person turned up, but we had a long chat about writing books about tech stuff that keeps changing. A challenge :-)

I managed to grab some lunch, then went to The Past, Present and Future of Programming Languages by Kevlin Henney. He listed various languages according to various indices, like TIOBE. As usual, he covered a huge range of topics, and sneaked in a few jokes. He also reminded us of history - for example why we have paradigms in programming. This dates back to a paper, "The paradigms of programming" by Robert W. Floyd from Communications of the ACM, Volume 22, Issue 8, Published: 01 August 1979, available here: https://dl.acm.org/doi/10.1145/359138.359140. There were lots of other lessons from history, and a musing on what might come next. The main thing I remember is that nothing much has changed for a while, in terms of new languages. 


One of Kevlin's slides: The past, present and future walk into a bar. It was a tense situation.

Finally, we had the closing KEYNOTE: Teaching an Old Dog New Tricks: A Tale of Two Emulators by Matt Godbolt. He showed us two emulators for the ZX Spectrum he had written. One implemented the way he usually approaches emulators, and the second trying to use modern C++, including templates, coroutines and modules. It's really encouraging to see a person of renown being honest about things they find confusing or that didn't work. He had various slides of old games which some people managed to guess when asked. It was a great talk, with some neat tricks. (I'll dust off my notes and list some later). 


Matt summing up
His summary reminded us
  • Learning is uncomfortable
  • Challenge your assumptions
  • Do things that bring you joy
  • Testing is always worth it

I had a great conference, met new people, caught up with others I already knew and was very tired by the end. We got a new kitten about 6 weeks beforehand, so we weren't sure how she would react when we got home. She was pleased to see us, and demonstrated this by playing lots. 

Willow showing off how to play "put a toy in a box"




Thursday, 20 March 2025

CppOnline 2025

I attended CppOnline this year. The conference happens entirely online, which makes the tickets cheaper. And you can even get one for free if you give a talk, volunteer or give a poster presentation. Phil Nash organises this, with help from many people, and kicked things off.



I gave a talk, called "Don't be negative". I asked how do you remove negative numbers from a container? C++ can be confusing sometimes. For example, the algorithm remove_if does not remove elements. More modern C++ gives us better approaches which are less confusing. I showed old and new ways to remove negatives, getting you to think about what is going on under the hood and why. I also gave some silly examples, for example randomly removing elements, and seeing if what was left was non-negative, inspired by bogosort. A slightly lossy algorithm, which may never complete. 

We recently got a new kitten, Willow, so trying to view the talks on a laptop proved difficult. The power key is on the keyboard, so Willow managed to turn the machine off. And disable the camera. And chat in the discord for CppOnline. 



I only made a few of the sessions, but there are recordings which will be on YouTube at some point. 


I listened in on the lightning talks, which were a nice mix of informative and silly. If you ever attend a conference, consider giving a lightning talk if you have the opportunity. It's a good way to try public speaking. There are over quickly - usually you get up to 5 minutes. 


I managed to listen to two complete talks - others I had to dip in and out of due to having far too much to do, including giving a poster presentation, and recovering afterwards.  

The first talk was by Andrew Drakeford. He gave a lightning talk at CppOnSea, when I was hosting them a while ago. I believe this was his first talk, and he wrote it up for ACCU's Overload magazine. He has now given at least a couple of longer, and very interesting talks. His talk this time was about Data-Oriented design: using data layouts and better algorithms and similar to optimize a program. He reminded me about George Pólya's book "How to solve it: A new aspect of mathematical method." Pólya gave four steps:

1. Understand the problem,
2. Devise a plan,
3. Carry out the plan,
4. Look back and check your work. 

If this fails, Pólya suggests "If you cannot solve the proposed problem, try to solve first some related problem. Could you imagine a more accessible related problem?"
His code example was trying to do regression (maths not breaking code) leaving out one element at a time from a million elements. He talked about memory access and layout and vectorization. He finally showed how a different equation meant far fewer calculations, which sped things up loads. The slides are online, and as I said, the talk will be too at some point. 

I also listened to all of  the "Art of friendship" by Mateusz Pusz. He showed how to use friend in C++, pointing out the benefits, like avoiding lots of error messages for globally accessible overloads when you make a mistake, and the potential problems. The slides are online, and the talk will be at some point. 

I mentioned posters. I did a PhD years ago, and gave poster presentations at conferences. They even counted towards my publications, so this is a great opportunity for graduate students. It's also an opportunity for people too shy to go on stage (whether in real life or online) and give a talk. Grad posters in real life are huge printed posters. The presenter stands by the poster and anyone can go up and chat or ask questions. I am starting to think giving a talk is easier - you can pre-plan what you are going to say. The poster presentation kinda jumps straight to the questions at the end of a talk, so you have no idea what you are going to walk into! 

I made a pdf showing the cover of my Learn C++ by Example book, and called the poster (Re)Learn C++ by Example, to emphasise it assumes some previous knowledge of C++. 

My Learn C++ by Example book cover. 
Available in various places including via my affiliate link: https://mng.bz/1aVV

I listed the chapter titles:
  1. Hello again, C++!
  2. Containers, iterators, and ranges
  3. Input of strings and numbers
  4. Time points, duration, and literals
  5. Creating and using objects and arrays
  6. Smart pointers and polymorphism
  7. Associative containers and files
  8. Unordered maps and coroutines
  9. Parameter packs and std::visit

I added a short overview of why catch up and how:
There has been a new standard every three years, since C++11.
This book didn't cover all the newer features: it gives just enough to help you catch up.
How do you catch up?
  • Write small projects
  • Command line games are great for learning
  • Focus on 1 or 2 features, and learn more than you intended
  • Have fun!

Nothing new, but it was an opportunity to chat. There were two time slots. The first had a few people turning up together, so I gave a small demo of my higher/lower card game. A nice simple program to write, which actually gives you the chance to try arrays, variants, random shuffle, and learn about comparisons via the spaceship operator. The second panned out differently. One person at a time showed up, so we just chatted. A guy asked what the difference between by ref and by value is in C++. That seemed like an easy to answer question, so I gave an answer (What would you say, BTW?). I then said "Why do you ask?" Apparently, he had been told to use pointers to speed up his code (?!) and making the change had caused a regression (code bug, not maths this time). I pointed out the difference between pass by ref and pass by value. You know this, right? What is the difference between these functions:

void do_stuff_one_way(std::vector values);
void do_stuff_or_another(const std::vector & values);
void do_stuff(std::vector & values);

The first copies the originals. If you have millions this will be slow. 
The second does not copy, so can be quicker, and the function will not change the original values.
The third does not copy, so can also be quicker, but might change the values because they are not const

Apparently this was helpful. I'm sad that someone sent the attendee down a painful rabbit hole. Here's my ProTip

If someone says "Do it this other way, it's better," ask why. Or say "Prove it." People are wrong, sometimes. 



Friday, 29 November 2024

Meeting C++ 2024

I went to Berlin again to speak at Meeting C++. The conference has been going for a while now, and has been in Berlin for 10 years. 

I first went in "before times", in 2019, because Jens invited me to keynote. I went back last year, partly for the talks but also because the conference has a friendly vibe and there is a great mix of beginners to experts, so everyone can learn something.

Titus Winters gave the opening keynote, "Fear in tech". He said he wanted us to normalise talking about feelings, and reminded us a good person is better than a good programmer. He talked about recognising and managing fear, as well as using tools to reduce fear. Tools can provide a "formal source of truth", cutting through the "It works on my machine" thing. Little things like clear instructions on how to build code and run tests make a big difference.   

He talked about "bogus productivity" and hype plus FOMO. He told us to cut through the buzzwords. Learning and understanding can be a cure for the hype cycles. Listen to his talk when it's online, it covers so much and suggests ways to do better.  


Titus' talk possibly started a background theme of "Imposter syndrome". This was mentioned by so many speakers! 

After the opening keynote, sessions ran on four tracks. One in the main room, two in smaller rooms and one online. The conference is hybrid, allowing people who can't afford the cost or time of travel to Berlin to join in. The staff, or Jens, read out any online questions at the end of the sessions, so everyone could be involved properly. 

I went to Design Patterns - The Most Common Misconceptions (2 of N) by Klaus Iglberger first. He talked about virtual functions and pros and cons of

  • The curiously recurring template pattern (CRTP)
  • std::variant
He reminded us about duck typing in C++ and concepts as alternative approaches. His impression of Darth Vader going "quack" was magnificent. You had to be there.


I went to Portable floating-point calculations by Guy Davidson next. Adding up is surprisingly interesting! Fused multiply add (FMA) got a mention on more than one occasion. My final note says "Basically, speed or precision". (With an implicit "not both.")

Next I went to Classes C++23 style by Sebastian Theophil. The main thing he reminded me was about ref qualifiers. If you had forgotten about them too, Andreas Fertig's blog explains. He gives an example returning data items. Note the & and && after the functions:

class Keeper {

  std::vector<int> data{2, 3, 4};

public:
  ~Keeper() { std::cout << "dtor\n"; }

  A For lvalues
  auto& items() & { return data; }

  B For rvalues, by value
  auto items() && { return data; }
};

This isn't a C++23 feature, but talking about classes meant a good talk with several bonus details. It is amazing how much can come from one simple title.

That evening there was a C++ quiz.  You had to be there. Code with emojis. Some memcpy and other horror. But much laughter too.

The next day started with a center keynote by Hana Dusíková called "My favorite data structures". She started simple, then said "Most of the C++ library should be const evaluable." She asked us which C++ containers are constexpr. (Clue: very few.) 


Hannah did tell us her favourite data structure in the end: a "hash array mapped trie" (HAMT). I know all the words, but putting them together gives something new, to me at least. 

I went to my husband, Steve Love's talk Testable By Design next. He started by saying he actually is an imposter! He used to do a lot of C++, but has settled on C# for a day job recently. He blogs here. His talk was about writing code for a thermostat. Another simple place to start that provided lots to talk about. He mentioned using my Learn C++ by Example book to get back up to speed with C++. I had a few copies with me, and Ivan Cukic bought one.


After lunch I went to C++ Concepts: What you should know and how to use them right by Nicolai Josuttis. He said "New feature, new bugs" near the start. He is very good at pulling out some weird behaviour, and always says "Good!" afterwards. His main example was trying to write an add function which would apply to a set or a vector. There were lots of useful points in his talk, including a reminder to use static_assert to test your concept does what you need. 

Next I went to Stories from a parallel universe by Jana Machutová. She talked about the standard library parallel algorithms. She started simple, using std::execution::par_unseq in a for_each loop. So, something like

std::for_each(std::execution::par_unseq, 
    std::begin(v), std::end(v), [](){ do(); }

for some container v and some function do. No explicit threads because clever thread management is already there for you. She then got more complicated, pointing out new algorithms, including reduce instead of accumulate, transform_reduce instead of inner_product, and partial_sum becoming either inclusive_scan or exclusive_scan. The main differences are obvious if you have a non-associative binary operator. I need to play with a few examples. She then gave a few examples for when to use  the different execution policies like par_unseq, or par. 

Herb Sutter gave a talk that evening, called "Peering forward - C++'s next decade". He covered loads, but it was late and I didn't take any notes. He did talk about C++26's erroneous behaviour though. 



We stayed up far too late after that, discussing interfaces in C++ versus C#. I was talking the next day, so maybe this wasn't the best choice! I gave An introduction to swarm intelligence algos, and had some demos embedded in PowerPoint, but they wouldn't play. I managed a few live demos at the end instead. Note to self: stop using PowerPoint. Swarm algorithms are part of machine learning. Each item in a swarm explores and tries to exploit better solutions. The whole swarm communicates and you get some kind of emergent intelligence or a solution to a problem. They aren't that hard to code and make for good practice. My first book, Genetic Algorithms and Machine Learning for Programmers, has a chapter devoted to them. 
 
I missed the very beginning of Contracts for C++ by Timur Doumler, because I wanted to drop my laptop in my room and just breathe for a moment after my talk. Timur pointed out the first contracts proposal was 20 years old. In my head, contracts has turned into a big tangle, however Timur made it seem less gnarly. If we do end up with something like a better assert, that will be great. 

There were "secret" lightning talks next. They don't show on the program, but people who had been before probably expected them. 

The closing keynote was Peter Sommerlad on "Collective Amnesia?" He talked about the things we have forgotten and some reasons why. He started with five main points. 

  1. Well known knowledge is not applied
  2. Proven practices are not well known
  3. Scientific evidence is ignored
  4. Timeless principles are forgotten
  5. Complicated stuff is favoured over simplicity
Peter said one of the reasons for forgetting is powerful men trying to make money, and he clarified he did mean men. He got a bit more general than just computing at that point :-). We also often fall for hype/new shiny. But other things have an effect too - like trying to keep university teaching materials up to date. Listen to his talk when it's online. 



We stayed in Berlin on the Sunday to explore. We went for a long walk, starting at the Tier Garden, in the West. A nice big space for a walk.


 

We started walking East back towards the hotel. We found the Computer game museum and played a variant of Pong. Yes, that's for up to 5 players. So, the computer controlled three bats. Yes, that's four controls each: left, right, clockwise rotate and anti-clockwise. Oh my!


We then stopped at the Rockcafe HALFORD back near the hotel. Someone mentioned it to us over lunch at the conference. Thank you, whoever you were. 



Tuesday, 29 October 2024

AI for the Rest of Us

 I spoke at AI for the Rest of Us last week. This new 2-day event happened in London, and wanted to help attendees understand what AI is about and how to use it, in plain language. Some talks also considered potential issues, including bias and ethics.  

The mornings had various keynotes, then the afternoon split into 3 tracks, some on Thursday and some on Friday:

  1. Back to Basics: AI Fundamentals
  2. AI in Action: Real World Stories and Lessons Learnt
  3. AI in the Workplace: Productivity Game Changers
  4. Business Strategy Meets AI: Embrace Change and Unlock Opportunity
  5. Developer Experience: How AI is Changing Software Engineering
  6. Responsible AI: Safety, Security, Guardrails and Governance

I was speaking at AI fundamentals, and tried to explain curve fitting, why it's sometimes called regression, and neural networks in under 30 minutes. A challenge, but people talked to me afterwards so I may have succeeded. 

If you don't know why we sometimes use the word regression here's a clue. Francis Galton wrote a paper called "Regression towards Mediocrity in Hereditary stature." Wikipedia has quite a good overview. He observed the heights of children and parents, and spotted they all tended towards a median value. Nothing that profound really, though there is a bias loitering in there. Anyway, the talks were recorded and my talk is now on YouTube

I have copious notes, but some highlights were Rachel Lee-Nabors reminding me of Russell and Novig's book, Artificial Intelligence: A Modern Approach. I read that when I started my PhD many years ago. I probably read an older edition but Rachel suggested the 4th edition. It covers a lot of ideas and is a great introduction if you want a good book. Rachel also mentioned Trask's Grokking Deep Learning book. Rachel's title was "AI cram session", explaining lots of details about LLMs and more besides.




Several talks tried to explain LLMs, going into various levels of detail. Ideas from embedding to attention and multilayer perceptrons were covered. These are fundamental parts of LLMs, so no surprise there, for me anyway. The talk is here.

Of course, there's more to AI than LLMs. I really enjoyed Lisa Becker's talk "Beyond LLM-Washing: When other ML models are simply better". 


She pointed out the potential huge cost of using LLMs and encouraged us to at least consider other methods, like classification or clustering, along with predictive models or anomaly detection. She pointed out using LLMs and GenAI tends to have prestige, but might not be practical. The talk is here.

I also enjoyed Lianna Potter's talk "Never Neutral: AI Development, Past, Present and Future in Anthropological Research". She describes herself as a digital anthropologist. 


 
She talked through Diana E. Forsythe's book, Studying those who Study Us. The bias that creeps in when people focus on the wrong things never stops! I've not come across this book before, but it's now on a long list of books to read. Her talk is here.

Ian Miell's talk about LLMs in the humanities was interesting. He set himself the challenge to get AI to write an essay for him that he had to write at university. He also talked through some AI history, including machines to play chess. The details of his personal project to generate an essay were relatively high level, but easy to follow. His talk is here.


I also went to Jeff Watkin's talk "Four Horsemen of the Information Apocalypse." He started by asking who invented
  • the light bulb
  • the printing press
  • the internet
These are often wrongly answered. This was a great lead in to talking about misinformation, mal-information, disinformation and non-information. He drew an analogy with a virus spreading and encouraged us to lower the r number, to stop the spread, or at least reduce it. His talk is here

I went to several other talks too, but the different afternoon tracks meant I missed many. I look forward to these turning up on the internet. The speakers' brief was to keep things understandable. That's hard if you don't know the audience, but I think the speakers managed. Some technical terms were used, but analogies or simple explanations were offered. 

I'm glad I went. I met new people and had lots of interesting conversations. Having speaker's drinks the night before meant I recognised a few people when I turned up on the first morning, which was lovely. 

You can access the recordings via the YouTube playlist. Again, they all aim to be understandable, even if you don't know anything about how AI works.

Tuesday, 24 September 2024

SoCraTesUK 2024

I attended the International Software Craft and Testing Unconference UK just outside Oxford last week for the first time. I have been aware of this for a while but hadn't had the chance to attend before. I had been to another conference which had a single "unconference" track, so I got the idea.

Before the main conference, we had a day of workshops. I ran a 90 minute session introducing C++. That's not much time to learn a language, but I think everyone managed to get something working. I walked though how to build a game of Rock, Paper, Scissors, avoiding any mention of pointers or iterators. You need to be able to handle input, output and generate random numbers, which I believe is a great way to try to learn any language. 

For the unconference, there's no fixed agenda or schedule beforehand. People chat in groups about potential ideas and pitch these in the morning, to see if anyone is interested. If someone wants to go ahead with the idea, they put the title up on a board in a slot for a specific time and place. 

What ended up happening is on their website. I didn't make all the sessions: I needed some headspace and went for a walk round the grounds or did a short gym session a couple of times. 

The first session I went to was about confidence. Harram proposed this. She hadn't been to this unconference before (nor had I), so she's braver than me. It seems an old manager told her she wasn't confident enough, so we unpacked what that might mean. I personally didn't feel it was useful or helpful feedback. It's all too easy to be confident but wrong. 

After that I went for a short wander and then attended the end of "Workplace conflict, what can ancient warrior arts of the mystic East teach us?" 


I've done some martial arts before, but wasn't familiar with the specific ones mentioned here. However, the idea of stepping to the side rather than pushing back cropped up and makes sense. I missed the beginning, so I only caught some of this. Thinking about what "stepping sideways" might mean in a discussion was useful. 

Next I went to "As freelancers, how do we decide what to spend our time on", run by Clare.  



I have been available for short consultancy this year, but have spent far too much time preparing content for things that got cancelled or getting distracted. To be fair, I have also had a book published and started another one, so I have managed to do some things. Saying "No" once in a while is a good idea. This made me think about how to make better choices next year. 

I then went to "What I wish I had known about retirement before I retired", which ended up being a bit focused on money and cashflows, simply because that's what people were asking. I shall take stock and see how I'm doing. Things seem to be getting harder for people. For example, I don't have a student loan, but many younger people do, and that makes planning more difficult. 

On Saturday I went to Seb's "BDD reboot". I have had a session about BDD accepted for OOP next year, and planned to talk about my experiences. Seb's session was a useful reminder of what BDD is really about - clue the middle D for "driven" is important. It's certainly not about slapping Given-When-Then in your tests. Many of the rooms were named after flowers, and this was, appropriately, in Rose. 



Next, I went to "Challenges when dealing with time-dependent & historical data". I had hoped someone would give me all the answers, but we just chatted through things we have had to deal with and what we tried. My examples involved reference data changing and how to maybe label versions so you get the same outputs for regression testing. Dealing with time dependent data is hard. 

There was a discussion over lunch based around "Unionizing in Tech".  Listening to the ins and outs of trying to be a union member in a large tech company was hard. I mentioned a book I read a while ago: Reorganise: 15 stories of workers fighting back in a digital age, which is about other ways people band together to support each other. 

I couldn't settle my head after that so I flitted between sessions then went for a walk. I then went to "I need 28 thoughtful / gratitude reflection style questions".  We sketched out questions that could be used in an app which checks in with you each day and shares your answers with others, maybe inspiring them too. Why 28?  So the questions could cycle around every four weeks. I'm not sure how useful we were, but things like "What have you learnt recently?" "What would you like to learn next?" etc... ended up on the list. 

The last session I went to that afternoon was Clare with "Recently diagnosed or undiagnosed autistic - ask me anything". Most people who attended were either diagnosed autistic or suspect they are. One or two were there because they have an autistic child. I suspect I might be autistic, and I wondered what difference the diagnosis had made to Clare. I nearly ended up in tears a few times, for reasons. The big thing I realised in this session was how many women were at the conference, especially compared to conferences I usually go to. 

In the evening, there were some Lightning talks, where people volunteer a short talk, for a maximum of five minutes, on the spot. All kinds of things were covered. Clare gave the last talk about how a hot air balloon ride is like an unconference. I didn't make notes, so I no longer remember who else said what. But that's OK. Lightning talks are a great way to allow people to do a little, which is less scary than a whole session.

Finally, Mervi gave an LED hula hoop performance. You had to be there.



Monday, 5 August 2024

Why I wrote Learn C++ by Example

I recently shared some details about my latest book "Learn C++ by Example".


You can buy my book directly here: http://mng.bz/AdAQ - or just go look at the table of contents. You can also buy it from Amazon: https://amzn.to/4dMJ0aG

There are a lot of C++ books, so why did I write another one? Well, many books delve into the details of a specific language version. As you may know, C++ remained relatively stable until C++11. This felt like a new language in many ways. Some things became easier, for example using a range based for loop meant you can show the contents of a container without needing to learn about iterators first:

#include <iostream>
#include <vector>

int main()
{
    std::vector numbers{1, 3, 5};
    for(auto number : numbers)
    {
        std::cout << number << '\n';
    }
}

Since C++11, there has been a new standard every three years. In fact, the code listing above is now old, because we can use std::println instead of std::cout and import modules rather than include headers. My book didn't cover all the newer features, because I wanted to give just enough to help people get back up to speed. 

My previous blog posts did show what I covered. The chapters have the following titles:

1 Hello again, C++!
2 Containers, iterators, and ranges
3 Input of strings and numbers
4 Time points, duration, and literals
5 Creating and using objects and arrays
6 Smart pointers and polymorphism
7 Associative containers and files
8 Unordered maps and coroutines
9 Parameter packs and std::visit

As I said, this doesn't cover everything. However, I think it gives just enough to help you get back up to speed if you used to know at least some C++, but haven't used the language for a while.

I have been using C++ since the 1990s, along with various other languages. I used to work in finance in London. Trying to get a position can be a challenge. Many organisations give you a thorough grilling, with a homework challenge, possibly a multiple choice "quiz"  and one or more face to face interviews. Aside from implementing linked lists on whiteboards, or spotting missing semicolons on paper printouts, you often get asked about dusty corners of the language, so many people practice and learn a huge number of details about C++. 

I did learn some Python and C# too, which meant I had to take time to revise if I wanted a contract using C++ again. Watching the language change and move would a bit overwhelming, but since I edit ACCU's Overload magazine, I was aware of some newer features I should probably catch up with. Before writing the book I found time to practice some modern C++, and started to form a list of things I knew and things I wanted to learn.

Meanwhile, I sometimes review manuscripts for Manning, and have been a technical proofer for some of their books. I noticed I hadn't seen a C++ book from them for a while. I have a copy of Anthony Williams' C++ Concurrency in Action and recently reviewed a couple of C books. I suggested the need for a short C++ book covering significant changes since C++11 and my proposal was accepted. 

People who have read my book have told me how useful it's been. If you used to know C++, and feel sad because you haven't managed to keep up, don't give up. Find one or two small things and learn those. You might never catch up with all the changes, and C++ will keep evolving. However, you can practice a little once in a while to stop yourself from going completely rusty.