CppCast - Blogging and Text Processing

Episode Date: April 12, 2018

Rob and Jason are joined by Bartłomiej Filipek to discuss blogging, Simplifying C++ Code with C++17, and the work he's doing at Xara. Bartłomiej Filipek (Bartek as a shorter version) is a C+...+ software developer at Xara where he works mostly on text features for advanced document editors. He works remotely from Cracow/Poland. Apart from graphics applications, Bartek also has experience with game development, large-scale systems for aviation, writing graphics drivers and even biofeedback. For seven years Bartek has been regularly blogging. In the early days the topic revolved around graphics programming, and now he focuses on Core C++. In his spare time, he loves assembling trains and Lego with his little son. And he's a collector of large Lego Star Wars models. News CppCon 2018 call for submissions Developing Talk Ideas SG13 graphics why it failed Source to windows file manager released (not C++, it is C) Octal Zero considered harmful CppCast Gear Bartłomiej Filipek @fenbf Bartek's coding blog Links C++17 Resources Xara Xara Cloud: Getting Started C++ User Group Krakow Sponsors JetBrains CppCast Patreon Hosts @robwirving @lefticus

Transcript
Discussion (0)
Starting point is 00:00:00 Episode 145 of CppCast during checkout at jetbrains.com. In this episode, we talk about CppCon and Octal Zero. Then we talk to Bartwami Filipic from Zara. Bartwami talks to us about blogging, podcast for C++ developers by C++ developers. I'm your host, Rob Irving, joined by my co-host, Jason Turner. Jason, how are you doing today? I'm doing okay. I'm getting over a cold.
Starting point is 00:01:34 It seems like every episode lately I've had some excuse for why my audio might not be perfect. Yeah, we'll get by, though. I hope you feel better soon. I'm glad to have you back in the states yeah i'm back in the states for a few weeks at least okay well at the top of every episode i'd like to read a piece of feedback uh this week we got an email from eric and he writes it would be cool to have bre Wilson on for the GN build system. It's the Chromium meta build tool, and it's awesome. Few seem to be aware of it.
Starting point is 00:02:11 And I don't know about you, Jason, but I was definitely not aware of it. I am not aware of it, no. And I'm afraid to say it this time, not aware of who Brett Wilson is. Because the last comment I made on that, when we were discussing the, um, uh, standalone C++ proposal. Yeah.
Starting point is 00:02:30 I got called out on Slack for not knowing who that person was who made the proposal. So did you get called out by the author? Cause I know you were talking with him recently, right? Uh, it was by someone else who knew the author and then we all got in touch and I,
Starting point is 00:02:44 yes. And was talking to the author then after that Yeah, unfortunately we don't know everything, but that's why we're here to talk about stuff Maybe we can get Brett Wilson on the show learn a little bit more about this Chromium-based build tool
Starting point is 00:02:57 Right Well, we'd love to hear your thoughts about the show as well You can always reach out to us on Facebook Twitter, or email us at feedback at cpcast.com. And don't forget to leave us a review on iTunes. One other little bit of housekeeping I wanted to do before we get into the guest. We did that survey and got a lot of feedback. We're still going through it all.
Starting point is 00:03:19 But one thing that came out of it is there seemed to be some interest in listeners being able to get CppCast t-shirts and stuff like that. And Jason and I, when we go out to conferences, we'll often bring shirts with us to give out. But there's only so many that we can actually physically bring to a conference. And if you don't make it to a conference, you might not ever get a chance to get one. So we opened up a shirt, an online shirt store where you can get those shirts and you can also get like mugs and stuff. So if you have any interest in doing that, it's a shop that's shop.spreadshirt.com slash CBP cast.
Starting point is 00:03:56 And for like the first week and a half or so you can get a discount because we just opened. Yeah. I thought the sweatshirts looked pretty nice the hoodies i might get one myself yeah yeah i was thinking of getting a hoodie myself too and also on the topic of why it's important to go to conferences you said we try to bring t-shirts you have put in the order for c++ now t-shirts correct yes so you will have some to give out c++ now so if you're going to c++ now hit me up for a cbpcast t-shirt i will? Yes. So you will have something to give out at C++ Now. So if you're going to C++
Starting point is 00:04:25 Now, hit me up for a CBPCast t-shirt. I will have a box of them. Okay. Joining us today is Bartwamy Flipik. Bartwamy, or Bartek, is a C++ software developer at Zara, where he works mostly on text features for advanced document editors. He works remotely from Krakow, Poland. Apart from graphics applications, Bartek also has experience with game development, large-scale systems for aviation, writing graphics drivers, and even biofeedback. For seven years, Bartek has been regularly blogging. In the early days, the topics revolved around graphics programming, and now he focuses on Core C++. In his spare time, he loves assembling trains and Legos with his little son, and he's a collector of large Lego Star Wars models. Bartek, welcome to the show.
Starting point is 00:05:09 Hello, hello, and thanks for having me today. There's a couple things we have to ask about there. I want to ask about your C++ experience, but instead I'm going to ask about the Lego models. Yeah. Yeah, what's that question like? Do you have like the Death Star like, the Imperial Star Destroyer and, like, the really big ones? No, no, no, no, no.
Starting point is 00:05:30 So I actually skipped those first few sort of iterations of those models. And they were very expensive at that time. Oh, yeah. So now I'm collecting... So I have TIE Fighter, so the largest one. And the biggest
Starting point is 00:05:50 model that I have is probably the Sand Crawler. So in 2015 it's almost 4,000 LEGO pieces. So of course we have right now Falcon Millennium, which is like almost 8,000 pieces.
Starting point is 00:06:06 But, yeah, it's far more than $1,000, I think. So it's super expensive and even super hard to get it because it's so popular. So maybe I will do it next time. I will buy it next time. But, yeah, So those models. And I have Star Destroyers, but those little versions. So mid-scale, mostly. Of course, I have the Saturn V, which is also a space model that they released last year.
Starting point is 00:06:47 My son has a couple Star Wars Lego models, and I am always eyeing up some of them for myself. He doesn't always keep them together. I think the biggest one he has is like an Ewok tree village one, but a lot of times he'll put them together, and then eventually they'll just wind up as a pile of loose Legos, and I just kind of wish he would just keep them together because they're so nice to look at. My models are also mostly on display, but my son noticed them and now they are also quite broken. So I need to wait a few years until he also maybe he will help me to bring them back together.
Starting point is 00:07:26 So that's the risk with kids. That's a tricky thing with those large Lego models too. I mean, Lego is meant to be played with and to just build it once and then let it sit there is... Exactly. The details are quite delicate, so
Starting point is 00:07:41 you don't want to swash them around and play. Wow, right. Okay, well, Bartek, we have a couple of news articles to discuss. Feel free to comment on any of these, and then we'll start talking to you more about your blog and your work you're doing at Zara. Okay? Yeah, sure. Thanks. Okay, so this first article is CPPCon 2018 call for submissions.
Starting point is 00:08:05 We've been looking forward to this coming out. And the deadline for submissions is May 11th. And decisions are going to be sent out July 1st. Jason, you know what you're proposing yet? Hmm. I have two ideas. Okay. One is relatively safe that I'm pretty sure would get accepted.
Starting point is 00:08:22 And the other one is completely not. And I haven't decided which one I'm going to propose, but I'm pretty sure I get accepted and the other one is completely not and i haven't decided which one i'm going to propose but i'm pretty sure i'm only going to propose one of them okay because last year you did at least two three talks right i think i did two last year two last year okay but i'm trying to keep up my my uh my role that i have going here that i'm doing one only at c++ now i'm going to see if I can do one only at CppCon also. Okay. And the other thing I wanted to mention is John Kolb recently posted this blog where he's talking about how to present a talk idea, basically. so if you have trouble thinking of talk ideas like I do this is probably a good blog
Starting point is 00:09:08 post to read yeah is there anything either of you guys wanted to comment on with either of these so I think basically the listening to the communities is important so you can if you want to look for some ideas then I don't know just go to reddit
Starting point is 00:09:24 or cpp and just look for some ideas, then, I don't know, just go to Reddit, air.cpp, and just look for the most popular topics. And probably if you came up with a sort of similar idea, then that stock might be really wanted and needed. So maybe that's a good start. Yeah. Okay. Next, we have a long post on Reddit. Okay, next we have
Starting point is 00:09:45 a long post on Reddit, lots of comments on this one, and this is about the SG13 graphics proposal, which we've talked about a couple times recently, and how that did not proceed at the last ISO
Starting point is 00:10:01 C++ meeting. This post is titled SG13 Graphics and Why It Failed. And it's a pretty interesting read. We can't summarize everything here, but it basically goes into the full history of the proposal from this author's perspective and why he thinks it has been voted down now. And it was definitely interesting to read.
Starting point is 00:10:28 I didn't realize that there were, it seems like there was a lot of feedback given kind of early on. And from this author's perspective, that feedback was somewhat ignored. And they're saying that's why the state of the proposal as it is, is not good. And why we don't need it in the standard. And that's, you know, according to this author's perspective. Yeah, the way I understood this, the original proposal, the original intent is that it would be something just like SFML or SDL or just a simple, we want input and output and some sort of buffer to draw things into to be part of the standard.
Starting point is 00:11:10 Right. Which I think I totally would be on board with that one. And I did not ever understand how it became basically this Cairo-like thing. And apparently, well, the author of this article isn't entirely sure, it seems, how it became the Cairo-like thing, and apparently, well, the author of this article isn't entirely sure, it seems, how it became the Cairo-like thing. It seems like what he's saying, at least, is that Michael McLaughlin, who's the main person who's worked on the 2D graphics proposal, kind of just latched on to Cairo and didn't want to change gears, even though, as I said, he got feedback saying, you know, this isn't really
Starting point is 00:11:43 a great library to base a standard on. Yeah. Right. So actually, that would be quite useful library for teaching, right? Because right now, if you want to start with C++, with teaching, or if you learn the basics, then all you can do with using the standard library and your compiler is to just create Wszystko co można zrobić, używając standardowej biblioteki i kompilerów, jest tylko stworzyć aplikację konsolową. Co jest dziwne dzisiaj, kiedy mamy wszystkie te fajne aplikacje GUI i aplikacje webowe.
Starting point is 00:12:16 Więc mieć proste 2D grafiki to będzie dość ważna rzecz. quite an advantage right for maybe that wouldn't be used for for production at least not not in the in the early version of that but but maybe later why why not and and i think that's um the dot net so c sharp and and java have those abilities right yeah so you can do those simple simple stuff so maybe maybe maybe we are not not ready enough maybe maybe we need to fix some more important stuff like modules and concepts. And then maybe after, I don't know, maybe after five years, maybe we'll return to that topic.
Starting point is 00:12:53 And of course, introducing graphics is not that simple, right? Because they also mentioned the input, so window support, and maybe even audio audio I've heard something so that's not that super easy to standardize yeah so we'll see Jason do you want to introduce this next one?
Starting point is 00:13:18 yeah I just thought it was fun to mention that Microsoft has released the source code to WinFile to the file manager for Windows. The one that was in Windows 3.1. Right, so this is like the precursor to the current File Explorer? I think it's the precursor to the precursor to the current File Explorer. Windows NT 4 was when it was last actively updated. Originally released with Windows 3.0. Wow. So the source is out there but more
Starting point is 00:13:46 importantly it can compile with a visual studio today on run on windows 10 yeah so it looks like what they did is they released the original source but then they also released a patch or a separate branch that can compile on with the current version of Visual Studio, right? Yes. That's pretty cool. But just to be clear, it is not C++. It is all pure C. I've even downloaded that and compiled, and it really works, so in a matter of
Starting point is 00:14:18 seconds, Visual Studio was able to build that. But it's without any any classes i've even run the the source codes against this visual tool called source trail and and it showed me like 38 structs those c style structs with with all of the three functions lying around. And there was like one C++ class, even with some templates, but it was probably added quite later in the production.
Starting point is 00:14:52 Yeah, so it's cool maybe for historical reasons, but it's not the source code that you would like to learn modern C++. No. No, absolutely not. But on the other hand, maybe it would be interesting to see the modern C++. No. No, absolutely not. But on the other hand, maybe it would be interesting to see the modern C++ version of that.
Starting point is 00:15:09 So if someone refactored the code. But that's probably not that super easy anyway. That would be really cool, actually, to see. I just noticed... Proposal for a talk. Yeah. There you go. Someone out there should propose that and do it.
Starting point is 00:15:25 Yeah, yeah. I did notice that all their uses of void is all capital void. Like it was somehow pre... No, it can't be pre-standard void. Void's been around since the beginning of C, right? Hasn't it? Pretty sure it has.
Starting point is 00:15:41 Probably. Sounds right. Maybe not. All of the Win API types are uppercase. So like int, int32, long, dwarf. So all of those types are uppercase. So maybe that's their convention. Just their convention.
Starting point is 00:16:01 So that is step one in your modernization is to use the correct types. Yeah, yeah. Okay. And then the other blog post I want to talk about is this one, octal zero considered harmful. And I'll be honest, I don't think I was aware that having a zero at the beginning of a number meant it was going to be an octal number in C++. Okay. I'm not sure if this is common knowledge or if it was just to be an octal number in C++. Okay.
Starting point is 00:16:25 I'm not sure if this is common knowledge or if it was just something I've never run into. But we all know 0x is going to be a hex number. Apparently, just using a 0 at the beginning of a number is making it an octal. And I completely agree with this author that that's dangerous and is probably causing lots of potential bugs. And the alternative he suggests is to have 0 and then lowercase o to precede octal numbers, which Python and I think D also does. And I think that makes sense. What do you guys think?
Starting point is 00:17:03 Yeah. Just added in C++17? Or because I also skipped that. I think it's always been the case in C or C++. It was inherited from C, yes. Yeah. Oh, okay. And I am aware of it because ChaiScript's number handling is the same as C++'.
Starting point is 00:17:22 So I've had to deal with parsing these types of numbers. But I can say I've never done that. I've never prefixed. Well, as far as I know, I've never accidentally put an octal number in my source code. I was looking through the comments on this one a little bit, and someone pointed out one way to get into this is if you're writing out a date string and you say, okay, the month is 09, day is 31. Well, the 09 isn't going to compile because that turns into an octal
Starting point is 00:17:55 and there is no 9 in octal. But I guess if it's between 0 and 7 and you're proceeding it with a 0, it doesn't make a difference. Well, and then if it's between 0 and 7, and you're proceeding it with 0. It doesn't make a difference. Well, and then if it's between 0 and... If it's between 08 and 09, that is, then you're going to get a compile time error. Right, right.
Starting point is 00:18:14 And then if it was 10, it's no longer going to be interpreted as octal, so it wouldn't actually cause a problem in any case. Right. I mean, I'm sure there's still places where, Oh, I guess I see what you're saying. Yeah.
Starting point is 00:18:29 But I, I mean, the Reddit comments are full of people saying, yeah, this has bitten me. I had broken code because of this. I've never experienced it, but there's apparently like many people have.
Starting point is 00:18:38 Yeah. Yeah. I think changing to use the convention of zero makes a lot of sense. Hopefully, I guess someone has to make a paper though,, to go advocate for that, right? Yeah, it would break so much existing code, probably, to deprecate that. I mean, anything that is actually working with file modes on Unix and once octal is going to have a problem. So it would break a lot of existing C code, probably, but not very much existing C++ code.
Starting point is 00:19:10 Well, they could at least start by adding in 0, 0 as an alternative. Oh, yeah. Using just 0. And then maybe deprecate it in a later date. Yeah, I don't know if any compiler has a warning,
Starting point is 00:19:28 you used Octol. Yeah, please don't use that. Yeah. Okay, so Bartek, we did a news episode last week, and we did talk about one of your blog posts. We've talked about your blog post several times over the course of our show. But this last one was an April Fool's joke
Starting point is 00:19:48 post. And I did want to ask, did you coordinate with other blog authors? Because there were at least three posts that all had kind of a similar content. That was our secret mission. So actually, I got that idea last year. So I've announced that we will have C++18. So that was my first April Fool's joke. And then for this year, I decided that maybe it would be nice to collaborate and also have someone with me.
Starting point is 00:20:25 So I talked with Jonathan Bocara from Fluent C++. And then we also invited other people. So it's Jonathan Bocara, Jonathan Miller, Simon Brand and Rainer Grimm from Modern C++. So we basically discussed various topics since March and then we came up with the single idea and then we decided to go for that. So that was quite an interesting experience.
Starting point is 00:21:01 Also in terms of blogging and how that will all go. Because it was also Sunday, so it was out of anyone's blog schedule. So that was also quite suspicious. And it was also Easter, right? So it was another point that maybe people wouldn't go for that, right?
Starting point is 00:21:25 And they will immediately see it as a joke. But I was very surprised because I got like 50,000 views on that blog post only in two days, which is like half of my monthly traffic. And even Jonathan's Fluency++, his site was crushed for a good time
Starting point is 00:21:56 because of the traffic. I think that Jonathan's post got onto Reddit programming and he got like 2,000 upvotes, which is massive. So basically his database said no and he got crushed, his website. But apart from that, last year I had this idea about C++ 18 and there was also a moral behind that so that was not
Starting point is 00:22:29 all the crazy idea because you could at that moment you could at that moment test various C++ features that would go maybe into C++ 20 and with this deprecation of RAW pointers,
Starting point is 00:22:46 there's also a moral to that because right now in modern C++, you can't go away for many times without RAW pointers, right? So you have smart pointers, you have all of the wrappers and you have also references, right? So those that are in C++ for ages.
Starting point is 00:23:07 So basically, the moral of that story is while I don't see that it would be possible to remove raw pointers from the standard because that's how it is, but we have good alternatives today and we should use that, right? So I think that in core guidelines, right, mamy dzisiaj dobre alternatywy i powinniśmy je używać. Myślę, że w składach core jest mocne
Starting point is 00:23:30 opinie, że nie powinniśmy używać new i delete. Jeśli chcemy zbierać jakąś pamięć, to może potrzebujemy tylko kontajnera, czyli stód vector or add other container. So yeah, so the moral is that while that would be quite crazy idea, but still maybe in modern C++ you shouldn't be using raw pointers that often, right? So maybe people got attention to that. So I thought I saw that this idea proposal, whatever the April
Starting point is 00:24:10 Fool's version of it, actually ended up with an official paper number, or was I reading something different? No, I don't think there was a paper. In my blog post I specifically avoided putting any papers
Starting point is 00:24:25 because there was no paper. We only linked between our blog posts. So in my section, in my paragraph, where I sort of specified that, I linked to Rainer's article and he also linked to other blog posts so we have this circular reference in our links
Starting point is 00:24:50 so I specifically avoided I don't know because I don't recall all of our blog posts maybe someone mentioned that but from my point of view there there was no paper on that. Maybe you should propose that. So for sure, I don't believe while we can avoid a lot of raw pointers in sort of client's codes, I don't believe we can go away with them in library, right?
Starting point is 00:25:21 So all of the iterators and those kinds of stuff are based on pointers. So I think that if you are a library developer, then living without pointers would be even harder. Yeah. So on the topic of your blog, how often do you normally post? What's your regular schedule or do you have one? So I try to post once per week. So that's that that's my
Starting point is 00:25:49 idealistic schedule. But but it's not that it's not that easy. And and and often I go into into like once per two weeks. So so it's I try to do like three between three and five articles per month. So that works for me. Also, some time ago, I think it's like a year ago, I also started my newsletter. So it's around 5,000 people at the moment in that in that in that list so and then and and i i write weekly to that really weekly to that to that to that group so even if i don't have even if i don't have the article then the new article i i still mention some news or or some good stuff from C++ world. So that's my plan for today.
Starting point is 00:26:48 So I'm quite lousy in creating sort of buffer for my articles. So even if you are not motivated, you should have at least one or two buffered posts that you can just post them. But it was quite hard for me to do it. I always have planned to do that, but the implementation is not working yet. So, for example, I'm very amazed with Jonathan's Bokara Fluency++ blog,
Starting point is 00:27:21 because he wrote twice per week, which is really, really, really amazing. And you had him on the show before. But in terms of the schedule, I found, because I've moved to that schedule I think like two years ago, at least to that ideal schedule. And before that, I wrote an article where I had an idea
Starting point is 00:27:51 or where I had a sort of, I don't know, search of energy or something like that, or vein. But it did work and I could create some articles. But when I decided to go for a weekly schedule or once per two weeks, I to działało, i mogłem wymyślić pewne artykuły, ale kiedy zdecydowałem się wybrać tydzieński plan, albo raz w tydzień, to to wzmocniło moją produktywność i kreatywność. Bo jeśli masz wydatki, to twój mózg jest w stanie się o tym o tym i wymyślić jakieś pomysły. I to mi się udało. To wzmocniło moją kreatywność w zakresie pomysłów blogowych. Mam około 100 artykułów blogowych, które mogę napisać.
Starting point is 00:28:40 Więc ten skedulizm jest naprawdę dobry. I oczywiście to zm that schedule is really, really good. And of course, that improves your traffic, right? Because if you are more or less consistent, then it works very well. Definitely. And you probably see it also on
Starting point is 00:28:59 CppCast. It's not weekly, but I think that people are used to right so you used to have something on on friday yeah so that's uh so that's that's really really good good stuff so what exactly is in your newsletter um if it's not just you know taking your blog post and emailing it out what exactly goes into a newsletter so so i'm i'm i'm experiment experimenting with with with various forms and so for sure if i have an article then then i i'll add some introduction to that so it's not just like like you would get with rss so automatic that's hey you have a new
Starting point is 00:29:43 new article and that's all i i do some introduction i i do some outro and maybe i ask some questions about that so that's that's that's that's sort of a sort of easy way to to to to introduce the post i i believe that maybe maybe people are are more um more interested in the article when they read some intro from that email. I also mentioned if there's some news around, I think, so recently before Jacksonville meeting, there was some papers about the overall guidance of the overall road overall road for c++ so i i mentioned that so i i read read that very briefly very quickly and and and tried to to to to mention that in my
Starting point is 00:30:34 in my in my newsletter so that was only in in that newsletter you you wouldn't see that on anywhere on on the website so yeah so i experimenting with that. Ideally, I'd like to expand the news section, but it also takes time, right? So I don't have it right now. And yeah, so I'm sort of playing around with the structure. I'm also introducing some good tools if I have a chance to play with them. So yeah, so mostly that. So I think that that's additional value for just being a reader of my blog articles. Okay. So on your website, in your bio,
Starting point is 00:31:18 you mentioned that your first C++ book was C++ in 24 hours. Yes. I'm very curious about that. I've never picked up one of those, like some language in 30++ in 24 hours. I'm very curious about that. I've never picked up one of those, like some language in 30 days or 24 hours or whatever kind of book. Yes, actually, it's quite interesting story behind
Starting point is 00:31:36 because actually I have this book with me. This is quite worn. The Polish translation of it, yeah. This is, of course, the Polish version. It's very worn out because it has like, maybe even 17 or 18 years. So I bought that
Starting point is 00:31:55 together with my two friends. It was before, probably before my high school. So it was my first programming book. And so on this bookshelf that we To było chyba przed moim szkołem, to był mój pierwszy książka programowania. Na tej szafie książek, którą mieliśmy, było wiele tytułów, ale nie wiele o C++. To był pewnie tylko książka na poziomie początkowym. beginner's level book. At that time, we were playing computer games and I think that we thought
Starting point is 00:32:28 that C++ is quite good for gaming. So we picked C++ as the first programming language. So we chipped in and we bought that book and the story is that out of those three guys that bought that book, two of them are actually programming right now. So that's actually quite a good
Starting point is 00:32:52 ratio. Later I bought the full shares from them for that book, so that's my... So this is only my copy right now
Starting point is 00:33:06 I think that's a good ratio for a book if you can learn someone and 66% of them is actually then ending up as a computer scientist and even I ended with and stayed with C++
Starting point is 00:33:23 the other guy I think he's more into web development. But still, it's good. And I don't have any issues with that book because it learned everything that I needed.
Starting point is 00:33:39 Of course, I think it's from 99 so it's even before C++ 03. So it's a i think it's it's from 99 so it's even even before c++ 03 so it's very very very old standard but i think that um there is a an updated version like six or seven seven edition that mentions for sure c++ 14 i'm not sure about c++17. And of course, the author is Jesse Liberty, who is a well-known author. And I think that even on the latest
Starting point is 00:34:11 copy, he's the co-author, because he moved, I think, more to .NET languages, but still he named that book. I believe Jesse Liberty is an amazing author, so I got lucky to be introduced to C++ through that book, I think.
Starting point is 00:34:34 Cool. Hey everyone, quick interruption to let you know that after running our listener survey, we have decided to start a Patreon page. We are still planning to support the show with sponsorships, but if we get some additional support from patrons, we're going to look into improving page. We are still planning to support the show with sponsorships, but if we get some additional support from patrons, we're going to look into improving the audio quality of the show and more. So, if you're interested in supporting the show
Starting point is 00:34:51 directly through Patreon, check us out at patreon.com slash cppcast. I wanted to ask you about a series of blog posts that you wrote on C++17 last year, including this post on simplifying C++ wrote on C++17 last year, including this post on simplifying C++ code with C++17.
Starting point is 00:35:09 What are some of your favorite new features for simplifying code that you're writing about there? The whole series was quite interesting because I picked a schedule every two weeks. I will create an article about that.
Starting point is 00:35:25 And I ended with like eight articles about all of the features. So the thing was that I often needed to read most of the papers because at that time there was no books about C++17 or examples or other articles. So it was quite an interesting experience and also a motivating experience to that. the feature that are more most popular is actually not maybe the language feature that we have. They of course improve the ability to write more expressive code but the library features.
Starting point is 00:36:20 Even I run a survey on my blog asking about experience with C++17 I nawet robię badania na moim blogu, pytając o doświadczenie z C++17. I jedną z najpopularniejszych funkcji były te opcjonalne warianty, wioski struktur, i pewnie nawet szukacze struktur, i oczywiście systemy fili. Ponieważ dzięki biblioteki searchers for strings and of course file system. So actually because
Starting point is 00:36:46 thanks to the library we can actually do more tasks, right? So it's among... on the second side we have language features like and amazing feature of course expression if and but still if we have more libraries and more tools from the library we can do more stuff through that. So yeah, so those, if I can expand, so I believe that in terms of simplification in general in modern C++ and in C++17 we have like four features for main points so the first is the language so things like if-consexpression, those structured bindings
Starting point is 00:37:40 then template deduction for classes and I things, then template deduction for classes. And I remember a quite powerful sentence from one conference, from CodeDive conference in Wroclaw. And there was a talk about C++17 and the author of the talk is Mark Isaacson, I believe. And he explains if-cons expressions. And he basically told that before C++17, you had all of the crazy and quite complicated expressions to write if statement, bo wszystko, co robisz z Enable if czy tag dispatching, jest w zasadzie wyrażaniem if, jeśli na czas złożenia.
Starting point is 00:38:37 I wierzę, że nie jestem ekspertem w templacjach, a dla mnie czytanie tego kodu jest template expert. And for me, reading that code is quite hard and I believe for beginners or even intermediate people, it's quite hard to get everything and then write the same code. But with EFCON's expression,
Starting point is 00:38:59 then you have... So Mark Isaacson mentioned that they lowered the need of magic in C++. So this idea of reducing magic, actually, I remember that quite strongly. And that's true about the standard. So we have more and more features that actually reduce the need to be full metaprogramming experts, right? And so that greatly simplifies the code. And so that was the first point.
Starting point is 00:39:40 So in general, language features. Also, there is this inline variables that you can basically write header-only libraries. And the second part is the standard library itself. So as we've talked, so things like file system, threads are, of course, from C++11, but we have more and more additions to the standard.
Starting point is 00:40:15 We have those parallel algorithms that got introduced, and we can expect more stuff in in in a later version of c++ 20. and so so the tools and then we have we have so that was stl and and the library that that you can do things with that and then we have then we have the tools and especially i i think that that we have a great year for for tooling że mamy świetne lata na wsparcie. Wiele czasów słyszałem, że C++ jest bardzo trudny do zanalizowania. I to prawda, ale mamy teraz prawdopodobnie potencjalne potencjalności, aby zniszczyć kod, a potem dodawać użyteczne dodatki do naszych idei, do naszych kompilerów. and then add useful additions to our IDs, right, to our compiler. So Visual Studio, I'm sort of glued with Visual Studio
Starting point is 00:41:12 because that's my preferred environment. And I'm really impressed with the pace that they are releasing. So we have like six versions or even seven versions right now with Visual Studio 2017. And before that, for Visual Studio 2015, we got
Starting point is 00:41:35 maybe three major updates. We have now seven for Visual Studio 2017. Yeah, so that's... And oni również, zamiast inwentywowania, jak Microsoft Visual Studio, zamiast inwentywowania nowych funkcji, oni też przynoszą inne narzędzia,
Starting point is 00:41:58 takie jak CMake, zrównoważone CMake do Visual Studio. Więc to było dla mnie bardzo użyteczne, ponieważ często, gdy zbieram coś z Githubu, to tylko mam CMake. To było dla mnie trochę... Może nie trudne, ale zaskakujące, aby wygenerować solution Visual Studio
Starting point is 00:42:23 przez CMake. Teraz Visual Studio wszystko zauważy i robi wszystkie rzeczy w zrównoważonym środowisku. Więc jest to coraz łatwiejsze z użytkami. Oczywiście są inne. Zauważyłem, że to głównie z powodu Clang, ponieważ Clang pozwala na używanie infrastruktury Clang, która jest super, nie wiem z perspektywy kodera, ale jak wiem, jest to dość łatwo do rozwoju. Możesz zbudować wiele analizatorów na zależności od tego, więc możesz w teorii łatwo rozwoju to i zbudować swoje narzędzia wokół Clang. a lot of analyzers on top of that. So you can, in theory, easily extend that and build your tools around Clang. So that's really, really powerful.
Starting point is 00:43:11 And so we have, even in Visual Studio, we have Clang power tools, right? So we can run Clang tidy, Clang format, and just compile that with Clang. So I think, in general, we have a good year for tools. And the fourth point I think is the community, right? Because there are so many good sites and we have CPP ESO org that you can follow. So you can basically learn C++ quite easily today with a lot of great
Starting point is 00:43:50 content and great communities. So I think that's also a good addition here. So I basically expect to have more. Yeah, I mean, I agree. We're definitely seem to be in a renaissance of uh great c++
Starting point is 00:44:07 content right now um john tell us maybe maybe even for some people it's it's too too fast right because often yeah often i'm also not using c++ 17 in in production unfortunately. We are sort of between C++11 and 14. But I see that a lot of people are even before C++11, right? So if they see that, I don't know, concepts are coming or ranges, so they even haven't adopted, I don't know, standard threads, right? So for them, keeping the pace is quite, might be hard, right? All right. So you were just talking about working in production.
Starting point is 00:44:52 Do you want to tell us a little bit about the work you do at Zara? Yes, sure. So as a little background, Zara is a relatively small company. It's around 50 people. It's supported by a larger company called Magix. And Xara as a company started in the 80s. So I think it was 1980, 81 actually it was founded. And from early days it was involved into graphics and they released vector graphics editors.
Starting point is 00:45:33 And then later, I think it's from the beginning of 2000, we have powerful document editors. So it's not only the vector graphics and photo editing. Basically, you can now create any kind of document. So whether that's a booklet or photo editing or vector graphics or even websites, you can create using Zara Designer. So that's the tool. And I'm C++ developer. So I work mainly on Windows platform. So for those desktop products. And as you mentioned, mainly in the text area. So things like, because actually text is probably the most complicated thing at the moment in sort of that we develop.
Starting point is 00:46:33 Because the text flow itself is quite complicated. So we have several algorithms that can produce a nice layout. But actually positioning the text itself is quite, let's say, simple. But if you include graphics into that, so ability to flow text around the graphics or embed the graphics, so embed a picture inside, then things are getting more and more complicated.
Starting point is 00:47:16 And of course, you have the flow, right? So the ability to flow text from one page to the other. And of course, it's also performance intensive, right? Because if you have like, I don't know, 50 page long document full of text, then calculating the proper flow and the proper layout is quite... So it's basically a lot of data to process. So I was responsible for things główne funkcje, na przykład, aby paragrafy zostały razem. Zazwyczaj, jeśli masz heading, a następny paragraf, czyli title heading i introduction, to zazwyczaj chcesz je razem zostawić. some introduction paragraph, then you usually want to keep them together. So you don't want to end up in a situation where this heading ends up at the bottom of the page, and that's the last thing, and then the paragraph itself is on the second page. So you'd like to keep them together. And of course, there are situations where you have a paragraph and
Starting point is 00:48:25 you want to keep all of the contents of the paragraph together on the same page. So that's super complicated because for instance if you have a text that can flow around between pages as it likes. So for example if, if you, let's say, have a word at the beginning of the page and then you change the font size of that word, then, for example, to a bit smaller font, then it might happen that it can flow back to the previous page because it can fit there, right?
Starting point is 00:49:04 Because it's a bit smaller, so it can fit there. Or if you have longer word at the top of the page, and then you insert the space, right? So basically you break a word. And then that smaller part maybe can go to the previous page. So even if you are editing, let's say, one word in the middle of the page, then it's not that easy just to format and recompute what's further from you, so the next position, because you also have to look back on what was before.
Starting point is 00:49:41 So of course we have some optimizations because it would be quite complicated to recompute, like in this 50-page document, recompute every letter every time you insert a new letter. So we have a few optimizations on top, but still it's quite a complex area. So that's quite complex area. And yeah, so that's quite challenging. The next thing that I implemented, it was implemented a long time ago, like even 10 years or more, the flowing text around the graphics, right? So it's relatively easy if you have a text area that is wide and it has the same width in all of the places.
Starting point is 00:50:32 But if you introduce a graphics like a photo and you would like to flow text around, then different lines have different widths, so formatting space that they can fit text. So then the computations are even harder because you need to compute that space. And then you have the thing called anchored repelling, which is even more complex because it's the problem where you have a graphics and you anchor that to text. So basically, if your text moves, flows down, then the graphics is also flowing with that. Right.
Starting point is 00:51:23 And you can repel that, right? So even if you have, like, anchored, let's say, circle, a circular image, and then it flows with the text, and it also at the same time repels the text around. So it's basically we are using some crazy iterative approach to handle everything. I haven't implemented that and I hope not to fix any bug in that because that's very, very risky. But recently we've introduced a feature called Text Inside. This is related to rappelling because it allows you to flow text inside any shape.
Starting point is 00:52:09 So if you have like the circle, then you can put text inside and it will nicely flow to all of the edges of the shape. Yeah, so those are quite funny things that you can stumble across text programming. Wow. In addition to anchoring around images, I know I've heard of the concept of kerning.
Starting point is 00:52:34 I'm guessing you have to do a lot of work on kerning within text, right? Actually, I was lucky not to implement that because this is basically a font data. So actually, my colleague is expert in font handling and this gets really complicated because font, it's not just the description of the glyphs, so not just the points that make the shape of the letters. As I've noticed, font, especially those true type fonts that we are using right now have sort of like their own language that they use to describe a lot of ligatures stuff, so basically font substitution rules. So like if you have like FFI then it can be substituted with nicer glyphs.
Starting point is 00:53:45 So you can exchange a few letters into one nice glyph. Even there are features like squashes and ornaments, some historical ligatures and styles. Those are called stylistic sets. Yeah, so basically the font is covered with the data of the glyphs and the rules that you can, you should actually use to process the font and display that because often if you have one character,
Starting point is 00:54:22 then you need to do all of the processing, even contextual processing. Jeśli masz jedną postać, to musisz zrobić wszystkie procesy, nawet kontekstowe procesy. Zazwyczaj postać wygląda tak, ale jeśli jest z związaniem słów, a masz konkretne słowo, to jest to zmienione na inną postać i inne glipsy. then it's substituted to a different character and different glyphs. So there are a lot of complicated rules that are hidden inside fonts. So you basically need to create a parser to analyze that and then quickly render that, right? Because that's also important. So we are basically working on bringing all of the TrueType font capabilities to our text formatting engine.
Starting point is 00:55:15 And the other thing is, for example, hyphenation and dictionary processing. So often you can break a word and then put a hyphen at the end and then you have a possibility to create a better layout. So that's also another part of working and creating hyphenation and enabling hyphenation engine was also not that easy in our products. Jason, do you have any questions? No. Sorry, my voice is wearing out. Actually, you need a few years to understand the details.
Starting point is 00:56:06 I'm in Xara for three and a half years, and I can say that I'm starting to understand what's going on. But it's quite a challenging area. Actually, you hear a lot of about about those complex algorithms that are sometimes used and document editors and all of the graphics problems are filled with those complex complex algorithms so that's so if you want to grow and you like graphics, then that's a very interesting area. And it's, of course, different than, for example, gaming, right? And creating game engines,
Starting point is 00:56:52 but still very, very fulfilling and covered with a lot of interesting topics. Interesting. Interesting. One thing that I could add is that we recently released a product called Zara Cloud which is basically an online version of our powerful document editor. So previously you could use that only on Windows but right now
Starting point is 00:57:24 we have a powerful web application that is backed up with our modified version of the desktop product. So basically, inside any browser and any operating system that you have, you can use most of the powerful features that you have. So I don't know if you can put the link, but I hope that you can put the link to the demo document that you can easily create with our software. So that's basically a flowing text in two columns, uh, with, with all of the crazy repelling, repelling around.
Starting point is 00:58:07 So, and that's, that's a wheezy week. So you can, you can, uh, even, uh, a non experienced,
Starting point is 00:58:12 uh, uh, user can, can, can, can create a document like that and export to a website or presentation or text document, whatever. So that's,
Starting point is 00:58:22 so that's, that's really, really good. Um, good really good product. Yeah, we can absolutely put a link in the show notes for that. You also run a local users group in Poland, right? Do you want to tell us a little bit about that? So actually, I'm not running that.
Starting point is 00:58:39 I'm not the author of that. So actually, that's my friend. But so I can get, I have some insights about that local group. I was very, very, very surprised, positively surprised to see that Krakow starts local group, C++ local group. And other major, major, larger cities in Poland had those groups
Starting point is 00:59:08 already so I waited for Krakow and finally we got that group in June last year so we are quite young so at the moment up until now
Starting point is 00:59:23 I gave two talks for that local group. So one was about, of course, about C++ 17 features. So I gave a summary of those features. And later, actually in March, so it was a few weeks ago, I gave a talk about tools. So it was a bit lighter talk. So it was about Jacksonville meeting because it was Tuesday just cast about Jacksonville meeting helped me a lot because you discussed, of course, I forgot the name of the guest. Patrice Roy?
Starting point is 01:00:17 Patrice, yeah. Exactly. So Patrice also gave me an example for if-cons-expression article that I wrote. So he's very, very nice and nice person that you can ask for feedback and discuss things. Yeah, so I used your show and Użyłem Twojego programu i niektórych notatów, żeby przygotować pewien status C++20. Wtedy też porozmawialiśmy i demo'edłem kilka narzędzi, które mogłem zakończyć. Visual Studio, CMake, Google Test Adapter,
Starting point is 01:01:13 Clang Tools i inne inne. które miałem szansę z nim zagrać. Tak więc trochę lepszy rozmowę, ale wciąż było to całkiem fajne. Jestem zadowolony, że zobaczyłem grupę z Krakowa, ponieważ to pozwala mi mówić z kimś o C++, zwłaszcza, że pracuję na prywatnej stronie, więc to pomaga. remotely, so that helps. Yes, and I heavily invite everyone to participate in their local groups because that's a good chance to grow. We are quite young, and maybe if I have time, I hope to invest some effort into maybe expanding that form, but that's definitely great.
Starting point is 01:02:08 I think that Jens Weller from Meeting C++ gives a lot of support for those groups. So you have basically a guideline how to run them and how to ask for sponsors. And he brings those groups together at least on one website. So that's a good support, right? And that's definitely easier than just, I don't know, shouting and that I want to create a group, right? So that's a more standardized form.
Starting point is 01:02:41 Maybe we should have a paper on that. Yeah, well, we will put a link to the Poland C++ group in the show notes as well, so hopefully help you find a few more attendees. It's been great having you on the show today, Bartek. Thanks. Yeah, thanks for joining us. Pleasure to be here with you.
Starting point is 01:03:01 Okay, thank you. Thanks so much for listening in as we chat about C++. I'd love to hear what you think of the podcast. Please let me know if we're discussing the stuff you're interested in, or if you have a suggestion for a topic, I'd love to hear about that too. You can email all your thoughts to feedback at cppcast.com. I'd also appreciate if you like CppCast on Facebook and follow CppCast on Twitter. You can also follow me at Rob W. Irving and Jason at Leftkiss on Twitter. And of course, you can find all that info and the show notes on the
Starting point is 01:03:30 podcast website at cppcast.com. Theme music for this episode is provided by podcastthemes.com.

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