CppCast - Docker Development and Modernizing OOD
Episode Date: January 27, 2022Yacob Cohen-Arazi joins Rob and Jason. They first talk about the first ISO mailing of the year and some upcoming conference dates. Then they talk to Yacob about his experience building and running doc...ker containers for C++ software development and his work updating code examples for an upcoming C++ Object Oriented book. News Amazon: Copy and Reference Puzzlers Leanpub: Copy and Reference Puzzlers ISO January Mailing C++ Discord Bot Library CLIon UX Study C++Now 2022 Call For Submissions CppCon 2022 Call for Proposals for CppCon Academy 2022 Classes C++ On Sea 2022 Call for Speakers CppNorth Call for Papers Links San Diego C++ Using Docker with CLion Sponsors Indicate the #cppcast hashtag and request your PVS-Studio one-month trial license here https://pvs-studio.com/try_free C++ tools evolution: static code analyzers: https://pvs-studio.com/0873
Transcript
Discussion (0)
Episode 334 of CppCast with guest Yaakob Kohan-Orazi, recorded January 26, 2022.
Sponsor of this episode of CppCast is the PVS Studio team.
The team promotes regular usage of static code analysis and the PVS Studio static analysis tool. In this episode, we talk about the first ISO mailing of 2022.
And we talk to Jakob Cohen-Oraz.
Jakob tells us about running Docker containers for C++ development and its work on an upcoming book.
Welcome to episode 334 of CppCast, the first 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 all right, Rob. How are you doing? I'm doing all right. Yeah.
You have anything you wanted to talk about before we get started today? Well, I just
made my second puzzle book live on LeanPub like 10 minutes ago. Is this one the same
like format as the first one or is it different? So the first one was Object Lifetime Puzzlers
Book 1. This is Copy and Reference Puzzlers Book 1.
Copy and Reference Puzzlers, okay.
Yeah, so the point of the first one was to like
kind of instill like what the different
Object Lifetime categories are
and different types of Object Lifetime are in C++.
This one is, you know, I see when people are learning C++
that if they particularly come
in from Python or something, then they expect like a parameter passed to a function to be like a
reference. Or, you know, like, we do copy by default, not reference by default in C++. So
it's just a bunch of little puzzles that help you kind of play with that. So that's book one of this.
I just put it up on LeanPub like five minutes ago.
Hopefully by the time this airs,
it'll be up on LeanPub and Amazon for sale.
Double checking with my reviewer
to make sure it looks good for print publication.
Yeah.
Awesome.
Get the link once you have it
and we'll put it in the show notes
so listeners can go check it out.
All right.
Well, at the top of every episode,
I like to read a piece of feedback. got this tweet from p vonied saying interesting that f sharp gets a mention in the
latest cpp cast episode i like and yeah we did briefly talk about f sharp which is merit's primary
language at least that's what she was working on currently. And I don't think we've talked much about F sharp.
We've done like an episode on C sharp, but not F sharp.
I don't hear about it as much anymore.
Yeah.
I got momentarily confused because one of my meetup members is F sharp
developer presented my meetup a couple of years ago.
So I was thinking that that was like, Oh yeah, of course we've talked about it.
I don't know. That was my meetup. those different virtual heads at the time you know okay the
meetup they did a presentation on you know f sharp uh-huh oh okay yeah that's good cool well
we'd love to hear your thoughts about the show you can always reach out to us on facebook twitter
or emails at feedback at cbbcast.com and don don't forget to leave us a review on iTunes or subscribe on YouTube.
Joining us today is Jacob Konorazi.
Kobe is a principal software engineer in Qualcomm, San Diego,
where he works on the next generation of 5G cellular and radio access networks.
In the past, he also worked on machine learning, automotive, Wi-Fi, and 4G domains.
He's a father of three kids, where the oldest one is a sophomore in CS
that is still not fully committed to learning C++.
Kobe is currently working with Dorothy Kirk,
upcoming new C++ object-oriented book,
and helping Dorothy to modernize the C++ code.
He's been running the San Diego C++ Meetup for the past three years,
where he presents various topics that hopefully help others
to write better C++ code.
And in his spare time, Kobe likes riding his road and mountain bike
as well as swimming,
not at the same time, of course.
And he usually listens to CppCast and other podcasts
while walking his dog, Julia.
Kobe, welcome to the show.
Hey, guys.
Thank you for having me.
I'm super excited.
I think you need to invent a new sport
that involves mountain biking and swimming simultaneously.
It's a good idea. simulathon or something the triathlon right is biking running and then swimming i believe
you know i mean like at the same time that'd be difficult i don't know about underwater
biking that would be hard there's got to be some way to sort it out maybe like a paddle board with like pedals or something basically yeah we'll
work on that so actually i want to comment or ask you about your three years of running the
meetup now that seems like you got started at a slightly awkward time given you know, COVID and all that? So 2019, so I had about a year of no COVID,
normal stuff and in-person and later,
but I started with kind of 70 people
and it grew to more than 1,000.
And we had an in-person meeting
for about almost a year
and then COVID hit us
and we went completely virtual.
So how many people were coming to your in-person meetup then?
So it was about 10 to 15.
Marshall Klau was one of them, by the way.
We used to work together in Qualcomm.
Lots of stories with Marshall.
And then you have managed to keep it going
for the last two years virtually?
Yes, yes.
It's not easy.
I spend significant amount of time
to come up with topics
and I just don't want it to die.
It's super important for me that San Diego,
and actually we have guests from,
or participants from other
locations, not only in the US actually. And it's super important for me to keep it alive and
keep it running and continue with the momentum. In CPPCon 2019, I think I had opportunity to
sit in a group of people. And what's the name of the guy from meeting c++
yeah he gave an excellent talk and that actually helped me to overcome all the difficulties
especially in covid time make sure that it's running even if you think that people would not
show up and all every session people showing up and I have a good amount of people coming
to the to the virtual event and definitely encourage me to continue.
That's it.
I think we're really lucky as people's community because it seems like a lot of these
user groups have gone virtual and been really successful out of Jason.
I know yours is still going strong too.
I was talking to a coworker who runs a.NET user group in Colorado recently, and he was saying
how when the pandemic started, he tried to make it go virtual and send out an email to the hundreds
of registered user group attendees. And like 10 of them responded, and most of them said no,
they didn't want to go virtual. That's the user group that I know about. It was probably the
largest programming user group in Colorado
when it was in person.
Because there's one that was big, and they would
get official, like the local
Microsoft office would help them out sometimes
with sponsorships and stuff.
Being.NET user group, it's the one I'm thinking
of. Then, yeah, that's kind of
surprising to me that it just went...
Yeah, definitely. I'm not sure if it's the same one.
There could be more than one in Colorado,
but yeah, I thought that was surprising.
Yeah.
Yeah, I think we have an amazing MCBus community.
I get a lot of positive feedback from a lot of people
and we have amazing people in the community.
Obviously, I meet most of them on Twitter,
but everything happens on Twitter.
I noticed you recently changed your Twitter profile picture
to actually be your picture.
Is that right?
Yeah.
The previous one was from Fallout 3.
I used to be a gamer 10, 11 years ago
before my daughter was born.
She was born and then no gaming for me.
So I started doing more and more C++.
All right. well, Kobe,
we got a couple of news articles to discuss.
Feel free to comment on any of these,
and I'll start talking more about your work on the user group
and also Docker containers and a couple other things, okay?
All right, so this first one we have
is the latest ISO January mailing,
first one for 2022.
A lot going on here,
and this must be one of the last mailings
we're going to see before C++ 2023 is finalized,
I think, right, Jason?
Probably.
Kobe, you're involved in the standards process too,
aren't you?
No, I'm not.
I don't have time.
I wish I would, but...
I was reading through the direction for ISO C++.
It's the third revision.
And I don't think we've discussed this before,
but I was looking at it and they do have a note here about ABI stability
and how there's either going to be or now is an ABI review group.
And I thought that was a good thing that instead of just, you know, one person in a meeting being able to say like, oh, no, that's an ABI review group. And I thought that was a good thing that instead of just, you know,
one person in meeting being able to say like, Oh, no, that's an ABI break, like they actually are
going to have a group to discuss it, see how significant of a potential ABI break it might be,
actually, you know, talk about it instead of just striking down a proposal.
Hopefully, it will be a better process. Yeah, I'm not sure when this was, because I thought we had covered some version of this paper before,
but I'm not sure now. It's R3. I don't know.
So that was not added with this revision, at least. They are adding
there's now going to be a safety and security review group, and also a C
and C++ liaison. So that's another thing that makes sense, since apparently
C is still getting lots of improvements themselves, and we need to make sure we keep up to speed.
Yeah, on that note, there's at least two papers in here that are just C papers that were also
published to WG21. Yeah, I didn't realize that there is also C walk as part of this
working group. So it was kind of new to me.
I think it's the first time that I've directly noticed C papers published here.
But I mean, they always have to consider interoperability between the languages, right?
Whenever C does something, we at least have to be aware of it.
Yeah.
So there is a lambda for C, for example, that I'm seeing here.
Yeah, that's exciting.
Any other papers either of you wanted to highlight or talk about? So there is a lambda for C, for example, that I'm seeing here. Yeah, that's exciting.
Any other papers either of you wanted to highlight or talk about?
There's so much stuff that jumped out at me on this one. I would just sit in here.
I spent too long staring at it.
So Hive, we had Matt on six years ago.
We had him on twice.
I think we may have.
Oh, maybe.
Revision 18 of the paper to get Hive on into the standard library.
But then there's a second paper from Matt Bentley here.
Did you all notice this?
No, what was the second one?
The second one is P2523R0.
Request for re-inclusion of Hive into the C++23 consideration.
It's an interesting read.
I don't want to go through all of it or anything.
But Matt has been working hard on this proposal for a very long time
and has addressed all of the feedback that he's received during this process.
There's one paragraph from the request for reinclusion
that I just wanted to read,
and perhaps I'll regret this later in my life,
but it says,
this paper has only been discussed in a tentative way
on the LEWG mailing list
since most of its review period
was taken up by discussion of the name,
which is now considered resolved.
All right, I am done.
That is what I wanted to read.
Well, hopefully he gets his chance of having it reconsidered.
Yes, it seems like some things are a very difficult uphill battle
in the Standards Committee.
Anything you wanted to call out, Kobi?
Well, I always like to see contains,
so std ranges contains is there,
and a few debugger-related stuff.
Is debugger present at std breakpoint?
That really surprised me.
I mean, because officially,
the C++ program doesn't even run on a computer, right?
Officially, it runs on an abstract machine, right?
Yeah.
So is the standards committee going to be willing to admit
that debuggers exist?
Like...
Yeah.
Next thing we have is a GitHub repository,
and this is a bot library for Discord,
which is written in C++.
I'm on a couple of Discords.
I'm not too familiar with bots or what it takes to write one of them,
but it's nice to know that you can do it in C++ using this library.
I don't know what other languages are primarily used for bots.
Does anyone know? Anyone look into this before?
I have no idea. I know that there is
a compiler bot where you can give it code snippets and it will compile on Discord. But even though
I've added it to my Discord for my patrons, I've never actually interacted with the bot. I have no
idea how it works. Does that interact with Compiler Explorer, or is it just...
Well, Matt's the one who told me about it.
Other than that, I don't know.
I honestly don't know if it interacts with Compiler Explorer or not.
Yeah, by the way, I think the library files are checked in.
I think there is a different repository that compiles the library files, if I'm not mistaken.
So I think you can still take this repository and build it.
But if you want to look at the actual library files,
I think there is a different repository.
Oh, I see. Yeah, there's a bunch of DLLs checked in here.
Yeah, yeah, exactly.
And it's just kind of fascinating to see someone
who's primarily targeting Windows
because that just happens
less often. Look at the top level and say, okay, where is the CMake?
Oh yeah, that's a good point. There is no top level CMake here. Property sheet.
Wow. The next thing we have is that Sea Lion has a research study.
JetBrains is putting this out.
They're trying to get some feedback on Sea Lion.
And if you sign up for it and do the study, you might get an Amazon gift card, which is always great.
So if you're a Sea Lion user, you should definitely check this out.
No, no, no.
It's for people who have never used Sea Lion before.
I read that wrong.
Then, yeah. Everyone, go
check this out if you've not used C-Line.
Okay. Go use C-Line for
10 days. If they accept you, use
C-Line for 10 days and you'll get a $200
Amazon gift card and
a JetBrains all-product pack subscription
for the year. Oh, wow. That's a really
good deal. It is.
Not everyone's going to be accepted, I assume.
I really, really like CLI.
I'm not getting any money out of this,
but it's really improved productivity.
I think the whole package with the CMake integration
and Clang Tidy and all of that,
it's just amazing.
Font and debugger, all of that is a great package.
And we can talk about Docker and how we use ID with Docker also.
That's another thing that I'm doing on a daily basis.
Well, for me, if I'm doing refactoring of a client's code base or something,
and to be able to...
I mean, I have done refactoring by grep a million times,
grep and sed, in my career.
Like, okay, it took me 10 minutes.
I made the expression I needed, and now I can change 50 files all at once, and it doesn't break the code, right?
Like, that's cool.
Saves a bunch of time, but being able to, like, click on an identifier and change its name in CLion is even faster than writing a set expression to do it for you.
Yeah. We all be in there, Jason. sea lion is even faster than writing a set expression to do it for you.
Yeah. We all be in there, Jason.
All right. And last thing we have is a couple conferences that are coming up have various deadlines. Jason, do you want to run through these real quick?
Yeah, let's do a quick run through them. John Kolbs sent out an email with all of these deadlines in them.
But also, Phil had asked me to talk about the deadlines for C++ on C coming up, too.
Anyhow, so it's all here in one place.
So C++ now, call for papers.
When does that end?
That C++ now 2022 is May 1st through the 6th.
That will be on site.
They have no provisions at all for it to be remote
at this moment. You are required to have a proof of vaccination at this point. When does the call
for papers end? January 30th. So in this airs, you'll have like a day. Yeah. The next one, CBP
Con call for classes is up. So if you want to teach a class, one or two day, pre or post conference class,
a CBP con 2022 in September in Colorado, I'm pointing in the direction of the conference
center, by the way, it's right back there, then you need to get that submitted by January 31st.
So that's also in just a day or so once this goes live. C++ on C 2022 is also planning
to only be physical in-person event. And that is going to be February 6th is when the call for
papers closes. Yes, but we didn't mention when the actual dates were, did we? Oh, and early bird tickets are currently on sale for C++ on C.
25% off discount.
Last thing is the CPP North, which is going to be July 17th.
Toronto.
It's also soon, which is why is LinkedIn here?
February 21st. We put them in order. You have a little bit more time for this last one. Yeah. But let's thank John called for that because the email that
he sent me had them all in order and I copied and pasted it. So Kobe, let's start off with the
original reason why we reached out to you because you were chatting with Jason on Twitter about your use of
Docker containers for, you know, debugging and building C++. Can we talk a little bit about that?
And what's your process? Why you do find it easy to use? Because I guess, Jason, you've never tried
it or thought it would be more work than it's necessary. The conversation, I'll give a summary
of the conversation. Kobe said, that seems like the perfect use case for Docker.
Why aren't you using Docker?
And I said, why would I use Docker?
That seems silly.
I think that's a pretty good summary.
So go ahead and explain.
I think what I said is give me 15 minutes
and you'll be expert on Docker.
And so just a question, do you guys know about Docker, like the containers, I would
say, the technology? I can start with like a very quick overview on that one. I think for the sake
of our listeners, it is worth doing a quick overview. I have created and launched and logged
into a couple of containers. That is the extent of my experience. Okay, so first of all, containers, isn't that something new? I personally started using containers around 2003, I think.
So, C-H-Root or Troot, I don't know what's the best way to pronounce it,
was my first container.
Multiple types of containers.
Most of us know is Docker, Docker container.
And I think what happened is that Docker just become kind of the ubiquitous
container and everyone knows about it and everyone is using it. It just become very accessible and
easy to use. And again, Docker just made it this way. So it's easier to use for the end users.
You probably hear about Docker image or Docker image and container. So basically the way I kind of teach others
is like the image is basically a type of,
it's a blob and I'll explain what does it mean.
And the container is basically
when you run this image,
come in instance,
and then you can actually do something with it.
So the image is basically just a blob
that sits on your file system
and the container is a running instance of this image.
So whenever you want to have a sandbox, or I would say whenever you want to do something
that might clutter your file system, I would say reach out to a container, to a running container,
or kind of a Docker or similar technology. And if you are familiar with virtual environments
and similar technologies,
let's say Python has virtual environment.
And Conan, by the way, is the same thing.
What do we want to achieve?
We want basically to make sure
that we don't clutter our file system.
If I want to have multiple compilers
or multiple libraries
and they might conflict with each other,
installing and cluttering your file system is usually not a good idea.
You want to make your host file system as tidy as possible and have all your various
experiments or projects contained in kind of sandboxes, and they can leave in their
own containers without cluttering your host file system.
So again, Docker is one way to do it.
And as I mentioned, Conan is somehow, for me, very similar,
resembling kind of the virtual environment of Python.
So how do you actually end up with an image that you can run?
So Docker has this Docker file, which is very, very simple text file that explain or describe
how you build your Docker image. And it has a very, very simple syntax. Each line would be a
command and you'll say, I want to take a base image of whatever, let's say Ubuntu. So you take a base image, which is basically
a very simple file system of Ubuntu of specific version. And then you say, okay, I want to do APT
of this specific set of packages. And I want to maybe git clone something and run CMake and install it on my image.
Basically, everything happening in build time.
And then you say, okay, I have this Docker file.
It's just a text file.
It's kind of confusing, the Docker file.
There's the image and there's the Docker file, the text file.
So when I say Docker file, it's the text file that describes how you're going to build your image.
And there's a lot of cool things that you do.
You can build whatever you want, and it's pretty flexible.
Eventually, you'll get a blob, an image.
And there's a lot of things to know in order to be kind of more of an expert on this technology.
Like every line would be a layer.
And basically, it's kind of a layered architecture that multiple images can actually share the same layer.
So this is kind of everything.
When you run the container, you build your image, and you run your container, all the file systems are immutable.
There is this copy on write part where if you want to change something in your file system, it will make a copy.
And this is kind of the container layer. The running container layer is going to be the one
that you're actually changing. So again, the motivation is pretty clear. You want to have
something that you can play with. You can do whatever you want. And you know it's not going
to damage any of your external file system. And I think it's a really, really powerful process when you want to do all kinds of experiments. Obviously, it's what I call a
file system virtualization. I can have something even more sophisticated, like you have a QMU
running something which is kind of emulating our container. So that's also possible. But
usually, almost 100% of the time, I'll have a file system virtualization
as opposed to, let's say, a full-blown VM,
which has everything, right?
It has the kernel and all.
If I don't have any need to virtualize the kernels,
I'm going to reach out to a Docker image
and Docker container.
And it's so lightweight.
It just runs instantly.
And I don't feel any issues.
Now, here's the nice part of this whole process
is that I have an example of,
we were writing a very nice,
sophisticated C++17-based application
and it needed to be kind of a cross-platform.
It's going to be a Ubuntu, Linux, Linux and Android,
and also needs to run on Seegwin.
And I don't like Seegwin.
Seegwin is, it's like a toy.
They did amazing thing.
And I started working on Seegwin
before it has an installer in 1999.
But it looks the same as POSIX and all,
but there are so many differences that you discover,
especially with threads and timers,
it just doesn't work well.
And the easier way is basically have your application in a container
and then you just put it on your Windows.
Obviously, it's not going to be just a file system virtualization docker desktop would make this basically there is a full ubuntu
kernel that it's going to run so it's a real vm but to be honest it just runs much faster than
than running it on sigwin that's kind of surprising but it it's the case. So in Docker, you can run the full kernel
and do a full virtualization thing. Is that what you just said or no? So basically the Docker
desktop is running everything, yes, on Windows because I'm running Linux. There's no Linux and
it's not WSL. This is a completely different thing. So yeah, it's going to be a full virtualization on
Windows, which is fine. I never had any issues with what I need in terms of performance and all.
So I would use it every day. I would use containers every day and it would be easier for me to kind of
install a specific tool chain, either Clang or GCC,
and play with it and compare.
And I know that I have something
that's really self-contained.
There is no side effects or anything like this
that can make things kind of weird.
So I guess the main advantages you're looking at
are because of the way Docker files work,
if you want to change from one version of GCC to another or switch to Clang, it's pretty easy to make a new container and just
change that one bit. Yes. And building it is pretty fast because of the layers without going
into too much detail. Yes, yes, yes. Yeah, layers are shared. I would say that before I start using
Conan, and I'm a big fan of Conan, I think it solves a lot, at least for me, it solves a lot of issues that I had.
If I needed, for example, a specific set of libraries, set of packages, let's say before Conan, I would reach out to a Docker container and install everything I need.
I need boost, I need whatever.
And then it would be kind of a self-contained.
Now with Conan, the ability to actually have that,
it's kind of a different dimension of your workspace.
It's not part of the file system that the user includes,
but it's actually in a different place of the file system.
And Conan, with CMake, points to this include path and library path.
So it's kind of make things easier
in terms of dealing with multiple versions
of the packages that you depend on.
But before that, Docker had even more usage.
Today, it's basically just to contain everything.
I can mess up stuff without worry
that I need to reinstall my host or something like that.
So I can kind of
abuse the fire system without any, if I, if something got bad, tear down, start a new one,
and it's fresh. So I personally, and this is where the Twitter conversation started from
everything that you just described is how I use a full featured virtual machine. That's just how I've worked for 20 years. One advantage
to me is that I, well, not 20 years, 12 years. What am I thinking? One advantage to me is that
I've got another system that's more, you know, like my build system that I can run this VM on.
I can connect to it remotely. I can just kick off some compiles and then I can carry on with my day
and it doesn't overwhelm my desktop. I have a couple of questions. What does it look like to actually interact with a Docker image?
If you said you use CLion with Docker all the time, does this
scenario work where I could be running Docker on a different system and
connecting to it with CLion or whatever?
CLion has at least two options
that I'm aware of.
So the traditional option was, and they have tutorial online, so you can go and take a look.
It's pretty short setup.
But one option is you run an SSH daemon on your container.
And then CLion has this setting screen where you can go and set up your tool
chain and one option is a remote tool chain now remote is basically kind of a dual intent you can
have a real like a real remote host right so someone there's a different host running somewhere
that runs ssh daemon and sftp and like that, because there is some file sync that needs to happen
between your host and the remote.
But it doesn't have to be a remote,
like a physically remote host.
It can be your local host that runs a container
with an SSH daemon that exports a specific port.
And you tell CLion, hey, I have this 127.0.0.1 sitting on this port,
just connect to it, and you're running your container,
it runs this SSH daemon, and from that point,
CLion doesn't really know that this remote
is actually sitting on the same machine,
it's just a container.
It just sits as another SSH daemon with a file system,
like this mini machine with a file system and all.
CLI doesn't know anything about it.
Now, I think recently, I can't remember when, but recently CLI also have a, what I think I call it, like a native Docker, where it's another option in the tool chain.
You can say, okay, I want to add
a Docker tool chain. And then what CLion would do, it would go and traverse and kind of give you a
list of all the Docker images exist on your system. And you can say, okay, I want to use
this image. And when you actually build what CLion is doing is basically it brings up the container.
It has all the toolchain.
It recognizes the toolchain and all.
It has this option to do that.
And that's it.
Basically, you build your project with the toolchain that sits in the container.
But there is no SSH daemon.
There is nothing like that.
It's kind of more native.
There are some wrinkles.
There are also wrinkles into the other option.
But for the Docker,
I usually need to pass all kinds of options
to the docker run command.
Everything on the command line,
there are options, right?
The command line argument.
So docker run also has all kinds of options.
Like you can have all kinds of directory mounted
from the host to the container.
So you can reach the host file system from the container.
Usually you can't because it's kind of a sandbox,
but you can say, okay, I want whatever,
like user or something to be mounted
on the container user or something.
So my understanding, and I had some Twitter,
and everything happens some Twitter, again, everything happens on Twitter
with J Brain and ask them if that's something that they're expecting support. And it seems
like they're already working on that. So that makes things easier for me. There are all kinds
of other things that kind of I need to deal with when running remotely with SSHD. Some build system, they need the.git, for example,
and CLion are synced to.git.
So there's all kinds of things that needs to happen.
There are tickets open,
so hopefully JetBrains would look at it at some point.
But yeah, it makes things kind of streamlined
in terms of working with a sandbox.
Jason, one of the things that I would kind of point out
is that Docker is really, really lightweight
in terms of starting and tearing off the instance.
VM is definitely something that people can use.
It just, I feel it's kind of more heavier
on the resources or your local resources.
And going to like to the cloud and all,
Docker is not only for development,
it's also for deployment.
You're mostly going to see
that deployed Docker file
would have what we call an entry point.
It's basically an application.
So the whole container
looks like an application.
When you start, when you do Docker run,
what the Docker file was instructed to do is to run a an application. When you start, when you do Docker run, what the Docker file was instructed
to do is to run a specific application. So things like Nginx servers and similar, they probably do
the same thing. They have an entry point of their application. And when you run the container,
that's what they're actually running. So I guess the last question I have, since we do have other things to discuss,
is if I'm doing Qt development
or I need to launch a GUI from the Docker,
is that possible?
Yeah, yeah.
So remember these options that I mentioned?
So there are a few things
that you need to pass through the Docker run,
like, for example, your X session directories.
But yeah, there are a couple ways that I was using,
for example, running CLion or any IDE.
There are some methods where you,
or kind of processes of development processes
where you keep your entire, let's say, CLion or IDE
inside the container.
They're not running on the host
and connecting to communicating with the container,
but they're actually part of the container.
And then you run the container with appropriate options like docker run command line options so
the x session is set up like display and all and it just runs the x session on your host and
you're not going to feel that it's actually running from the container just saw a tweet about
the i think it was a tweet about the,
it's the 40th anniversary, I think,
of X-Windows, something like that,
like a few days ago.
So 40-year-old remote technology coming to the rescue, basically.
Yeah, yeah, yeah.
It's definitely possible.
I use, to set up everything,
and I'm trying, okay,
is UI works from the container XIs.
Right, right, right, right, right.
Yeah.
Oh my goodness.
Forever since I've launched XIs.
I tend to do like XPDY info or something just to prove that it can connect or something like that.
Anyhow.
The sponsor of this episode of CppCast is the PVS Studio development team. Thank you. CppCast listeners can use the CppCast hashtag to get the analyzer's one-month trial version.
To request the trial, use the link in the podcast description.
C++ projects are getting increasingly complex, too complex for people to analyze them thoroughly during code reviews.
That's where code analyzers come in.
They notice everything the human eye misses, thus making code reviews more productive and enhancing code quality.
Want to know more about the problem?
Take a look at the recent article from the PVS Studio team, C++ Tools Evolution, Static Code Analyzers. The link is in the podcast description.
Maybe you should rewind a bit and why don't you just give us a little bit about how you got into C++ and got into mentoring and everything. I started dealing with C++. I think it was in school. Believe it or not, Amir Kirsch was my teacher.
Okay.
He's an excellent teacher.
I think I owe him because I really liked the way he teach and he's an amazing person.
So that was 98.
We've had Amir on the show for the record for our listeners who didn't know that.
Yes.
Yeah.
So he's from incredible right now.
And I started my professional work, again, with Superstars around 99.
And I started working with a library named Ace.
I don't know how many people are aware of that.
It's the adaptive communication environment.
I think we've mentioned it.
We haven't had a show on it, but I think we've mentioned it before.
So Douglas Schmid,
I think he was maybe still vulnerable to university.
And I think back then,
maybe also today,
kind of the state-of-the-art design pattern
implemented with C++.
And he also wrote the POSA 2,
the Pattern-Oriented Software Architecture Volume 2, that it's all C++. And he also wrote the POSA 2, the Pattern-Oriented Software Architecture, Volume 2,
that it's all C++. It's all communication environment patterns. It's all C++, obviously.
And it influenced a lot on the way I see and see what is C++, what's the benefit,
the power of C++. I think the second thing that actually kind of completely hooked me into C++
was the book of Andrei Alexandrescu.
I think I hopefully pronounced his name correctly.
His book about modern C++, like modern C++ in 2001, right?
Right. Pre-modern C++.
Yeah. I think if people like listening,
if you can just read the first two chapters,
I think that's an amazing,
for me, 2001 was a kind of eye-opener.
Oh yeah, you can do all of that with C++,
all this metaprogramming.
And so since then,
I felt that C++ is for me,
the language that I need to invest time in.
And what I did,
moving from company to company,
and I was taking ACE, I was taking C++
and picking a topic and presenting that.
So that was kind of the beginning of what I do today,
both internally in Qualcomm,
but also in the San Diego C++ Meetup.
I always like to share what I know.
And I felt like it's easier for me to learn things
if I explain them.
So that's always true.
And I think, Jason, you can definitely say
if that's what you feel.
But anyway, from that point on,
I was fully on C++,
though I really looking at other languages today,
like Rust, and I really like Python and all,
but C++ is definitely the number one language for me.
I think the committee, we talked about this item before,
I think the committee is doing an excellent job.
People are spending a lot of their time,
and I really, really appreciate all this hard work
that people are actually investing.
It's kind of amazing.
If you remember back then,
we didn't have, like before 11,
everything was slow.
I remember participating in SD West
and Starswhip and Herb Sutter
used to conduct a kind of two-day
or something like that tutorial.
And people were asking Stas and Herb
why nothing is moving.
We have all these other Java people
mentioning Java.
And Stas was saying, look,
if you want to have something in the startup,
you need to work with it. There is no one actually
sponsoring anything.
And look what we have today.
It's kind of an explosion. It's kind of
amazing the progress that we have since 2006, 2007 to what we have today.
For me, it's amazing, kind of almost science fiction of what's happening to the language.
You've had the opportunity to see the future of technology.
Yeah. And I would say that Herb, I also participated in CPP and beyond, he had a lot of the vision that we see today.
He had that back then, and same for Starsoup.
They had the vision of where the language needs to progress.
And I just remember it very, very well, like what they wanted to do.
And I still see that happening. Every time there's a new big item
or even small item in the language,
I remember someone like Herb or Sarsup
mentioning that they would like to see that
sometime in the future.
I do remember the parallel algorithm,
something that Herb Sider was mentioning.
Actually, he talked about something even bigger,
about I want to run something
and I don't really care where it runs,
can be on the cloud and also that. I don't know if that would ever happen, but we might be on the path for having something like that in the future. You mentioned to us before we got you on
today that you're working with Dorothy Kirk on an update to a book. Do you want to tell us a little
bit about that and your involvement? Yeah. So first of all, thank you for a packet for allowing us to talk about it. The book is not
published yet. And Dorothy is really an amazing person to work with. I'm so happy that I had this
opportunity working with her. She's working on object-oriented programming for 30 years. She's
very, very passionate about object-oriented. By the way, object-oriented is not dead.
I wasn't going to say anything.
I mean... I don't really like the fact that people say,
okay, it's either functional or it's object-oriented.
I think the mixture, I think every paradigm has a place.
And I like combining.
I really like functional programming,
but I also do object-oriented programming on my daily job.
I think the mixture of all of that, knowing what to do when, I think is the powerful thing to do.
Now, what happened with Dorothy and this whole engagement with the book and all.
So she published a book named Demystifying Object- programming with c++ on packet and i have this
tendency that every time there is a book and there's a lot of books by the way published
recently there's a lot coming a lot of them coming yeah looking at you jason looking at you uh
guy and kate and vittorio and all like so so many, like it's fun. And I usually pick up the book and I take a look.
And one of the things that I really want to see is more than C++
because I want everyone, junior and experienced developers,
to kind of embrace more than C++.
So I think that I don't want the technical depth of the old C++
to continue to accumulate in our daily code base.
So I looked at the book,
and unfortunately, I saw that it's not written
as more than C++.
And I had a Twitter post.
Again, everything happens on Twitter.
And I said, okay, it's a bummer that it's a new book
and it's not written in more than C++.
And what happened, Dorothy, which I think it was her first tweet, or maybe she just created the account because someone told her that there is a discussion on her book going on Twitter.
And she was explaining a few things about what was the motivation of not having that as modern.
And a day after she reached out to me, I don't know
how she got my email. I don't remember. It was maybe on kind of instance messaging. And she said,
look, Kobe, how about you helping me to do a second revision of this book? And by the way,
if you complain about something, be ready to fix it. So I have issues to say no.
And I actually thought
it's going to be a great opportunity
and experience working with Dorothy
on a new vision of the book.
It is, and we're still working on it,
an amazing opportunity
and amazing experience working with her.
She's a great person.
And we started with everything,
power define to constexpr,
not having an empty constructor or destructor
if you don't have to,
having override for virtual function derived classes.
Here's the thing.
She really wanted to deal with raw UN delete,
at least initially, beginning of the book.
And we had a lot of discussion. Hey, what about
we go full-on,
make unique,
usually it's make a unique pointer,
and not having a role
new or role delete.
And she was pushing back
a lot, and I definitely see that
why this is probably a good
choice, at least in the beginning
of the book and then moving to much more advanced. I was definitely on the fence because you don't
want people to start writing because they look at the book and start writing one new and delete.
And the problem is that she didn't want to overwhelm a lot of new upcoming people to the
language with all kinds of idioms that might confuse them.
Okay, what is this template? Well, we haven't talked about template, like make unique. What
is this template? And I remember there was a podcast about Rust and this Rust in action
for Manning. The author said, look, I wrote a book. It's not idiomatic Rust. And I'm going to get a hit from Rust developers
that it's not idiomatic Rust.
But I didn't want to overwhelm people right at the beginning.
I think that was what brought Dorothy to realize
that she wanted to take it slow.
So yeah, people would take a look at their first chapters.
Maybe half of the book would still have new and delete.
But I told her, you okay what we can do
is just have kind of a small note and there are better ways to do it just keep reading we're going
to hit that towards the end of the book and then hopefully at least if they copy and paste it
they'll also copy the there's better way to do this yeah yeah yeah yeah look there are books that
they don't need to deal with that. They are targeting more experienced,
like high-performance C++ books.
If you read about, like you read the books,
they go immediately into full more than C++.
So it's easier for them.
But for newcomers, it might be harder for them
to kind of digest so many things.
Like I remember John, one of the podcasts that he had,
I remember he mentioned the way he teaches.
He said, okay, I have this construct.
I'm going to show it to you.
Just trust me.
This is how it's going to work, and I'll explain later.
So that's another way.
Today it's maybe harder with a book not to lose people.
They're going to close the book and cry.
They don't understand. So I think the book would be an excellent object-oriented programming book
for a lot of newcomers, experienced people.
She's very, very, like Dorothy is very, very knowledgeable about the book.
Sorry, about the object-oriented, obviously about the book as well.
But object-oriented programming, she's very, very knowledgeable about.
And there's some possibility we might get her on in the future?
Yeah, she was really excited.
She definitely wants to talk about it.
And she's really passionate.
She's an excellent person.
I think we have a great guest.
Do we have a rough idea of when the book is going to be published?
I know it's still being worked on.
A few months, I can't
really say. We don't have a title
yet. It's going to be Object-Oriented Programming
something, but we don't have
a title. That was one of the issues
that we got permission from
Packet just a couple days ago
because we didn't have a title.
We don't have a title, but it's going to be
Object-Oriented Programming in a few
months. It takes a lot of time.
There's a lot of reviewers after Dorothy and I kind of going back and forth.
It takes a lot of time.
Then there is another reviewer, and the process is really long.
I don't know.
I don't think people write books for the money.
Most of them, I think.
It's the fun and similar.
Well, if we base it off of what Guy told us last time he was on, Most of them, I think it's just the fun and similar.
Well, if we base it off of what Guy told us last time he was on,
then a few months means about 18 months, maybe, you'll have it published.
Makes sense.
It's hard. It's hard.
But it's fun. It's fun.
This is the first book you've worked on? Yeah, that's the first book that I worked on, yeah.
And how long have you been working on it so far?
We started around end of May, beginning of June.
Okay, so about five, six months now, something like that.
Yeah, six, seven months, that is.
Okay, so yeah, when it actually gets published,
we'll have to ask you again if you still think it was fun.
Okay.
Yeah, I reviewed everything, even during vacation, so I probably think it was fun. Okay. Yeah, I reviewed everything, even during vacation.
So I probably think it's fun.
We might be running a little bit low on time,
but is there anything else you want to tell us
about your work with the San Diego C++ meetup
before we let you go?
I think we mentioned that in the beginning.
I started the meetup when it was about 70 people and it grew are going to help people
to implement something right away
and not something which is kind of a future topic
or something that might go into the standard,
but something really tangible
that they can actually go and use right now
and especially kind of brainwash them
on using more than C++ more and more.
Good brainwashing.
Yeah, the brainwash is like, it's important.
I do the same internally in Qualcomm.
In the end of the session,
like I have kind of a weekly session that I,
like it's something that, you know,
Jonathan Busser, the guy from Fluent C++
had this daily C++ thing.
And I have like almost daily, it's actually weekly.
And at the end of the session,
I say, okay,
did I manage to brainwash you or not?
It's like I'm trying to make sure
that people write kind of idiomatic
more than C++.
Don't use new and delete.
Like don't write construct
or just empty
because I don't need
just use inline initialization.
Things like that,
that makes the code much better
because maybe one day I would need to deal with the code.
So it's actually like I want me to be in a better shape
when I read other people's code.
So that's also one of the things.
Yeah, so San Diego C++ Meetup going strong
and it's pretty fun though.
It takes a lot of my time, but I enjoy it.
I enjoy the
people coming back and giving me good feedback so so it's important with it being virtual for
the foreseeable future i'm guessing any of our listeners can go and attend some of the user
group meetings right yeah yeah and if you want to present always welcome people we had think cell and trust in soft and conan and andreas ferdig and
other people that i probably forgot but yeah yeah i haven't had andreas speak at my meetup yet
oh maybe i should do that he's great you should you should have him yeah he is great
there's a great also great book although what he had to probably present at like 4 a.m.
or something like that to be able to present at your meetup.
Yeah, yeah, yeah.
I really appreciate that.
There's another company, ThinkCell.
I think you also had them on the show.
We had ThinkCell on before, yeah.
So what's his name?
I think CTO or something like that.
He was on the show and presented.
Yeah, it was middle of the night.
I don't know, 2 a.m. or something crazy.
I appreciate that.
I did have someone present from Israel at my meetup.
And it was, I think, 4 a.m. for them, 4 or 5 when they went to bed.
I'm like, why even bother going to bed at this point?
You see, this is a real commitment.
Yes.
Yeah.
All right. Well, Kobi, it was great having you on the show thank you so
much for telling us about containers and we're definitely looking forward to this book coming
out and we'll have to have you and dorothea on again sometime when it's ready to be talked about
more yeah thank you it was super fun thank you for having me thanks a lot thanks thanks 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
you're interested in, or if you have a suggestion
for a topic, we'd love to hear about that too.
You can email all your thoughts to
feedback at cppcast.com.
We'd also appreciate if you can like
CppCast on Facebook and follow
CppCast on Twitter.
You can also follow me at RobWIrving
and Jason at Lefticus on Twitter.
We'd also like to thank all our patrons
who help support the show through Patreon.
If you'd like to support us on Patreon,
you can do so at patreon.com
slash cppcast. And of course,
you can find all that info and the show notes
on the podcast website at
cppcast.com
Theme music for this episode was provided by