CppCast - Native Languages (programming and natural)

Episode Date: April 14, 2023

Mathew Benson joins Phil and Timur. After some news on new dev tool releases and some welcome improvements to iostreams in GCC13, we talk to Mathew Benson about what it's like to learn and use C++ in ...Africa and the implications for the hardware and our choices in programming language. Mathew also draws an interesting parallel to natural languages. News CLion 2023.1 released Qt Creator 10 released Buck2 released "A leaner <iostream> in libstdc++ for GCC 13" Links Timur's three-question Undefined Behaviour survey CppAfrica on Twitter CppAfrica on Discord

Transcript
Discussion (0)
Starting point is 00:00:00 Episode 358 of CppCast with guest Matthew Benson, recorded 11th of April 2023. This episode is sponsored by JetBrains, smart IDEs to help with C++, and new releases in the world of C++ tooling. Then we are joined by Matthew Benton. Matthew talks to us about energy-efficient computing and C++ in the developing world. Welcome to episode 358 of CppCast, the first podcast for C++ developers by C++ developers. I'm your host, Timo Dummler, joined by my co-host, Phil Nash.
Starting point is 00:01:10 Phil, how are you doing today? I'm all right, Timo, or at least I am now. Just recovered from more traveling last week. Just went to Geneva to our head office there. It wasn't too far, but had an early start on Monday and very late night on Thursday. In fact, technically, it was Friday morning that I got home. too far but I had an early start on Monday and very late night on on Thursday in fact technically it was Friday morning now that I got home so yeah I've got a bit of traveling coming up so trying to get my head back into that but I'm back in the UK today. Awesome. How about yourself?
Starting point is 00:01:37 Yeah yeah I actually now you mentioned traveling I'm actually also traveling I'm actually also in the UK right now so i came here last week for a wedding of a friend uh that uh i was invited to and then next week actually is accu the conference and also here in the uk where i'm invited to speak or rather my talk got accepted so i'm speaking there um and then i thought well it's just two weeks apart. So I might as well just spend both of those weeks in the UK and, you know, visit friends and give a talk at your C++ London meetup, which is happening, I think the day after tomorrow. So things like that. So yeah, I'm actually also here in the UK. And there's also a lot of traveling coming up after that. So next week is ACCUu then the week after that i'm going
Starting point is 00:02:25 to madrid for using cpp um that's the conference organized by the university in madrid where i'm also speaking and actually the week after that i am going to stockholm where they invited me to give a talk at the cbs stockholm meetup um on the 3rd of may yeah wednesday 3rd of may i'm giving a talk at cbsl stockholm actually it was funny um they kind of um they did like the meetup.com page which i think they're going to be putting online i guess as this episode goes uh online as well and they have like a picture of like the people uh the stockholm people kind of hanging out and like in the first row i i spotted you actually sitting there so you must have been there at this meetup at some point i have yes yeah yes yes yeah so yeah and in fact next month i'm gonna be in um oslo and copenhagen so i think between the
Starting point is 00:03:18 two of us we're covering scandinavia yes that's funny um yeah so um, so at the top of every episode, I'd like to read a piece of feedback. And this week, we got a piece of feedback on Reddit by A Block in the Chain, who was saying, the host spent a lot of time talking about C++20 support in LLVM16. I guess that refers to the last episode's news section. I wonder if they noticed that libc++ had a major C++ 17 update by adding polymorphic allocator support. They're almost done with C++ 17 now, which is a major milestone. Indeed. Well, yeah, thank you, A Block on the Chain, for pointing that out.
Starting point is 00:04:00 We did not mention that. But yes, certainly true. It's a major milestone. We talked, I think, a lot about C++20 and C++23, but it's worth mentioning that C++17 support is going to be pretty much complete. That's a great milestone. Actually,
Starting point is 00:04:15 specifically the polymorphic allocator support. That's a big one. Both GCC and MSVC have supported it for a while, but Clang hasn't. And so actually at Cradle, which is the music tech company that I co-founded a few years ago,
Starting point is 00:04:30 we actually rewrote the PMR memory resources and all of that for ourselves, specifically because Clang didn't have it and we are compiling on Clang among other compilers. So we actually had to implement all of this ourselves. So it's good to know that we can now throw out that code and use the Clang version. Although I think it's not yet coming to Apple Clang anytime soon.
Starting point is 00:04:56 So we'll probably keep that code around for a little bit longer. So there's one more thing I would like to mention. So I was actually recently listening back to the very first cpp cast episodes uh by rob that was actually even before jason then joined him as a co-host like the first few episodes of cpp cast ever and that was actually quite an interesting experience for many reasons but one of the things i remember is that at the eighth episode uh rob said it was actually a major milestone that we reached the eighth episode because actually 90 of your podcasts never reached the eighth episode so if you make it to your eighth episode then you made it
Starting point is 00:05:34 basically and and so i actually noticed that today's episode is the eighth episode where you and i are the hosts right so yeah we made it to the eighth episode, so there's a good chance we're going to keep doing this, I guess, if you believe the statistics. So that's very exciting. We'll leave it at that, or we should quit while we're ahead. Right. We're not going to do that.
Starting point is 00:05:58 We'd like to hear your thoughts about the show. You can always reach out to us on Twitter or Mastodon, or email us at feedback at tppcast.com. Joining us today is Matthew Benson. Matthew is a graduate computer scientist. He's an entrepreneur and lives in Nairobi, Kenya. Matthew has been working with and researching on computers and programming and how to practically apply it well for several years, still learning and enjoying the journey. He has worked with several languages over the years, including Java, PHP, C Sharp. And after all that, he has found that he has just
Starting point is 00:06:29 loved C++ the most. Matthew is passionate about energy efficient computing and making the most out of hardware using the right software. Matthew, welcome to the show. Thank you very much. Thank you for having me. You're very welcome. I did have one question about your your bio there and this is going to sound like a trick question it's really not but but i noticed you listed a few other languages that you've used other than c++ and they're all non-native languages given that we're going to be talking about energy efficient computing i was wondering if you have actually tried any other native languages like rust or any of the others to get a comparison.
Starting point is 00:07:07 Yes, I have looked a little bit at Rust. I've been learning C++ for much longer. It's taken me quite a while to get familiar with the language. I'm still learning. We all are. Yeah. So Rust is something I plan to look at a bit more. But I just find that I'm very comfortable with C++ at the moment.
Starting point is 00:07:29 Yeah, I think I'm in a similar camp. I've not seriously looked at Rust yet, but everybody's telling me that I should. So I think we're in the same boat here. All right. So, Matthew, we will get more into your work in just a few minutes, but we have a couple of news articles to talk about. So feel free to comment on any of these if you like. Okay. All right. C-Line 2023.1 got released. So that's the C++ IDE made by JetBrains.
Starting point is 00:08:08 And there are quite a few new features there. The one that I find personally the most exciting is disassemble on demand. Where basically now you can, yes, you can now, when you're debugging your C++ code, switch to kind of disassembly view and kind of look at the disassembly and all the instructions. And you can have both the code and the instructions open
Starting point is 00:08:28 in two separate windows and step through both of them at the same time and kind of follow each other. And it's really cool. I actually recorded a video on this, and we're going to have a blog post about this, I think, later this week. We also got support for QML. So you get code highlighting, code completion,
Starting point is 00:08:44 quick documentation, kind of everything else you need to work efficiently with QML. So you get code highlighting, code completion, quick documentation, kind of everything else you need to work efficiently with QML. There is now integration with VC package. There's better support for C++ 20. There's many things, like, for example, there's now an action to create a new C++ module interface unit and other things like that. Yeah, so that's that.
Starting point is 00:09:01 That's pretty exciting. Yeah, I just want to say what I said, finally there for the disassembly on demand, because C-Line got support for disassembly if you don't have the source file. Quite some years ago now, when I was still working there, and we were constantly getting questions
Starting point is 00:09:18 about when are we going to get disassembly on demand? It was always coming. So finally it's there. Yeah, it took a while to do, but yeah, now finally you can do it. finally it's there. It took a while to do, but now finally you can do it. If it's just in the debugger, you can just right-click on the debug frame, and it's going to take you to the
Starting point is 00:09:31 disassembly. And yeah, you're right. Previously it wasn't there if you have the code. It was only there if you were debugging a binary or something. So yeah, it took quite a lot of effort to actually implement that, but I think it's working really well. Great.
Starting point is 00:09:48 And Zline actually is not the only IDE that got a major new release since last time we recorded an episode. The other one is Qt Creator. Qt Creator 10 got released, I think, actually on the same day as Zline 2020.1, if I'm not mistaken. Synchronicity. Yes, and they also have quite a few new features. actually on the same day as ZLine280.1, if I'm not mistaken. Synchronicity. Yes. And they also have quite a few new features.
Starting point is 00:10:07 So Qt Creator now has been updated to LLVM 16. They've updated their code model to Qt 6.5. They have quite a few CMake improvements. So, for example, now they support CMake format and other custom CMake formatters. They've updated support for CMake presets to preset version 5. One thing that I also found interesting,
Starting point is 00:10:30 they now support remote builds and remote run targets. It said when building on a Docker device, so my understanding is that it's only in that case, but maybe I misunderstood that. But yeah, it also says you can now directly browse the file system on a remote target directly in the IDE,
Starting point is 00:10:48 which is kind of cool. And yeah, there's a lot more features. So there's like a full feature list on their website, which you can view if you click on the link in the show notes. Looks like a solid release. So actually another release also that has to do with tooling really drew my attention. And I'm really curious what you think about this.
Starting point is 00:11:09 So Meta, previously known as Facebook, actually now released a new open source large scale build system. So apparently we don't have enough build systems yet for C++. It's called Bug2. It's publicly available on github.com slash facebook slash bug2 and it's a from scratch rewrite of bug1 which i think is their previous build system and its unique selling point is that it's fast they say it's twice as fast as bug1 um they don't directly compare the performance to kind of other build systems,
Starting point is 00:11:45 but kind of between the lines, what I see is that they kind of say it's faster than other build systems. Interestingly, kind of re-architected the whole thing. There is now a complete separation of kind of the core of the build system and the language specific rules. So that gives you increased parallelism. They have integration with remote execution and virtual file systems. They redesigned the console output. The other interesting thing is that the
Starting point is 00:12:10 build system core is actually written in Rust. And that seems to be kind of independent of the language that you're trying to build with it. And so the language rules, like for example, how to build C++, they're actually not written in Rust, they're written in yet another language called Starlark, which I was not familiar with, but I looked it up. It's yet another programming language inspired by Python 3. So yeah, very interesting architecture there.
Starting point is 00:12:36 There's a single incremental dependency graph which is actually different from Bazel, which has these build phases. And they say that architectural choice eliminates many types of bugs, increases parallelism, makes it faster, et cetera, et cetera. So, and one other thing that I found remarkable
Starting point is 00:12:52 looking at bug two, when you compare it to like Blaze and Bazel, for example, they say that bug two is pretty much identical to the version that they use internally at Facebook as their build system. It's basically only two things that are different, like the tool chains, basically their internal version points at their internal copies of their compilers, and the remote execution kind of points at their internal service.
Starting point is 00:13:16 So those two things are kind of instead using open source alternatives in the public version, but everything else they claim is the same. So I think that's really interesting. So what do you think about yet another large-scale build system for C++ and other languages? Well, my first thought when you said that it was twice as fast as BAC 1 was that they've really passed the BAC here. It wouldn't be a CppCast episode without the classic kill joke.
Starting point is 00:13:44 But this is really interesting, because it's definitely like a second generation build system. And that's interesting because it gets a chance to have a clean slate, but also learn from all the good stuff. Not that this went into Buck 1, but also it seems to be very heavily derived from Bazel as well. And a lot of stuff from there, as well as other build systems, but those two in particular. And they are two sort of fairly well thought of build systems that have had a lot of engineering effort over the years. So interesting to see where this goes.
Starting point is 00:14:14 I've not tried it yet, but it looks promising. Like the fact that it's written in Rust as well, whereas the previous one, I believe, was written in Java. And the language rules were also written in Java. So separating those things out also seems like a good idea. So definitely interested to see where this goes. So just a quick question. I actually have never heard about BAC1.
Starting point is 00:14:39 So when they say it's twice as fast as BAC one. I have no context. But would you say that buck one and two are comparable to ninja or simic? Where would you say it falls? I'm personally not familiar enough with them two to say for sure, but I would say, from the little I do know, probably slightly closer to Ninja, in that it tries to work out everything it needs to build first so that it can parallelize the most,
Starting point is 00:15:09 and I think that's one of Ninja's strengths, from my understanding. I don't know if you know any more than that, Timo. No, I actually also have not heard about Bug1 either before this, I have to admit. So, yeah, maybe we can do a little bit of research and follow up on that in a later episode. Yeah, so if anybody out there knows for sure, do let us know. We'll give it a feedback in the next episode.
Starting point is 00:15:34 Right. And so the last news item that caught my attention this week was a blog post on the Red Hat website about another major compiler release that's actually not yet happened, but it's coming up, GCC 13, which is going to be released in May. And so this blog post was about a particular improvement that they've done
Starting point is 00:15:55 for GCC 13, and in particular for Libs.gcc++, which is the standard library that comes with GCC. And I'll have a linear IO stream in there. So they say it's one of the many enhancements that's coming to Libs.gcc++ with GCC. And I'll have a leaner IO stream in there. So they say it's one of the many enhancements that's coming to Libsys C++ for GCC 13. And it's a much better IO stream header. And obviously because
Starting point is 00:16:12 IO stream is probably one of the most or maybe the most commonly included header probably in a C++ program. I think that's really interesting that they actually managed to improve it after all these years that we had Iostream or decades that we had Iostream.
Starting point is 00:16:29 So basically what they did is they changed the way the initialization of the standard stream objects works. You know how you have std cout, std scene, they're kind of like these singleton objects. And so previously what they were doing is they were doing it in kind of a global constructor that gets compiled under every single object file that you're compiling.
Starting point is 00:16:50 And now it's going to be just one of them kind of in a shared library. So this reduces the binary size, this improves link times, it improves startup times. So any C++ program that uses Iostream a lot should actually see those benefits. And I thought that was really interesting that after decades of Iostream kind of being a thing in GCC, they kind of still go back and re-architect it and improve it
Starting point is 00:17:15 and going to see the benefits of that in the new GCC. So I thought that was really interesting. That is interesting because Iostream is quite a big dependency quite a big template and you not only have to instantiate the template in every translation unit that that includes it but um but also then the linker has to deduplicate all of that as he just said so um two two places where you got a lot of extra work. And it seems like an obvious thing to say,
Starting point is 00:17:45 well, let's just do that once. But I think there were complications in being able to do that, that this was somehow overcome. And I haven't looked into it to see exactly what they've done there. But I'm guessing there might be some uses of extern template and things like that
Starting point is 00:17:58 that we didn't have in the early days. Did you look into that anymore? No, I just read the Red Hat blog post. I didn't actually dig into what they've done kind of on the early days. Did you look into that anymore? No, I just read the Red Hat blog post. I didn't actually dig into what they've done kind of on the code level. So I'm not sure. What I was curious about as I was reading through this is, I mean, I've really been waiting for GCC 13.
Starting point is 00:18:20 I really cannot wait because I do write a lot of code that I try to use as many compilers, try to be as portable as possible. So sometimes, I mean, I've been trying to use the format library and it's one of the reasons I'm waiting for GCC 13 to be able to now use the format library and be portable, you know, the MSPC and Clang.
Starting point is 00:18:44 But now I was thinking about the optimization on Iostream, and I was thinking about it because I had previously tried using Iostream as a pre-compiled header. Is it pre-compiled? Yeah. The module, the pre-compiled module. Oh, the module binary interface or something like that? BMI, yeah.
Starting point is 00:19:10 BMI, binary module interface. Yeah, that's it, BMI. Yeah, yeah. So I was working with a computer that's a little bit slow. So, I mean, I'm a bit familiar with, you know, this, like, you want to go faster, you know. So I was thinking about if GCC 13, I mean, what they have done in GCC 13, will it be available when you're compiling with C++ 11, 17, 14? There's something I was thinking out loud, wondering. Oh, yeah, yeah. just something I was thinking out loud wondering if because you see the
Starting point is 00:19:45 module feature is only available from C++20 so it's just something I was thinking out loud whether that this would that this would be beneficial in those cases where especially for those who use the compiler out of the box
Starting point is 00:20:01 I think the GCC 12 defaults to C++ 17, if I'm not wrong, or 14. But GCC 13, if on its default setting, if we're talking that, if we say that it will be on C++ 17,
Starting point is 00:20:20 then I think that's where most of the improvements will come in with this release. So specifically for the iOS stream thing, I don't remember any mention of modules in that blog post. So I think they're going to backport that particular optimization to earlier versions of C++. But obviously, I don't know about other features. Yeah, I don't know either. My guess is that there's some external template in there
Starting point is 00:20:45 would limit it just only back to c++ 11 so that should be fine okay um so i don't have any more news items here but i have one one thing that i'd like to mention so actually phil at your uh you have a conference coming up in in july do. CPP on C, yeah. And I'm very happy to actually be able to give a talk there. So I'm going to be giving a talk about safety in C++. This is a hot topic that we've discussed quite a lot on the show as well. And for this, I'd like to do a little bit of an experiment. So I want to collect some data about what people think about particularly undefined behavior in C++ and whether it's an issue for them.
Starting point is 00:21:29 So I put together this like very small questionnaire, which only has three questions about basically UB and C++ and what it means for you. And so if you want to help me, it would be amazing if you could go to that questionnaire and the link is going to be in the show notes and answer those three questions uh one of them is actually optional so you only really have to answer two questions and yeah that would help me a lot with collecting data about what people think about this and then hopefully i can present the results at the conference so yeah please help me out yep that sounds great if you don't want to do it to help team up do it for science that this will help us get a better idea of some of the questions we've been asking about safety in C++. So, yeah, please fill out that two slash three question survey. All right.
Starting point is 00:22:16 Thank you so much. Well, with that, we're coming to the main part of the show. Matthew, welcome again to the show. Thank you. And thank you so much for taking the time to be our guest today. Thank you for having me. Tim, we just mentioned that he's speaking at C++ on C, but Matthew, you're speaking at C++ on C as well.
Starting point is 00:22:34 Yes, I am. And in fact, you've got to talk, what's it called, C++ in the developing world, why it matters. Do you want to tell us about what that talks about and why that might be interesting? Okay. So I'd like to go back, I mean, to talk about the background of this talk. This talk actually came, or rather, you know, this is my first time actually speaking or even thinking about speaking. And the idea behind this came from a conversation I was having with Jason Tanner.
Starting point is 00:23:08 I spoke with him, I believe it was November of 2021 or December 2021 or thereabouts. And we ended up talking because he happened to have visited Kenya. And I think in his visit, he happened to be speaking with some people. They didn't know who he was. So they were just, you know, having conversation that, you know, he mentioned that he talks about, he teaches the C++ and they're like, you know, what's that? And of course he tried explaining what it is that he does. It's the programming language. And so as a result of that, he reached out on Twitter and said, OK, fine. Is there anybody who follows my show on Twitter?
Starting point is 00:23:56 And I responded. So we got to talking. And as we were talking, we explored a few different topics about language, about, you know, his experience teaching, about the complication of, you know, how do you introduce C++ to somebody who's never heard about it? And as a result of that, you know, we kept on talking on and off. And his talk last year, I happened to have had a little bit of input and i was quite happy you know like this being in the background i don't even remember it was you know he came on stage and yeah he did this skit you know like trying to communicate without actually using words hard to forget that one yeah ah yes so yeah i I mean, I watched that and I was quite happy and I was pleased with myself.
Starting point is 00:24:49 I thought, yeah, my work is done. I don't think, I mean, if ever, I mean, I'm sure Jason will reach out or I'll talk to somebody and they'll present the ideas for me. So what happened, I think, last year, december i believe that it should have been about the time you started now this show just before i think yeah yeah yes that was around christmas yes yes he reached out on twitter and said um i mean i'd like to hear from c++ africa so i mean i i i saw the tweet then he kind of like reached out to me personally and said, I'd like you to give it a try. Here's how to do it. And for me, I've been watching these shows quite a while. In fact, I've watched a number of your talks for quite a number of years and it
Starting point is 00:25:37 never really occurred to me that one day I could be, you know, speaking. and now I found myself in this position of like oh okay I have to now speak myself I have something to say I seem to um I have a bit of experience my experience is a bit different so that's what made me I mean with my proposal I just put in my thoughts and I was accepted. So here we are. I'm really glad that you did. Yeah. So what's the talk actually about? Because it talks about the developing world, but I think there's a little bit more to it than that, isn't there?
Starting point is 00:26:16 It's about, you know, when we talk about the developing world, I mean, I use that term because it's a commonly used term. You know, we're talking about countries that are less developed. But I know sometimes that tends to be, I'll say, misinterpreted. People have a different definition of that. So I wanted to talk about it and to clarify certain things. I mean, I know there are people who would imagine that we don't have computers where we're from and what have you. And it's true that there are people who don't have,
Starting point is 00:26:51 but there are people who are exposed and I mean, who are the great developers, many who may not speak out, but what you find is that there's a big rift. So as I was thinking about that rift, even based on the conversation we're having with Jason, is how to bridge the gap. Having listened to even the two of you over time, I realized that, you know, I put myself in the position of, there's this saying that if you want to learn something i mean it's go go to a place where people are smarter than you and learn from them and listen to them and you know you'll kind of like pick up and and keep up with them so as i did that i mean i have learned
Starting point is 00:27:39 a lot of learned a lot from your talk phil about about how to do testing in C++. I happen to have done it in test-driven development with XUnit in C Sharp. I did quite a number of tests, some badly written, some well-written, and I was thinking about my development and looking ahead, I could see that, yes, there are people ahead of me, but I'm now in a position where, yes, I may not be perfect, but there are people who may be now looking up to me. So I took that as a challenge and said, okay, fine. I will speak about what it's like, what it's been like for me learning and also try to bring the perspective of those who are from my country, like what, what it's like learning and you don't have a computer. Like how, how can you, you know, how do you bridge the gap? How do you kind of like catch up? And also on that, on that note,
Starting point is 00:28:43 there's something that came to my mind as I was listening to Timo's talk this year I believe or last year how C++23 changes the way that we code there's this bit in the beginning where you
Starting point is 00:28:59 show these pictures of the C++ committee and you point out that okay I wasn't in the initial one, but I happened to be in this later one. So it got me thinking about transition, because that's actually one of the things I do really appreciate about C++ is it's an old language, but it has survived through many iterations, many generations. And sometimes you have to take a step back and look at
Starting point is 00:29:33 that transition. That's actually one of the things I find is very rich about it. Seeing what people used to do, seeing what my generation is doing and actually now realizing that there's a generation coming after me and they may not understand some of the difficulties. You know, somebody who grew up with Windows 98 may not understand what it was like trying to, you know, get working in Windows 3.1 and even before that. So that's basically the kind of lens I want to talk about, what it's like learning how to develop, actually developing, and thoughts about how to teach.
Starting point is 00:30:16 How do we keep the language alive? How do we have the next generation of people attending committee meetings and what have you. Yeah, that's kind of like the background of the talk. That's kind of like where the idea came from. So it touches on learning, tooling. I know we talked about a couple of IDs, C-Lion, Qt Creator. And personally, I use NeoVim.
Starting point is 00:30:50 And I try to be on the console a lot of the time, partly because there's a situation I had where there's a computer that I bought, which is actually even the heart of all of this. It's a pretty... I bought it in is actually even the heart of all of this. It's a pretty, I bought it in 2013 and it was like a netbook. And for a long time, that was my computer. That's what I would use. And so that got me thinking, like, no, as I'm working with this machine that is, would
Starting point is 00:31:24 be considered extremely slow. Not many developers would use it, but I found that pushing it beyond its capabilities, making it work was something to do with software. I mean, it's the power of software, the power of C++, so to speak. And even on that note, I mean, Qt like, it's the power of software, the power of C++, so to speak. And even on that note, I mean, like Qt Creator is a wonderful IDE because of that. I tried MSVC, but MSVC I appreciate is,
Starting point is 00:31:57 it's designed, okay, the target user, maybe somebody with a big desktop, you know, the corporate environment. And when I was looking at what I was going through and what I observe around me, it got me thinking that, you know, there is a gap. There is something that maybe may not, I mean, not many people have talked about. So I'll try and give it a shot. That sounds like a really, really interesting topic. So would you say that you teach C++ differently or you use C++ differently as well
Starting point is 00:32:29 when you are constrained by this kind of older or more limited hardware? And if so, in what ways? Okay, I don't teach it per se. In fact, it's something I'm trying to figure out. Now that I've spent all this time reading and learning, I'm trying to figure out, okay, now that I've spent all this time reading and learning, I'm trying to figure out which way to go. But I'll say that what happens is that, especially from my observation,
Starting point is 00:32:53 like when I go out to the market and I'm looking at the computers on the market, it's with older hardware that you get to appreciate the improvements with software. For example, we're talking about iostream before. And the improvements that are being made. And you find that when you're on an older platform, that's when you feel the improvements a lot more. Like software catches up with the hardware. And yeah, so that's where you feel you
Starting point is 00:33:28 actually feel the benefits when when something is designed better i hope that makes sense yes one thing that you said earlier that i found particularly memorable is actually the way you framed things is you're talking about uh people being ahead of you yes or you being ahead of people and we often say that you know maybe people are above you yes you know they're at a high level that they've already reached some some status yes and sometimes that can make it seem unattainable yes but by reframing it as being ahead or behind it's like you you're on the same path yeah to some people a bit further ahead and then that also gives us a role to maybe like help the people that are behind us
Starting point is 00:34:11 the way that we've been helped by the people that are ahead yeah so we're all in this together yes i really like the way that to you uh you framed that uh around all of this right so actually now that we touched kind of on learning and developing and being on this path, maybe we can also look at kind of the beginning of this path. So you mentioned that you got into C++ at some point after having tried a bunch of other languages, and this has kind of ended up being your favorite. I wonder, how did you get into C++ specifically, and what do you like about it? Well, I'll begin by framing this. Actually, there was a question Jason actually tweeted. I believe it was last week or last week, but one, asking what language did you do your coursework in?
Starting point is 00:35:03 So when I was in university, Java was like the hot language. And so the lecturers would come and say, yes, Java, you must use Java, you must use Java. And I did try it, but as I
Starting point is 00:35:20 was reading, and I'll say, when you're trying to come up with something practical, when you're trying to, I'd always hear about C++. I'd always been curious about C++, even though the coursework was Java. And I remember all through university, I was really curious about this concept of inheritance and how we map the real world to programming and what have you. So yes, Java was kind of like my gateway into the whole inheritance and polymorphism and all of the object-oriented principles.
Starting point is 00:36:10 But I knew in the back of my mind that there was a language called C++ that, yes, it's the pathway to, if you wanted to program with graphics, you know, you need C++. You need C++ to do games or you need C++ to draw on the screen and and and the like so i i think i'll i'll kind of like liken it to the way that you know we we kind of like look at rust you know you hear this rust there's this language called rust you kind of like look at it from the window and and uh you know peep you keep and what have you grass is always rustier on the other side. Yeah. Yeah, so that
Starting point is 00:36:49 kind of like happened for a while. At some point, I did transition to C Sharp because I was on a Windows machine and it's, you know, they say that it's easier to learn C Sharp. It's faster to learn C Sharp.
Starting point is 00:37:06 But if you want performance, then you branch into C++. So I did take that pathway as I was learning C Sharp, learning the Windows system. I would always peep into C++. And as time went on, I've just been reading, reading, you know, just consuming content and just reading books, you know, learning, relearning. I found that I liked that C++ is, it's the go-to language when you actually want to get something done well and also in a portable way.
Starting point is 00:37:48 You know, just also that pathway i've like throughout my computing life i've always been in this divide between linux and windows you know the dual booting you know bit of linux bit of windows bit of linux bit of windows and that's where i i will now have the problem with ASC. C-SHOP is nice on Windows, but once I go across, it's not there. And actually, I did try at some point, as I told you, I was learning test-driven development. So I was doing the cutters and the practicing and what have you. There was a time I forced myself to work on Linux. So there's, you know, there's a C-sharp, I mean, now the.NET, around that time.NET, you know, kind of like brought up the portable, the portability
Starting point is 00:38:37 aspect, but not the UI. The language itself was available, but not the UI. .NET Core. Yeah,.NET Core, yeah. So I would work. I was doing the CAD. I actually forced myself out of the graphical environment, and I was on Linux, and I was using.NET Core to do the test-driven development. And I hacked on that for quite a while,
Starting point is 00:39:04 but because it's limited, development. And, you know, I hacked on that for quite a while, quite a while, but for some, I mean, it's because it's, it's limited, you know, like even on Linux, I couldn't get, you know, to do certain things. So I'd always had this itch, like, I want to be able to do something once. And I wanted to do something in a portable way, not having to write one way and, you know, keep on going back and forth. So that's what made me really love C++. Basically, it's the same language and it's, you know, it's, it's like a common language. It's actually something that I wanted to talk, to touch on, even in my talk, that it's, it's like English, you know, it's, it know, it's that common language that no matter where you go,
Starting point is 00:39:49 you might find somebody who at least speaks a little bit of English. You may be able to get through, you may be able to communicate and get your point across, even if their English is not perfect or your English is not perfect. It's a common ground.
Starting point is 00:40:06 It's an established common ground. So that's what I really love about it. So I'm now, I think I've reached that point where now I've left C-Shop behind, left PHP and, you know, the web languages. And I love that. I love having C++ as the foundation. Then, you know, like branching. And I love that. I love having C++ as the foundation, then, you know, like branching in only when I need to. You know, like for Windows,
Starting point is 00:40:32 I mean, the ability to just tap into the, like the Win, there's Win32 library, but then there's a newer one where, I mean, that's based on the Windows runtime. As in, it's possible to have the same logic, but you're able to tap to connect it from different operating systems and the like. So that's
Starting point is 00:40:52 been my story, my approach. Well, we'll talk a bit more about that in a moment. Hold that thought, because this episode is sponsored by Sonar, the home of clean code. Now, Sonar Lint is a free plugin for your IDE and helps you to find and fix bugs and security issues from the moment you start writing code.
Starting point is 00:41:10 But you can also add Sonar Cube or Sonar Cloud to extend your CI-CD pipeline and enable your whole team to deliver clean code consistently and efficiently on every check-in or pull request. Sonar Cloud is completely free for open source projects and integrates with all of the main cloud DevOps platforms. Okay, so we're back here. Matthew, I would like to touch upon another subject.
Starting point is 00:41:36 So you said you are based in Nairobi, Kenya? Yep. Actually, by the way, I was actually there last year. I had a great time. I had the privilege to visit Kenya. It's a beautiful country. I'm hoping to be back there soon. You're welcome.
Starting point is 00:41:50 But I actually didn't, I wasn't there on business or I didn't do anything C++ related and I didn't meet any C++ people. So I'm actually really curious now, what is the community, the C++ community like there? Like in Kenya specifically or in Africa more generally? Is there anything that you can talk about where it's maybe different from kind of the C++ community in Europe or the US?
Starting point is 00:42:15 So is there anything you can say about what the C++ community is like where you live? Okay. I'd like to say that, I mean, I remember even as I mentioned, when Jason asked, you know, any C++ developers, I was kind of like hoping to see,
Starting point is 00:42:34 oh, you know, maybe find a few other people. I'm sure there are other people, you know, but I think most people it's that, you know, they're kind of like quietly learning or reading or hacking by themselves. And part of, like I said, you know, the challenge to speak,
Starting point is 00:42:53 to get out and speak, I, I found that somebody had started a C++ Africa discord server and they actually did approach me. They said, okay, we've seen your Twitter profile. We'd like you to come and help us to build a community. So I've actually been quite active with that this year. That has been, you know, kind of like my way of putting myself out there. You know, this has been the year of getting out of my shell, getting out of my office
Starting point is 00:43:28 here where I usually just read and hack and, you know, just do my own thing. And try and share what I'm doing, my struggles, and, you know, even from the few discussions we've had on the Discord server. I mean, it's
Starting point is 00:43:44 quite encouraging to see that, you know, you're not alone. You're not, you know, sometimes when you find, I think we've all been at that point where you're trying to track down that off by one error. And, you know, you're scratching your head wondering, is it something wrong with me? Am I the only one who doesn't know how to code and everybody else knows? So even hearing that other people have gone through the same thing has been encouraging.
Starting point is 00:44:12 And so I've made a conscious effort to just speak when I can speak, be out there, put myself out there. And hopefully other people will come out of their shells because I'm sure they're out there. And for those who are learning, I mean, hopefully they will gain something from me as I have also gained from those I have been watching for quite a while now. Yeah, so I've actually seen this C++ Africa server. I'm actually on that server too. Not super active kind of on a day-to-day basis,
Starting point is 00:44:44 but occasionally I have a look what's going on there. Yeah, I got very excited when I saw on Twitter that they're launching it. I think it's a great way to bring people together. There are a couple other kind of online communities like that kind of in the SuperSus world, but it's good to see an Africa one. And we did mention it on the show earlier.
Starting point is 00:45:04 And I really hope it continues to flourish and attract more people i think that's a great great way to build a community yeah yeah i'm on that discord as well and similarly i just dip in from time to time and have a look and it does seem to be a very engaged community i have a lot of fun there's regular quizzes and things like that so yeah if you uh if you are in in africa or even if you're not you're just curious i do encourage you to to join in and see what that community is like yeah so is there anything else you wanted to talk about today matthew um okay i think i'll i'll just kind of like highlight the challenge I felt this year to just speak, to step out and show people that, I mean, it's, you know, sometimes you can be too self-conscious. You don't want anybody to see your code and you may feel I've got so much bad code in my computer. I don't want anybody to see it.
Starting point is 00:46:03 And I think, you know, I've been thinking deeply about it. And one of the things that occurred to me is, I mean, one of the beauty of especially the C++ language and is its community. How it's developed and how it tries to incorporate as many views as possible. And I think I've seen that there are a few criticisms of the language, but I just wanted to highlight that it's that, I mean, that, that, that coming together that makes it beautiful. The fact that it has bits and pieces from, you know, the nineties, the two thousands, that is its beauty. I didn't get to, you know, to delve so much into it, but I've really been
Starting point is 00:46:52 thinking, I mean, trying to draw parallels with human language. And you see, for example, like the English language, yes, it's, there is English spoken worldwide, but if you really look at it, it tends to be, I mean, each place has its own kind of like dialect, accent, and that actually forms the beauty of it. I'll also draw parallel with the country, my country. One of the things about this country is that it's, though it was a British colony and now it's independent and i think now we're trying to figure out our own way what you find is that there are many tribes and many languages that were kind of like put together and yes english
Starting point is 00:47:42 and kiswahili tried to be the i I mean, they tried to be the common language, but you find that you can't push, you can't, okay, even if you try to teach people English, you'll find that as you're teaching, you're also learning, you have to learn the language that the other people are speaking. So then in the end, you end up with some kind of, some mixture. That's why you find, I mean, in Nigeria, we have the Pidgin English. It's English, but not quite English. It's mixed with their dialects. In Kenya, we have our own slang and even different areas have their own slang.
Starting point is 00:48:17 But it's important to not lose sight of the common, that which at the very least helps you to start a conversation or helps you to form something new, so to speak. And I think many languages have been formed like that. Actually, Swahili is a mixture of the Arabic language, a bit of Portuguese, and now the native languages. And language evolves. It's a mixture or it's a coming together of different people. And you find that when the community comes together,
Starting point is 00:48:56 there may be different dialects and different, you know, we talk about the GCC, I mean, there's Lib Standard C++ and the Lib C++ and the MSVC. Yes, there are different flavors, but the common ground is also very important because it helps to act as a bridge. So it's something I hope to really get across even in my talk. It's something I've really been thinking about,
Starting point is 00:49:23 and even as I explore different languages, I've been trying to learn different languages and I find it interesting that, yes, there's a lot of commonness in humanity, but the languages, I mean, the blending of languages, it creates something that may not look perfect, but if you look beyond, you see another layer,
Starting point is 00:49:46 especially the glue that holds things together. So I just wanted to add that as one of my main motivations of why I think C++ should, you know, the community should thrive, why we should try to keep it going, so to speak. That's a really beautiful way of looking at it thank you for that matthew to paraphrase bianna strastrup there are natural languages that everyone complains about and there are natural languages that nobody uses yeah yes okay well i think we are about time to to wrap. Is there anything else you wanted to tell us before we let you go, Matthew?
Starting point is 00:50:28 Now that I have your attention, I mean, you know, being on this other end, I mean, having watched your talks and, you know, several, there are a couple of talks that I just wanted to just mention. I've been very, very instrumental and, you know, talks that I do recommend for, whenever i get the chance i really like your talk phil on um cpp con 2020 on unit testing oh yes there's a talk uh you did give i think you probably from your house and that's that that foundational knowledge in unit testing i I really loved that. That talk has been very instrumental,
Starting point is 00:51:06 especially transitioning from the X unit and translating that into the C++ idioms. Thank you. And Timo, there's a talk, I think it was from a while back, 2016, I believe. How, I can't remember the title. Or was it the hardware one yeah the hardware one
Starting point is 00:51:26 want efficient code learn your like don't you know your hardware yes learn your hardware yes yeah that was quite a while ago
Starting point is 00:51:33 yeah yes yeah I mean those are those are really really beautiful talks that I keep on you know I actually have them you know
Starting point is 00:51:39 I always go back to them whenever I'm trying to formulate you know trying to you know see where I'm going and what have you. Yeah, so I just wanted to mention that now that we're here. Thank you very much for your feedback. Thank you.
Starting point is 00:51:55 You're welcome. Good to know that they've reached you. Yes. Yeah. Do you want to let people know where they can reach you if they're curious to get in touch? You said you're on the C++ Africa Discord? Yes, I'm at Benson Orina.
Starting point is 00:52:12 That's Benson O-R-I-N-A on Twitter. And I forget the Hakidam. We're going to put it in the show notes. Oh, yeah. Okay okay that'll be great okay yeah all right well thank you very much again for joining us today yes thank you
Starting point is 00:52:31 thank you and thank you so much for listening in as we chat about C++ we'd love to hear what you think of the podcast please let us know if we're discussing the stuff that you're interested in. Or if you have a suggestion for a topic, we'd love to hear about that too.
Starting point is 00:52:51 You can email all your thoughts to feedback at cppcast.com. We'd also appreciate it if you can follow CppCast on Twitter or Mastodon. You can also follow me at timur-audio on Twitter and at timur-audio at hackydjam.io on Mastodon. And Phil at Phil underscore Nash on Twitter or at Mastodon at philnash.me on Mastodon. And of course, you can find all that info and the show notes on the podcast website at tppcast.com. The theme music for this episode was provided by podcastthemes.com.

There aren't comments yet for this episode. Click on any sentence in the transcript to leave a comment.