Algorithms + Data Structures = Programs - Episode 105: Jason Turner from CppCast! (Part 3)

Episode Date: November 25, 2022

In this episode, Conor concludes his conversation with Jason Turner!Link to Episode 105 on WebsiteTwitterADSP: The PodcastConor HoekstraBryce Adelstein LelbachAbout the Guest:Jason is host of the YouT...ube channel C++ Weekly, co-host emeritus of the podcast CppCast, author of C++ Best Practices, and author of the first casual puzzle books designed to teach C++ fundamentals while having fun!A list of Jason’s content:C++ Weekly YouTube ChannelThe [Fill in the Blank] Programmer YouTube ChannelC++ BooksTalk PlaylistShow NotesDate Recorded: 2022-10-26Date Released: 2022-11-25The Best Parts of C++ - Jason Turner - CppNorth 2022The Power Of Compile-Time Resources - Jason Turner - CppNorth 2022Making C++ Fun, Safe, and Accessible – Jason Turner - C++ on Sea 2022Your New Mental Model of constexpr - Jason Turner - CppCon 2021C++ AdressSanitizerC++ UndefinedBehaviorSanitizerC++ Sarter ProjectCircle CompilerVal Programming LanguageJakt Programming LanguageCarbon Programming LanguageCppFrontADSP Episode 97: C++ vs Carbon vs Circle vs CppFront with Sean BaxterJT on TwitterCppCast Episode 242 is AWESOME!Chapel Programming LanguageCppCast Episode with Adreas KlingChaiScriptRhai Programming LanguageC++ Pattern Matching ProposalC++ Pattern matching using is and asC++ Code Smells - Jason Turner - CppCon 2019Conor Hoekstra — ITM: My least favorite anti-patternIntro Song InfoMiss You by Sarah Jansen https://soundcloud.com/sarahjansenmusicCreative Commons — Attribution 3.0 Unported — CC BY 3.0

Transcript
Discussion (0)
Starting point is 00:00:00 I want to know Jason's thoughts on all of the successor languages that have been announced as, you know, one of the top, you know, we don't, we don't have I can't believe you would on October 26, 2022. My name is Connor, and today I finish my interview with Jason Turner as we talk about a couple of his most recent conference talks, all of the C++ successor projects, pattern matching, and more. Anything you want to say about the power of compile-time resources or the making C++ fun, safe, and accessible? Power of compile-time resources.
Starting point is 00:00:55 I kind of want to think of that one. No, wait a second. I have to think. What was the other talk that I gave this year? I don't remember what other i'm starting to think of the talk that i gave at cpp con um that was the 20 i think the one from a couple years ago or 2022 the con your new constexpr uh mental model i think that one that one might have been 2021 though oh yeah yeah yeah okay right right no no okay good i just had to put my my timeline in mental order here right so yes the power of compile time resources i actually enter that talk by saying this might
Starting point is 00:01:38 be the last talk that i give on constexpr and it's something like the 13th or something like that. If you look at like YouTube videos and conference talks and everything else, it's pretty high up there in number. But the point is, I think I've communicated everything I want to to convince people that you can move work to compile time. And there's several different ways to do that. And the more work you can move to compile time, the less runtime code you have. I mean, the obvious benefit is better performance at runtime, but then the side benefits that people don't think of like, well, code that doesn't execute at runtime is not open to vulnerabilities. It doesn't have undefined behavior. Like it can't, it's baked in. You have a data structure that you're accessing at runtime.
Starting point is 00:02:31 It's literally the fastest, safest thing that you can possibly do because all of the limits and ranges and sizes of all the things are all known in the binary. And if you try to do something outside of those ranges and limits, in many cases, the compiler will binary. And if you try to do something outside of that, those ranges and limits, in many cases, the compiler will just stop you if you have your warnings turned on and tell you, uh, this is a stood array of, you know, string views of 10 or whatever. And you tried to access the 11th element. I'm just going to stop you right there because I know, because I was able to statically analyze the code, that that's a bad plan.
Starting point is 00:03:11 But what more could we want, right? Isn't there also, there's also the, I've heard this on Twitter in a talk that you can detect UB if you make it run at compile time, basically, because it's not allowed. Yeah, UB is not allowed at compile time. So anything, I would say pretty much any line of code being written that can be, that doesn't have to access runtime resources in some way, needs to be tested in a constexpr context because you need to know if it has that UB in it. Right. And it's, you know, the downside is
Starting point is 00:03:48 you basically have to move all of your code to header files today because we don't have actual support from our compilers for modules. Yeah. Right, yeah. But, yeah, so that one was specifically about moving JSON resources into compile time data structures and just trying to get people to think about what compile time data structures can look like was the goal there.
Starting point is 00:04:17 So it was less like, look at these fancy tricks that you can pull and more like, look, just look at the end result and let's talk about that. And then my C++ on C talk, making C++ fun, safe, and accessible. It's partially a talk about making sure you're using proper tooling and setting up a correct environment. The more time I spent with this, I am a strong advocate of saying you, Connor, should be developing and, you know and not you specifically, but since you're the one I'm talking to, should be developing in an environment where while you're programming on your machine, all of the warnings should be enabled. Warnings should be enabled as errors.
Starting point is 00:05:00 You should be having some clang-tidy analysis running in the background, like as you're typing. Most IDEs do this today anyhow. And then you need address sanitizer and UB sanitizer on your developer builds right now, because you're using the code in a way that shipped code isn't going to necessarily be used. We can't ship. You don't want to ship a binary with address sanitizer enabled. That's a bad plan. Like it's literally a bad plan. It increases the surface area of your project
Starting point is 00:05:34 and makes you more vulnerable to someone trying to hack your binary, security flaws, that kind of thing, because of all the instrumentation that address sanitizer has to do. But if you, while you're're developing have all these things enabled you're going to like immediately catch memory errors that might not find themselves until the code's been deployed on the client's site right so you need to have it enabled today while you're typing and so that was part of that that's like kind of the half of it is like how can we use the tools to teach people how to write C++? So part of the code is I put up a really bad example in Compiler Explorer.
Starting point is 00:06:12 And the compiler just tells you, like, you're missing this header file. Oh, you're right. You type in the header file. Oh, you're missing this. Oh, you're right. You do this. And then the compiler can tell you, well, it's an index past the end of the, oh, you're right.
Starting point is 00:06:23 And you fix that. Oh, size mismatch, type mismatch. You fix that. Okay. And as you're working your way through, just doing what the compiler can tell you well it's an index past the end of the oh you're right and you fix that oh size mismatch type mismatch you fix that okay and as you're working your way through just doing it the compiler tells you to do then you get like an address sanitizer crash because you went off the end of the array and you're like oh well thanks address sanitizer for catching that for me and by the time we're done we don't have perfect code but just letting the tools walk us through what needed to be changed we had code that was considerably better when we were done. Yeah. The hard part,
Starting point is 00:06:50 I think of all this or the hardest part is that this stuff doesn't come for free in terms of setting it all up, which I guess we can point people to your CPP starter project. Yeah. I really need to go back and like, you know, check issues that are open on that. I think I actually did try to use it once and then gave up because initially I didn't have something locally installed.
Starting point is 00:07:12 And then what I think I really wanted was the new Visual Studio. I think it's actually been around for a few years now. But they have a dinner menu, kind of like, check, check, check. What do you want here and you can you can check the things because over time i'm sure when you started cpp started project it was only had a few things but now it's basically like everything under the sun that you could possibly want and it's like as much as i might love all of this stuff it's like uh i'll just i just found some basically working project but then when it came time to set up clank tidy i think i mentioned this on my other podcast is that i just just, like, I stopped working on it.
Starting point is 00:07:47 Because I was like, I'm at the point now where I've written several hundred lines of code, and I want to go clean things up. And so how do I go set up ClankTidy? Well, I've got to go download this Python file, and then I've got to hook that in with CMake. Now I've got to add CMake. And it's just, you know, whereas, yeah, other languages, that stuff kind of comes out of the box. And if we had some version of basically CPP starter project that you could, you know, on the command line, just like, you know, I think in Rust it's called Cargo or RustUp or Cargo New or whatever. I remember watching you and your cousin, John. JT.
Starting point is 00:08:21 Yeah, JT. And then, like, I was typing alongside and i just cried inside of how easy like you guys got up and running and i got up and i was like they even like built a fake you know or a real like hello world file and tests are built in and i was just like this is this is heartbreaking as like a c++ you know someone who does it professionally and it's like where we need like and the community's been asking for it for you know in terms of um not so much build systems but like uh package managers and stuff and that story is is a is really missing from c++ and hopefully in the future we'll we'll have we'll
Starting point is 00:08:56 have that story yeah it is definitely takes far more steps in c++ yeah but for now people can go watch the talk and go use your starter project yeah i think now we should we should get to what you know we talked about vaccines for a while and i'm sure there's a few listeners being like connor i don't care about vaccines i want to know that's true yes i want to know jason's thoughts on all of the successor languages that have been announced as, you know, one of the top, you know, we don't, we don't have. I can't believe you would bring this up, Connor. I refuse to talk about this.
Starting point is 00:09:33 You know, that's what's, you know, if, if it's, isn't it, there's a small part that's, you know, it's very sad that CppCast ended in general, but just that it ended right before all of this, I don't want to call it drama, but obviously it's been a hot topic on Hacker News and Reddit and there's Carbon from Google, there's CPP Front. We had Sean Baxter, who is the Circle individual. We had him on for an hour and a half that I think was three episodes and him talking about, you know, all his thoughts on Circle versus Cpp front versus carbon versus uh i guess cpp front and cpp2 are the same thing and then there's also jacked yeah or yacht is it yacht or jacked i think yacht i think is technically how it's supposed to be pronounced yeah i have no i've only heard of that i haven't you know seen anything on um andreas cling's uh streams or
Starting point is 00:10:20 anything like that uh anyways i'll turn it over to you. The C++ community, plus plus plus at large, has been wanting to hear what Rob and Jason, we're going to at least get to hear from Jason and Rob hopefully will get on in a later episode. Bait and switch. You didn't tell me we were going to be talking about this. I'm sure you have views though. I have some thoughts. What I'll say is of all the languages that you just mentioned, which ones can I actually use right now? So what do we mention? CPP? I mean, and you probably mean like in a context where you're doing something other than writing Hello World. Right. I don't think any. Actually, I don't know about JACT or Yacht.
Starting point is 00:11:01 Yacht is actually slowly replacing the C++ code in in serenity os yeah yeah so well i mean i don't know to what extent but that has a huge community around it for a for a startup language for an actual legit like uh um what's the word i'm looking for? Grassroots project. Has a lot of people working with it. That you can use right now. JT, my cousin, has almost completed their, I'm thinking at least sixth NES emulator written entirely in Yoct.
Starting point is 00:11:41 Okay. Not the sixth written entirely in Yoct, but their sixth. This one happens the sixth written entirely in yacht, but their sixth, this one happens to be written in yacht. So one of JT's hobbies is to write an NES simulator and whatever language they're learning today. So that could be rust, C, Rust, and Yoct. Definitely at least those four. And I know this because I wrote a blog. Actually, I started my blog, the Code Report blog, specifically just so I could write a blog post about having JT or of the episode that you had with JT on CppCast because it was, from a programming language enthusiast point of view,
Starting point is 00:12:38 absolutely awesome. JT has a ton of background with different projects and different programming languages. He's worked at Microsoft with TypeScript and Rust. He has worked on a programming language called Chapel. I think he also went to the University of Colorado? Boulder, yes, for a master's degree. Yeah, and I think worked, I could be getting this part wrong, but like on the LLVM or Clang
Starting point is 00:13:01 stuff there, potentially had some exposure to Chris Lager. The LLVM and Clang stuff was potentially had some exposure to chris the llvm clang stuff was during a short internship at apple okay yeah but uh jt's advisor at boulder was um oh shoot i can never remember his name when i want to remember it jeremy jeremy jeremy seek yeah was jt's advisor in boulder so that then is directly related to the TypeScript work. And then Jeremy's continued to do things like gradually typed Python and stuff since then. So yes, JT has had lots of exposure to programming languages and has created at least from scratch, helped me with ChaiScript. Started Rai. Are you familiar with ChaiScript, started Rai.
Starting point is 00:13:48 Are you familiar with Rai? I thought it was RaiScript or is it just Rai? Or is it RaiScript? It might be RaiScript. It was influenced by Chai. Which was influenced by ChaiScript. But that took on a life of its own. Like JT like left the GitHub project up and walked away.
Starting point is 00:14:05 And now there's like an organization around it people are still working on it and then a little toy language that didn't get very far called minnow and then yacht and yeah lots of programming languages i will link the blog post in the show notes but they have also been on a ton of different podcasts other than CPP cast, including a bunch of rust podcasts. And he was rusty spike, right? No. Yeah, very sad that those aren't you can't actually access them anymore. So I've been slowly listening through all the existing rust podcast episodes. I've gotten through a couple podcasts, but that's not saying much because there's only like eight episodes. But Rusty Spike aren't hosted anymore. But it's not the end of the world.
Starting point is 00:14:48 I mean, it is what it is. And they had a Twitch stream, I think, if I'm not mistaken. And you were on that Twitch stream for a conversation, right? Yeah. So the Twitch channel, the live streaming was interviewing people who were just it was like live interviews kind of like this kind of thing and i was one of them and then uh andreas cling was one of them as well which i think is around the start of their collaboration or i could have the timing off interesting so anyway it's very very cool that you have a cousin
Starting point is 00:15:24 that's sort of in rust land at the moment and you're in c++ land and um it's a very cool cool whatever artifact of the pl pl communities at large you should uh definitely have andreas and jt on here to talk about yacht oh yeah yeah well definitely um i mean having jt on would be uh yeah i mean we probably talked for for hours we'd have we'd have a hard time i'd have to have bryce there to to reign it in um but yeah andreas his interview that you had with him on cpp cast i thought was a phenomenal and also his just personal backstory is um incredibly interesting and kind of inspiring as well um so yeah we'll we'll definitely put them on the list of list of folks but yes back to the hot takes from jason that we
Starting point is 00:16:10 were about to get that i went on a tangent uh so yacht is the only one that you can the act is the only one well no that's not true circle you could use and deploy in real code oh yeah that's a full working compiler yes no um nothing personal at all to uh to uh shoot what's his name again brain cramp uh chandler no no the one who was circle uh sean oh sean baxter yes sorry um no i think the fact that circle is a closed source compiler without a company behind it was slow its adoption in a lot of places. And Carbon, as far as I know, still doesn't actually have anything to look at. I'm like, okay, fine, I'll play with the Carbon compiler. Oh, no, wait, there isn't a Carbon compiler. Never mind, I won't play with it.
Starting point is 00:17:01 It's just a lightweight interpreter at the moment. And then that we had cpp front yeah cpp front which interesting i don't know i still need to watch herb's keynote on that i it's it's literally a tab open on my laptop right now i haven't hit play yet i need to do that um and then there's the one from types what's it called types values values that's what it's oh val yeah val out of it's kind of out of adobe but it's mostly out of dave abraham's who formerly worked on swift and formerly worked on c++ so i think the the basic i'm not going to give any personal strong opinion here. What I'm going to say is I don't really see anything yet. Like when these languages exist, we can have another
Starting point is 00:17:53 conversation. But then I will say from having my pulse, my finger still on the pulse of the C++ community, even though I'm not hosting a podcast anymore. The general response on Twitter and Reddit seems to be, I just want a safer C++. Why do you all keep changing the syntax? That's the feels that I get. They don't want a new syntax. They don't want a new syntax. Well, so when you say, why do you keep changing the syntax? Does that mean like with respect to Carbon and CPP front, which is kind of they're having
Starting point is 00:18:28 all this backward compat, but they're saying, no, no, no, we want to still live in C++. We don't want to switch to a new thing, whether that's a language or a front end or whatever you want to call CPP2. They just want a safer version of what they're currently working with. Virtually every average C++ like the you know the the person who's out there just getting work done that i have any conversation with or read their twitter comments or the reddit comments about this they want the ability to just like put a pragma at the top of the c++ file saying well these things aren't allowed. We're now using the newer version of whatever, right?
Starting point is 00:19:07 They just want to be able to like turn off old features that they are deemed dangerous or whatever, like point arithmetic disallowed, whatever, right? They don't want a brand new programming language. They want a simpler, safer C++ to fall out like pragma disable the pre-processor i don't know you know something like that that's actually very close to what sean baxter his i mean he's at a bunch of stuff yeah yeah so circle is the outlier here right because circle is c++ plus plus plus C++++++. And he said basically that he doesn't want, you know, he thinks that any future vision, because there's all these visions attached to Carbon and attached to CPP front is like, we are C++. We have a committee.
Starting point is 00:19:56 We make design changes, whatever. We add new things to language library. Like we can materialize whatever future we want to materialize. We just, as a community have to decide that that's what we want. And his sort of take was that he doesn't think that we need to switch to, you know, a whole new, you know, Google will do what Google does, as he mentioned, like Google is basically an entire country, you know, if they're going to create a language, they can immediately be successful just if they're using it at Google because they have so many
Starting point is 00:20:25 engineers. And so like, you know, Google can do whatever Google does, although they're not aiming it to be just a Google project. So we'll see where it goes. But he basically said is like, whatever we want as a community, we should just work towards making that happen inside of C++. We have the power to do that. The question is just like, are we as a community going to make that happen the other question is does the the iso model like prohibit major changes happening i have no opinion on that i've never been to a committee meeting i've never submitted a paper it's a slight lie i've had my name on a couple of papers but i didn't write them i thought you had been, I recall you saying that you went to Kona. I did. But you never went to the meeting? I went to Kona in 2021, bought my plane tickets and everything,
Starting point is 00:21:11 flew to Hawaii. So you were planning on going to a committee meeting? I was planning to go to a committee meeting, yes. Had the world not stopped. Yes, but it's fine. I got a lovely vacation to Hawaii with my wife. Interesting, interesting. So my memory does serve correctly. It's just that committee meeting that you had planned to go to never ended up happening. Correct. So now I can still say I'm an outsider when it comes to this. Yeah. And I should have expected that would have been your general response is like,
Starting point is 00:21:38 I'll have an opinion when I can use things. It's because that's typically been your take on all new C++ features is that you usually don't start poking around and making, you know, C++ weekly video until something has actually been added to the standard and you can actually play around with it in a compiler. Because otherwise, you know, you'll start looking at revision R3 of some paper and be like, oh, look what's neat, what's coming. And then you'll make a video about it. And then sure enough, half a year later, when it gets put in, they'll have, you know, drastically changed the feature.
Starting point is 00:22:08 And your take has always been, you know, what value am I giving if I'm covering some future feature that is not actually concretized yet? Because I'm just going to be not misinforming. You'll be informing at some temporary state of some feature. It's probably about three years ago. I pretty much made it a hard and fast rule that I'm not going to cover something unless I can demo it in a live compiler today. Yeah. You probably save quite a bit of time making that like a hard and fast rule for yourself because a lot of podcast drama is like, oh, we got to talk about this feature that's going to
Starting point is 00:22:38 go through seven revisions and it'll take, you know, a decade or two cycles to get in. Whereas your version, you just wait until it's actually finalized. And I also think I save a lot of mental capacity because I never have to say, wait, was that in the paper version or was that in the released version or whatever? No, don't have to worry about that. Yeah. Yeah. Literally. Was it last episode?
Starting point is 00:22:58 I was asking Bryce because he just gave a talk. And one of the he was focused on top three things to look forward to. And one of them he was focused on top three things to look forward to and one of them was pattern matching and i had sort of forgotten about pattern matching because at one point it was supposed to be in 23 and then i asked him oh yeah like what's the status of that like uh there was michael park's proposal and friends you know he's one of the names on it but there's a bunch of folks that have worked on it but then there's also the is as proposal that came so like there's two competing proposals and i actually don't know what then.
Starting point is 00:23:26 So it's like you're saying, you have to keep track of there's not necessarily just one proposal for a certain feature. There's competing proposals. Well, at some point, those merge, et cetera. It does take up a lot of bandwidth to keep track of that stuff. I will give an opinion there. I am not a fan of is-as. I think it'll make the language harder to teach.
Starting point is 00:23:44 Really? Yes. And I think in many ways it comes right back around to my recent rant about implicit conversions because it's hiding conversions from you. If you say I want this as this thing, it might be a dynamic cast, it might be a static cast, it might be a reinterpret cast. I don't know. I'll give it to you sure like doesn't sound good to me sounds yeah that's a great point and that's exactly against best
Starting point is 00:24:13 practice of being explicit about that we should write code that doesn't need cast not code that has a bunch of fun implicit cast for us yeah also too i've always wondered i'm actually it's been a while since i've never read that paper fully i just perused it but uh like what what is the land grab of is an ass like is that even it might be contact sensitive inside of the pattern matching construct okay so yeah it's you can still have you know is or as as a variable name elsewhere and it's fine i just actually reviewed these two different papers like last week because i am preparing an episode where i'm going to talk about features that i want
Starting point is 00:24:50 coming up in c++ so i had to go back and look at the current paper list and that yeah like you said the two different competing papers there's one that has isn't as in it and there's one that doesn't and the one that doesn't i think has a much more readable syntax, personally. Interesting. Can we get a preview of the itemized list of features, or do people have to wait? They got to go subscribe to the channel. I would have to pull up my notes, but pattern matching is, I think, strong on there, because I think pattern matching is one of the few things that will change the way the everyday C++, not the library writer, but the everyday C++ user will use the language. I do think I've changed my opinion a few times. I want reflection, but I was never considering it to be a priority for the standards committee and my personal
Starting point is 00:25:40 cue because that's something I want. But is it going to make the language easier or harder to teach? Is it going to be something that I will, you know, the, the C++ applications developer is going to use? And I decided, yeah, ultimately, yes, we do want reflection if for no other reason than to be able to actually enumerate the values in an enumeration if for no other reason yeah i mean there's a bunch of libraries macro you know hacks for doing that kind of thing and especially coming from other languages where that's just a utility you can reach for it's yeah it's crazy the hoops you have to jump through in c++ to make that happen those are the main two things and then i would say the next thing that i want is to actually remove implicit conversions from the language,
Starting point is 00:26:26 which I know is not going to happen. But I mean, never say never there. My personal take is that C++ is at this kind of inflection point right now, and that there's all these projects, languages, whatever you want to call them popping up. And C++ is going to have to react to this somehow. This isn't necessarily a bad thing for C++. This, you know, I think, you know, even I can't remember, I'm going to mess up who said this, it was Chandler, or someone else who's working on one of these projects where like, you know, a possibility is that, you know,
Starting point is 00:26:59 we experiment with these things. But at the end of the day, it just ends up improving C++. And that's still considered like a win, right? Because at the end of the day, it just ends up improving C++. And that's still considered like a win, because at the end of the day, a lot of these projects are motivated by not being able to make, you know, backwards, you know, changes, backwards compatibility, breaking changes. And, you know, we they had the meeting in Prague, where they said, you know, no to making changes. But I don't know, I think something in the next decade is going to happen that enables it either if it's like a once in 30 years or 50 years kind of thing or you know maybe they reintroduce something like um rust's uh additions you know vittorio romeo had that proposal for epochs yeah i think something like that is going to have to happen you know something is going to change i
Starting point is 00:27:42 don't know what it is but like i feel like there's a chance that like requests, like turning that off, you know, it's, it's going to be a possibility. Sean was talking about, you know, there is a way to, and the Sean Baxter, not Sean Parent, there is a way to, you know, by file by file, like turn on certain features. Like we can do that with, you know, pragma statements and sure it creates, um, a proliferation of different styles per file. But like, you know, you can do that, test them out, and then at some point work towards, you know, what Haskell did, where they have a bunch of these extensions. And then for the first time in 20 or 30 years, they basically said, you know, here's a set of extensions that basically everyone's turning on or like a huge subset of folks that use Haskell are turning on. Let's just add them to Haskell 2021 or whatever they called it.
Starting point is 00:28:24 And so now those extensions, you know, ship out of the box. You don't have to go and turn them on. I wouldn't say never say never. You could get your wish, especially, I mean, you got 22,000 followers. You know, you got. Oh, yes, I am powerful. Oh, sorry. This is a podcast.
Starting point is 00:28:38 I just rolled my eyes at that. To be clear, I do not actually consider myself to be powerful in the community here. You got close to 100 000 subscribers on youtube you know you could you could cause a movement if you if you want to do well i i want to do a live stream soon um and the goal is going to be to write my own cling tidy check that disables implicit conversions as a cling tidy check just to see what what happens i want to see the fallout of it i want to try it yeah i mean there's there's another great tool i've always i mean i saw actually i
Starting point is 00:29:09 think in your talk it added const to the auto parameter in a range base for loop yeah and that's something i know that clang tidy for a long time was trying to add a the basically the equivalent in rust where it lets you know hey you've added a mute keyword you don't need that you haven't modified or mutated your your variable the opposite is for c++ is adding const whenever you can does did that get added in the range-based for loop because that clang tidy thing got added do you know or i think that got added in the range-based for loop just because of the modernized transformation, but I did observe cling tidy just a few days ago, the latest trunk saying, hey, you can add const here actually. And I think it was the first time I'd seen that outside of the context of a ranged for loop modernized transformation.
Starting point is 00:30:00 I will have to go check that out. That's something I've wanted for, I mean, I went and tracked that issue for a while. Like it's been out there for two or three years because that's, that's one of the things you've talked about was the talk. C++ code smells. Yes. Yes. C++ code smells.
Starting point is 00:30:16 Yeah. And I, I ended up giving a talk called my least favorite anti-pattern, which I acronymed ITM for initialize, then modify. And then I realized after I was referencing a few people's talks is that I hadn't watched fully C++ code smells. I had just stolen a couple of snippets. But then when I watched that talk, I was like, oh man, like this, I'm basically just giving Jason's talk, like with a different flavor and style. Cause at the end of it, I was basically like const driven development. You just add const to things and like, you're
Starting point is 00:30:43 going to fix half of the issues of like initializing something and then modifying it you can just const trying program with const and then make const or default yeah yeah it's uh so yeah just go watch jason's video you don't have to bother watching mine i realized i basically given the same talk or prepared the same talk accidentally that you have done and even kate's given yeah similar talks in that vein it's not it's not a um one person came up with this definitely kate and james were the my some of my inspiration for that because they gave a talk that said just start at like take the first value add cons to it and see what breaks and figure out why and just do that just make everything const one line at a time yeah it's i mean it's so nice in rust
Starting point is 00:31:25 um also i've mentioned probably rust more times in this recording than i have in like all the other episodes and that's just because i've been playing around with it on the side but yeah the the fact that it's built into it's the default in rust it's like most of the times i'm just writing code and i don't ever have to put mute there like everything is is declarative and const and also too kate and james refers to kate gregory and james mcnellis i believe uh just in case if we have people that aren't in aren't in the inner or haven't heard of kate kate and james but they i mean james i'm actually not sure if he has given any c++ talks recently i know he was a prolific speaker early
Starting point is 00:31:59 earlier on a while no not since not since covid i guess would be my guesstimate not since 2020 i mean that sounds that sounds about right i'm thinking about like when we last had james on cbp cast whatever yeah i don't know i mean i'm not saying that there's anything to that i'm just thinking timeline wise i think 2019 was approximately the last time that i recall yeah yeah both both fantastic speakers i think they've even co given co-talks together where they were co-speakers well yeah that's the one that i'm referring to is where they were with the one where they say to just make things const and work your way down that was a talk they gave together all right well so i mean we've gone a while a few minutes past what i had this slotted for. Are there any other hot takes or things you've got?
Starting point is 00:32:47 I don't have hot takes. No hot takes? Anything, any curious things that, you know, you've been wanting to tell the C++, not that our listeners are all C++ers, but, you know, the C++ community since not have, I guess you've got Twitter still. So if there's really something you can just, you can just tweet it, folks. I've made my opinions known and my Twitter follower count has improved for it. Apparently, Twitter likes hot takes. So yeah, it is a little unfortunate that, you know,
Starting point is 00:33:16 the spice it's like, I'm not sure if you've heard about the chess drama. Yes, yes. But like the fact that, you know, it's not really a great thing. You don't want there to be more cheating and et cetera and all this stuff. But like it really seems like chess is kind of leaned into it. Like the individual that was accused was at the U.S. championships. And like I only know about all this stuff. I don't play chess. I don't know anything about chess.
Starting point is 00:33:38 I mean, I know the basic rules, but I know about it because like you see something on YouTube of oh you got this now and i've watched probably now like five hours worth of like chess vlogs talking about the drama and uh and there's yeah it's unfortunate that this kind of stuff drives clicks and impressions and views and stuff it's it's probably would be better if people were more interested in just the mundane things. But well, I guess on that note, I will leave what I have to say on this. I have the next I think it's next 11 episodes of C++ Weekly fully planned out. A lot of them are going to be leaning towards clickbait. Perfect. But it is all about trying to get best practices out there more.
Starting point is 00:34:26 That's the goal. Clickbait in the spirit of improving C++ code out in the world, I think, that's definitely allowed. Okay. All right. Well, let's replug because this is like probably episode three of three. I'll probably dice this up into three. So we'll replug all of Jason's, I guess. Actually, yeah, you can still go listen to the podcast a lot of that stuff is timeless especially
Starting point is 00:34:48 some of the conversations with yeah a few folks it has nothing to do with topical stuff it's just about c++ best practices so yeah go listen to all 349 episodes if you already haven't uh go subscribe to jason's youtube channel buy his books if you're a corporation listening to this as corporations obviously do hire him to do training anything else you buy his books. If you're a corporation listening to this, as corporations obviously do, hire him to do training. Anything else you want to plug or things you want to say? I do want to say
Starting point is 00:35:10 that my puzzle books are actually designed to be fun, just for the record. And people have actually told me that they are fun. They're not like painful C++ puzzles. They are fun C++ puzzles.
Starting point is 00:35:23 Yeah. Haven't you said that you're, I think it's your niece, if I recall correctly, like you had her edit them for you? She was my play tester for my first couple of books. Yeah. And she knows nothing about programming and nothing about C++. When she learned the rules, she was like, oh, this is good and got into it.
Starting point is 00:35:36 Yeah. I mean, that's like, that should be the, you know, on the back cover on the front cover, you know, not sure how old, just like non-c++ uh uh enjoyer of games she was 18 19 something like that 18 yeah yeah so even non-c++ folks can can enjoy them um so yeah links for all of that stuff in the show notes uh thank you so much for coming on hopefully we'll get rob on and then maybe at some point if you guys ever want to have a reunion you can come on and uh for old time's sakes. Let us know. Technically, the podcast is still there.
Starting point is 00:36:08 You said the same thing as the new Rustation said, is that we're retiring for now, but maybe not forever. Maybe not forever. There could be a chance. Maybe it'll even just be like a Christmas special every year or something that Rob and Jason get back together once a year to talk what happened in the last year. That could be fun. One can wish, one can hope. All right. Thanks so much, Jason. We'll do this again in the future. Thanks, Connor. Thanks for listening. We hope you enjoyed and have a great day.

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