Bryce

Um I do use syntax highlighting, but uh I'm more and more turned off by syntax highlighting.

Conor

What? What? You don't like syntax highlighting? You sound like an old grumpy man.

Bryce

I mean, I am an old grumpy man, Connor. I am an old grumpy man.

Conor

Welcome to ADSP The Podcast, episode 67, recorded on February 5th, 2022. My name is Connor, and today with my co-host Bryce, we talk about how to get started with C. New episode. This is gonna be episode like 68 or something. Who knows? Um, this is coming out probably in March of uh 2022. We had a person, uh his name, Jeff Erickson. Shout out to Jeff Erickson.

Bryce

Hello, Mr. Erickson.

Conor

And he sent me a sort of episode request. So Bryce has gotten zero uh this is he's gonna be off the cuff responding. Uh, but we're gonna go ahead, we're gonna go ahead and read this message from Jeff Erickson, and then we're gonna get uh we're gonna answer this live. Hey Connor, Jeff here. I'm a huge fan of your YouTube stuff as well as ADSP. Well, uh, thank you, Jeff. Uh, it's kind of you to say so. I wanted to write to say that while sometimes you might think that the audience of ADSP is a bunch of C people who also want to branch up, I think there are also a lot of people like me. That is, people with 10 plus years as an engineer who have never touched C. Personally, I've worked in Python, R, Go, Pearl, and SQL. I've also been interested in functional languages, and I'll be honest that I hadn't given C much thought since I'd I've avoided it until now. Until I started listening to ADSP. Listen to that, Bryce. We're making we're changing, we're changing people's views. Bryce loves you. Uh but now I must I am C curious. So I thought it might be worth suggesting to you to do an episode on ADSP where you talk about why you guys like C and talk about how someone without any experience could try it out or get started or inspire. C is one of those languages that, to me at least, feels so big and massive that it's extremely intimidating to start learning it as a 35-year-old who isn't learning it in school. What resources would or could get someone's feet wet enough to tell them if they should continue the journey? And also, I think it would be worthwhile to describe your dev tooling, also since that too has been a huge black box with to me with respect to C. Maybe it's just the circles we find ourselves in, but I feel that while the newer, cooler languages and quotations get a lot of action in terms of interesting books to read and cool tooling to improve your dev environment, languages like C don't seem to get the same treatment. As experienced C people yourselves, maybe that is less clear to you. If it's not episode worthy, if you could at least maybe give me a few tips for starting points, I'd really appreciate it. Thank you, Jeff. So, Jeff, I think it's a great episode idea. And now we're gonna get Bryce Bryce's response. So the question is, in the midst of that uh big long message, is that you know, how does someone get started uh now that they're C curious when they're not learning it in school, where do you begin? What resources would you recommend? And what about the tooling setup? Bryce, go.

Bryce

Um, so let's start off with why I like C. Um I think actually, if you go back, um one of our earlier episodes, we talked about how many programming languages should you learn. And uh I took the position of, uh, you only really need to learn one or two. And Connor took the position of learn all the programming languages. And I actually think that's one of the nice things about C is its versatility. Um uh C is a multi-paradigm programming language. I think that is really the defining characteristic of C as a programming language. Um that you can um, you know, it's an it's an imperative language, it maps very closely down to hardware, um, but also it's it's you know an object-oriented language, it's a generic language, it's a functional language. So you can you can um use a wide variety of different programming paradigms and techniques, and I think more importantly, you can combine those different techniques together. Um and so for me, one of the things that's appealing about C is that um uh uh you know, for systems programming tasks, you can you can use it for for like almost anything. Um and uh and not be restricted to a particular way of programming. Um it gives you many different uh choices and options. Um you know, sometimes some of those are foot guns, which people don't love. Um but that that to me is a big part of the appeal. Now now the it doesn't mean that you can actually only learn C, because um it's you know, uh as a sort of a systems programming language, um something that you use to write, you know, uh underlying things and as a compiled language, it's not, you know, as nimble as something like Python. Um but if you're in that space of writing um, you know, uh something that needs to some sort of system software, something that needs to be high performance, um, or that that needs to talk to hardware or talk to operating systems, etc. Um, or you know, a lot of the meat behind a lot of the things that we actually use end up getting written in C. Um and to me part of the appeal is that like you can you can learn this one skill how to like program in C, and then there's just a very wide variety of things that you can do with it. Um so I think to me that's like part of the appeal and the magic of it, um, especially as compared to other um uh to other systems programming languages.

Conor

Yeah, one thing I'll echo, because a lot of the I like C for the same reason. I will say on a small tangent, once again at the Denver C meetup, which I think got messaged mentioned a couple episodes, the most recent topic was like an open conversation on what makes programming fun. And at one point I mentioned in the chat that I said, you know, C is not fun in parentheses relative to other languages, which was kind of just a provocative thing to say, um, because I like APL better. Um But um what like the thing that I really like about C, especially compared to languages like Go, is Go is not programming language enthusiasts' language, meaning that they really want you to do everything sort of one way. Like that's sort of the the thing about Go, is that they've got sort of one way to do it, and all Go code tends to be very, very similar. And so you can hop from one code base to an oak another code base, and sort of the tribal knowledge of that sort of code base is very small. So you can ramp up extremely quickly. It's a high productivity language. Uh but that means that if there's you know there's not a lot of options as a programmer for how you want to do something. Whereas in C it's the exact opposite.

Bryce

There, like COVID-If anything, there's too many options.

Conor

Exactly. And which, as a programming language enthusiast, I get to choose the style. Do I want to code functionally? Do I want to code you know small talk, you know, OO-ishly with messages and you know that kind of style? Like I you can code in whatever style you want. You want to code, you know, basically with just C with classes, you can do that as well. Which leads to issues if you don't have agreement with your coworkers on like how you want to program.

Bryce

Yeah, and it's it's like one of the reasons why you know coding styles and code guidelines are so important in C. And I feel like there's some other programming languages where maybe like people who program in those languages, like this idea that it's important to have coding styles might be foreign because they're just so used to like this is the way that you write code in this language, but in COVID.

Conor

Many different flavors. And that's the whole thing, is you know, the Python ecosystem as well, like it's not as much the same as Go, but they try to layer that, you know, the Zen of Python, there's one way to write code, and just you know, black is the formatter that everyone uses. Python, once again, they try to sort of like idiomatic Python, the Zen of Python is like there's one clear way to do things. Whereas in C, there's never one clear way to do things. There's like literally C 11, 14, 17, 20, the way you're gonna do metaprogramming uh is vastly different in each one of those because we got if const expert and C17, we got concepts and C20, uh, we got const expert and C11, and you know, more and more const expert stuff with every edition. Like how you do metaprogramming is like drastically different in every single standard, which is definitely a thing that is intimidating.

Bryce

Um well, it's like I used to say this, mostly I used to say this about Java, and you know what? I'll I'll shit on Java a little bit.

Conor

Juicy content. There we go.

Bryce

You know, there's there's bad C code out there, but there's also like good C code out there. Whereas for a language like Java, there's only really mediocre Java code.

Conor

Shots fired. I myself love all programming languages, and I'm not even gonna say even Java. I'm just gonna say Java like is included, you know. There's no even there. It's all programming languages get a little heart.

Bryce

Fun fact, when I was at LSU, um uh working like my first six months there before I was a student when I was just like a college dropout working at the research center. Um uh I worked with this professor, Steve Brandt, and for reasons that are still beyond me, he asked me to substitute Teach for his like Android programming course one day. And it was he was more of a programming languages guy like you. Actually, we should have him on the podcast sometimes because I just realized that you two are like shockingly similar in your programming language uh tastes. Um, although he was like like this was this was a guy who if if I needed like a script for something, I could email him with a rust rough description and he would send back like the most obscure uh obscurcated Perl script that you could imagine. Like no comments, no line breaks, and it would do exactly what I wanted, but I'd never know how it worked. Um, but um but I substitute taught for this Java class for like one class. I didn't know anything about Java. I'm not sure like literally I'd never written a line of Java code in my class in my life, but somehow I got through it. I think the students did not realize that I had never written Java code. I think there was it was like early in the semester, so they were still like learning about fundamental data types, and so I just was like, oh, it's like you know, fundamental data types, they're basically the same in all the languages. I can just teach them.

Conor

Strings, just plus equal, right?

Bryce

Yeah. But um that was that was the one time that I taught a college course. Was uh was an intro to programming class in Java. Yeah.

Conor

All right. Well, back to Jeff's question. So that's why that's why we like C because you can do whatever you want, basically. Yeah. Uh and and also when you compare it to sort of the other, that's actually he asks a follow-up question if we have thoughts on Rust or C, but I feel like we should save that to uh for another episode when we bring someone on that actually knows about Rust, and then we can go back and forth. But so that's why we like C. What do you recommend for someone that wants to start learning?

Bryce

I get this question a lot. I a lot of people ask me about like book recommendations, and that's always tough for me because I don't really read programming books. The circumstances that I will read programming books is if like one of my somebody that I know has written a programming book and like I get sent a copy of it, um, like then I'll like read it, you know.

Conor

I saw you tweet about uh Kate Gregory and Guy Davidson's book the other day.

Bryce

Yeah. Um, and like I've got you know, I've read Titus's software engineering at Google book, but that's not really a programming book. That's a that's a software engineering book. There aren't a lot of those. Um I'm looking at my shelf here. Um I've read some of Lagos's books.

Conor

Um that's John Lacos from Bloomberg.

Bryce

But I don't like me going to read a programming book. I guess the only two programming books that I've really ever read have been Elements of Programming and the Structure and Interpretation of Computer Programs and Parts of the Art of Computer Programming Volume 2 and Volume 3, because I only have volume two and volume three, as we discussed in an earlier episode. I was gifted those by a mentor, Hart McKaiser, and I asked, where are the other volumes? And he's like, You don't really need those. Um, I think I don't think that that was his real answer. I think he just didn't know where they were. But um, but yeah, I've never really been like a book learner, so that's always tough for me. I mean, the way that I I when I started programming, and I think we've discussed this on the podcast before, I was I wanted to create a text-based game of MUD. Um, and uh I was working with this guy and we were writing it in C. And so he was like teaching me a little bit about C. And then he used like Boost, you know, one of the Boost algorithms for like string splitting, and then it had a bug in it, and I went like, you know, fix the bug, and then I quickly got involved in Boost. And this was like in like month two or three of me teaching myself to program. Um, so for me, like the way that I learn and get started is I just like start, like I learn by doing, I learn by example. Um so it's hard for me to recommend learning materials because I have not often used learning materials. I just like to dive right in. I don't know, do you have books or resources? Something more useful than what I just said.

Conor

I mean, when I really dived into C, the books that I tore through were Scott Myers' books. Um, the effective C, more effective C, Effective Modern C, and then the effective SDL books.

Bryce

We should publish a book, most effective C.

Conor

Those are great, although I'm actually not sure how they've aged. I think they do actually age quite well. Although now that like 1720 are out, I'm sure that there's some stuff that's out of date. And I would definitely say that uh finding, I always try and find an online sort of playground. I don't have more effective C ⁇ . I only have effective C.

Bryce

Do you have more effective C I mean the one thing I do like about I do particularly like effective C and more effective C because um it's not it's a book that's a list of specific things, and like that's something that I can use. It's like you give me like a list of like ways to do things. Um yeah, I mean I feel like I feel like most of this is still pretty applicable. Familiarize yourself with the standard library, including TR1, that's less applicable. Familiarize yourself with Boost. Even though I am a Boost person and I strong enough with Boost, I feel like that is actually less applicable these days. Um I don't know how applicable it is okay. I feel like I feel like effective C and a lot of C books of that era um are much more focused on object-oriented design um than on other parts of the language. Um and at least for me, um it is very rare in my work that questions of uh the design of inheritance hierarchies or polymorphic objects um uh comes up. Um almost always it's questions of library and interface design. Um uh and with simple or relatively simple vocabulary types.

Conor

Yeah. So yeah, I if if you're looking for a book, honestly, I would just Google like C20. There's like five or six C20 books out there.

Bryce

So I think I I would actually recommend Beautiful C because it is a book in the style of like for me it's a good book because it's a book in the style of effective C, and that it's like a concrete list of, I think it's hang on, I'll I'll get the copy. Um 30 core guidelines for writing clean, safe, and fast code. So it's like 30 concrete things that you can learn, and like, or like 30 mantras or takeaway lessons. Um and uh and it's just been published, so it's fairly up to date.

Conor

Um I would say the yeah, one of the most useful tools is uh Compiler Explorer, which is basically an online uh compiler that you can just go write your C code in the browser. And at least while you're learning, unless if the way you're gonna start learning is by building some project, um, I would just sort of code there because it's it's awesome. Like even half the time when I do development, if I can sandbox it and build up a prototype, I'll just do it in God Vault.

Bryce

Um Yeah, I I do find God Vault to be a very good resource for learning. Um and I use it a lot day to day because if I just want to go answer a quick question about how does something work in C, um, you know, going and doing it on my laptop involves like, you know, I have to go put a file somewhere, then I have to go find a compiler that works. Um and it's like God vault, it's just the turnaround time is so much quicker. Um yeah. Yeah, I actually I actually I think I'm gonna be bold and say that you know I I I I rarely I rarely actually like endorse a book because again, like I don't really read them that much, but I really did like Beautiful C ⁇ . I feel like it's it is a better version of effective or more effective C that has like the guidelines and the rules that I would want to have. So yeah, that that one that one has my stamp of approval. But I don't know, I like I think it's good, I think that sort of book's good if you already know the language and you want to know how to write it good. It's maybe not the best for learning the language.

Conor

Yeah. Do we want to talk about tooling?

Bryce

Well, I think we just did. We talked about Godball.

Conor

I mean, I know, but like outside of compiler explorer, I would say like the way that I develop right now is with VS Code and a bunch of extensions. So the clank format, clank tidy, and you can, I think, I think Jason Turner, I'd probably point you to C Weekly, because he basically has like a short five to ten minute video on every topic under the sun. And I'm pretty sure he's got one on Claim Format, and he's got one on Clang Ty. And I think Jason Turner even has like a little starter CMake project that has all that stuff set up from the get-go.

Bryce

I feel like my answer is gonna not be very helpful here. Um which is that what? I use Vim. I've only ever used Vim. I started off my career on supercomputers, and uh, you know, when you work in supercomputing, you often you have to go and do stuff on some obscure system somewhere that's running like rel like a Red Hat release that was put out, you know, before like when you were in high school, and there's like no graphical user interface, there's no nice things, and like you gotta you gotta edit some code there. And so, you know, Vim is the thing that like you can reliably have on those platforms, and or you can easily install um or build yourself, because I've had to do that many many a time because the platform had too ancient a version of Vim for me to work with. Um and it's like lightweight, and I've got a little Vim config that I've built up over the years that mostly functions, and I copy that from system to system, and that's uh that's what I use for my editor. And like I don't use mini Vim features. Um one of my colleagues, Mihao, has pointed out that like I don't really know how to use Vim. I don't know all of the like every every time he's I'm screen sharing and I'm using Vim, he like teaches me a new thing, and I'm like, wow, that's gonna save me so much time. Um I don't have it like hooked up with any of the like IDE features. I don't use anything like C tags. Um uh I've never used Clang format. Um I I do use syntax highlighting, but uh I'm more and more turned off by syntax highlighting.

Conor

What? What you don't like syntax highlighting? Yeah, sound like an old grumpy man.

Bryce

I mean I am an old grumpy man, Connor. I am an old grumpy man. Um I mean I I usually I usually use CMake, but for a lot of like little projects, I just write a book. I mean, my development life is held together by bash scripts. So that's me. Um yeah. I have used, I did use recently the um God, what is it? I I tweeted about it. I needed to like do a PR on just on GitHub. I didn't want to check out anything locally. And I used the like online VS Code thingy on GitHub where if you if you like change the starting URL of a link to something on GitHub, it then drops you into this like online VS Code developer environment.

Conor

Isn't it just control period as well, the shortcut? Okay, let's go try.

Bryce

Let's go try.

Conor

Yeah, if I go control dot. Shift dot? Yeah, shift dot. Shift. Setting uh setting up the web editor, yeah.

Bryce

Yeah, it's it's if you change it from github.com to github.dev, then it drops you into that environment. And I was amazed, listener. Like I was like, I need to make this change where I need to change two files and then like submit a PR. And usually like on the GitHub website, if you need to change one file and submit a PR, that's easy to do. But if you need to change two files and turn them into a PR, that's tricky. And I was like, I don't want to check this repo out. I have like 10 minutes before I need to leave, but like I need this change in because like RCI is broken. And um I was able to just like like I didn't do shift dot, but I did like I just changed the URL from github.com to github.dev. It dropped me into this environment. I was like able to open up a branch, uh, I was able to like make my changes, and like it was just amazing how quickly it was done. And I was like, this is how I want to write code now. Um so yeah. But I I I I only casually use VS Code. My like day, day-to-day go-to editor is Vim. But but don't, but don't, don't, don't be like me. Don't like Jeff, don't don't listen to like like just because I do things this way, like you should do things the way that Connor described. Like use VS Code, um uh use claim title. Like you do all of those things. Do all of those good things. Don't be like me. Don't be like me. I am I am a bad programmer, which is why I mostly don't write code anymore.

Conor

Yep. C is awesome. Use uh compiler explorer, choose whatever book you want. I would also recommend check the show notes. I'll add a list to like the list of talks that the SG, was it 20, whatever the education um study group is for the C committee. Um they put together a list of like top talks that cover sort of different things. Um if it's not included, it definitely should be. Jason Turner has a talk that's like, you know, why I love C, and it covers the 25 things that he really liked about it.

Bryce

But I was submitting for C North. I was pleasantly surprised to notice that my talk was listed, my C17 features talk was listed as one of the like talks to like, and you should your talk should aspire to be like this, and I'm like, uh, Connor put that there for me. Well, but and that talk like did not go great because I had syntax highlighting on my slides and the blues were too dark for people to read, and like I had to like deal with that mid-talk. I don't know how it came out on the recording, but that was rough. I think maybe I re-recorded because it was bad enough. I made them re-record it.

Conor

Yep. CPP North, uh, I mean, call for papers is closed, but I mean, nice try. Maybe next year. At this point.

Bryce

But you you still want people to go to your conference, right?

Conor

That's true, that's true, that's true.

Bryce

I will probably have to start splicing in uh you're gonna throw a so that conference is like the week of my birthday, so you're gonna throw a ridiculous birthday party for me, right?

Conor

Uh sounds good.

Bryce

You should you need to start planning that right now.

Conor

Should I? We'll get Louie out from uh Louie out. We'll fly get Michael out as well. Yeah.

Bryce

Yeah, you should be like you should be coordinating with my mother. Like you should be, there's a lot of things you should be doing right here.

Conor

You have responsibilities, sending the pigeons out to the ducks to let them know to all come. Uh make sure that you're in town. Yeah, so Jeff, I'm not sure if we really did a good job answering your question, though.

Bryce

Like you did a good job of answering the question.

Conor

Yeah, don't be like Bryce when it comes to programming, apparently. Yeah. But yeah, I mean C is uh it's a great language. A lot of great jobs out there.

Bryce

I mean, honestly, that's he he one of the things he asked was like how to get started. And like I legitimately think the best way to get started is to just do something, do some project C. Um, doesn't really matter what.

Conor

Um I feel like I feel like a lot of the times, although it sounds like Jeff's a pretty motivated person, but a lot of the times when I get that question, I'll get people like just randomly pinging me, being like, hey, I'm interested in topic X, like, how do I get started? And a lot of the times it's like just dive in. Just like it doesn't matter what talk or what book or you know, what pod, find what you like, you know, whether it's audio form or whether it's uh you know video lecture form or whether it's book form or whether it's just literally exploring the language and you know breaking things. Um find what method you like the best and just do that. Like the the hardest part is putting the time in.

Bryce

I feel like people maybe get a mental block here because they think that becoming a C plus, like becoming a programmer or learning a C or learning any new like tech skill, they think that it's like becoming a lawyer. Like, you know, like what are the what are the things you know that I have to do to become a lawyer? Like, you know, like there's like this one path that you have to go through and you have to go get into law school, and then you have to get a law degree, and then you have to, you know, pass a bar exam in the United States. It's like there's no there's no certification for being a C ⁇ programmer. Um and you know, like like I would say like there are some things that are like certifications or programs, you know, in tech. Um and I think some people think like, oh, well, I go do this and then I'm you know, then I will be qualified because I'll have the piece of paper. And I don't think I think that's what like chips people up. It's like that you're thinking that there's like some like fixed or set roadmap um for you to like, you know, get on like become a C programmer. There's not. Like it's different for everybody. Um so the best way to get started is just just you know, figure out what's the way for you to that you're gonna learn. Um, you know, figure out what interests you. Um there's no one fixed path for everybody to enter this, you know, this industry.

Conor

Yeah, yeah, absolutely. And that's the thing, is like I I enjoy all forms. I love lectures, I love podcasts, I love um reading actually is probably on the lowest on the list, but like I absolutely love listening to podcasts. Like I listen to like I think at this point, like 40 plus podcasts. And um yeah, CPP cast. I think actually we're gonna have to keep track of this. At some point, we are gonna be the number two uh C podcast out there currently, right now. It depends on how you define what a C podcast is, because even us, we're like C, you know. But like CPP Cast is definitely number one, and I think at the moment, CPP chat is number two.

Bryce

But we're gonna overtake them.

Conor

And if you qual if you count us if you count us as a C podcast, we're number three.

Bryce

And then how are you how are you ranked in terms of subscribers?

Conor

It depends, but like on my um app that I used, which is Castbox, I believe, it shows both the number of subscribers and the number of plays. And I sort of they they both typically follow if you're ahead of in terms of subscribers, you're typically ahead of in terms of views as well. Um that being said, so we already just tied um CPP chat on this app with 4,000 uh views. Um but they still have more subscribers. Boom. They've got 274.

Bryce

I'm Kenny and don't unsubscribe from them, lovely people.

Conor

Yeah, they've got 274 and we're at 162.

Bryce

Um but but our our true our trajectory, our acceleration for it is greater than theirs.

Conor

We've got a lot of momentum and also a lot of regularity in that we've never missed also too. Yeah, we've never missed a Friday. We're at what episode 67.

Bryce

What would it take for us to miss a Friday? A pandemic didn't do it.

Conor

Oh yeah. Should we should we talk about tail end of this? All right. Uh Jeff, I hope that answers your question.

Bryce

Thank you for putting up with us, Jeff. We uh we love you. We we love all of our listeners. We really do. It's still hard to believe that people want to listen to this.

Conor

Yeah, I mean, we did really, we have a little bit fallen off of the wagon.

Bryce

Yeah, well, don't worry, we wagon back on the wagon. No, wagon. Wagon, wagon, wagon.

Conor

Say like wagon. Wagon, wagon, wagon. Wagon? The problem is, the problem is, is that I'm just having too much fun now. Just like I'm sure.

Bryce

I mean, I've always I've always described it to people as like this podcast is all is just about the bromance chemistry that we have.

Conor

Uh have we mentioned std reduce in like 10 episodes? No. Uh we haven't. But are we having a great time?

Bryce

We should talk about we should talk about std fold at some point.

Conor

Okay. All right, we'll wrap it up.

Bryce

All right, we're having to actually stop recording because this is this is gone.

Conor

How long have we how long have we been recording for?

Bryce

Uh an hour and forty five minutes.

Conor

I've been recording for an hour and fifty three, so I'm hitting the stop button.

Bryce

I'm hitting the stop button.

Conor

Thanks for listening. We hope you enjoyed and have a great day.