Bryce

The hat is back! I'm so excited that the hat is back! I know, my hair's amazing. So Conn Connor usually wears a hat. Like when he's on uh when he's on Zoom, and then there was like a three-week period where there was no hat, and uh I don't like change, so I didn't like it very much.

Conor

Welcome to ADSP the podcast, episode 26, recorded on May 19th, 2021. My name is Connor, and today with my co-host Bryce, we interview Sean Perrin for the second time. This is part one of our two-part interview with him, where we talk about slide decks, UI, and so much more.

Bryce

Have you uh have you fixed your audio setup so that you're no longer recording in a uh in a closet?

Conor

No, man. This is uh you haven't listened to the last uh episode, um, but my audio has never been crispier. It is it is so crispy.

Bryce

So you're in the closet, aren't you?

Conor

Yeah. We're doing a little experiment today because I have acquired uh two chairs. So now I have three chairs. Um and the chairs that I have, I got, I I mentioned before, I got from my sister. And this one is not like a desk chair, though, so it doesn't have any cushion or fabric on it. It's just like a lightweight uh I don't know, sort of party chair. And uh we'll see. Maybe I'll have to revert back to the office chair if if my audio is not as crispy anymore because fabric equals less echo. I'm like I'm on my way to becoming an audiophile.

Bryce

I was about to say you're such an audiophile, Merton.

Conor

Except it's so sad because like I'm wearing I have these like a hundred dollar sports uh Bose like uh running headphones that I'm using.

Bryce

Wait, was that was that supposed to mean that those headphones are not impressive enough?

Conor

No, yeah, like an audiophile would have some $700 uh, you know, with some special cables and stuff that I don't know.

Bryce

But you you you realize that it's pretty privileged that you just you just said, oh yeah, I only have these hundred dollar bows uh headphones. I don't have the $700 headphones.

Conor

Yeah, my bad. I I should check my privilege. But um if you can if you can see like the the little plastic casing around the wires is all like torn up and I'm about to electrocute myself one of these days.

Bryce

Um audience, these uh these headphones are not in good shape. I'm actually I'm I'm very excited because uh since we last talked, Sean has submitted uh his committee paper on um moved from objects, which we just scheduled last week.

Sean Parent

Yeah, yeah. Scheduled for out in in August, which seems like a long time.

Bryce

But um Yes, un unfortunately, unfortunately, with uh with how our schedule during the pandemic is, August is w the first time chance that we'll get to look at it. But I'm I'm excited for it. It's it's uh it's probably been a few years since you've you've been at a C committee meeting or Yeah, it's it's been quite a while.

Sean Parent

This came about uh because uh John Lakos approached me at ACCU virtually and he's working on his new book, and he said that he knew that I had an annoyance with uh move semantics and wanted me to write something up on it. So I wrote about three pages for his book, and then he suggested he said, you know, this would be a better three pages if it could reference a standards proposal to fix it. So I wrote the standards proposal to fix it.

Bryce

See, see you got you got nerd sniped. That is a that is that is a pro-Lakos movie. That is a pro-Lakos.

Sean Parent

Yep, to get somebody to write a paper. Yeah, yeah. Lakos is a notorious manipulator, so.

Bryce

I assume that both of you have seen John Lakos give a talk. I love how that man gives a talk. And I in particular, I really appreciate how he makes a slide deck because he does it he does it the same way where that I do, where I don't put any transitions into my slides, but instead I'll have like multiple slides that will like, you know, if I wanted to have a slide with transition, I'll have a few different slides, each one that adds an another element to the to the last slide. Uh and I don't really know why I do that. I guess it's just like uh I feel like it gives me a little bit more control and it and uh and then it exports to PDF better. Um uh but uh so so as a result of this, John Lakos will come to give an hour-long talk and he'll be like, oh yeah, I've got 800 slides.

Sean Parent

Yep. Yeah. Every time I'm working on a slide deck, I have to resist the urge of writing my own slide deck engine because it's uh I can't find a tool that does what I want.

Conor

Yeah, I think I recall I asked you once in your C seasoning talk how you did the really nice uh like sliding code up the screen, and I w I was expecting, oh, it's gonna be something super fancy, but you basically did it like the classic, I think like just big images, and then you like move it up the screen and then it looks like it's sliding. Uh but it's done so like flawlessly that I thought for sure you had some like custom Adobe uh like unreleased keynote or PowerPoint.

Sean Parent

No, but no, that was done painfully and manually in keynote. And so yeah. Yeah, yeah.

Bryce

I I would that there's not many things that I would like really believe and invest in, but if Sean Parent wanted to make a slide engine, that I would get on board with.

Conor

It's funny how many times there's been at least like a handful of slide decks or presentations that I've seen. I can remember one too. Sean M, I'm gonna I'm gonna forget his last name. He works at Google, and he was did a talk on coroutines in Kotlin. And he did this like little history of coroutines, and it was like zoom in, zoom out, all this just amazing. And I thought he must be using Prezi, must be using something, and then I went and asked him after, and he was like, No, I just a bunch of images, this is very you know, very painful. And I'm like, why we got all these beautiful presentations and we haven't figured out how to make it uh easy for slide deck people.

Bryce

You know, I I used reveal, so I usually use PowerPoint for my slides. One time for my 2017 uh talk that was like an intro, and uh it was called C 17 features. It was an introduction to like you know every C17 features. For that talk, I decided I'm gonna I'm gonna try the new cool thing and try using reveal.js, which is like a slide framework where you write your slides in like markdown and you know, you put them in a GitHub repo and they get compiled to um you know HTML and JavaScript. Um it's what all the cool kids use. And I tried it, and the you know, the main reason that I wanted to use it was testability of my sample code. You know, I wanted to be able to write the code in a way where I could compile like all my example code locally and then have that be imported into the slides so that I could unit test all my example code in the slides. Because every talk that I'd give, some person would afterwards come up to me and say, aha, you had a typo on this line, you had a typo on that line. I wanted to avoid that. And so I did the presentation and it was like I I'm not saying it was a bad experience, but it was just like not for me. Um because the problem was that when I needed when I wanted to go and like change where something was on this on the screen, um uh, you know, I couldn't just go do that. I needed to go into the file and like edit something and like edit a location, whereas what I wanted to do was like visually move a thing. And at that point in my career, I was like, you know, the person who was like, I just want a Vim interface to everything, like I want to do everything in the command line, you know, GUIs are GUIs are for suckers, I don't want to use a GUI for anything. And that will and like I, you know, of course, like I'm gonna use Linux for everything. I'm just gonna my interface to the world is a Linux command line interface. And that was the moment when I like first came to really appreciate um the power of a good graphical interface. Because like for making a slide, I wanted to be able to like visually see it and like move it around and then be like, yeah, that looks that looks that looks pretty good. That looks pretty good. Um and like after that I have increasingly I've increasingly like spent more of my time thinking about like, you know, is this a task that I want the um sort of the efficiency gains that I might get from something that's purely textual, or do I want, you know, I want a uh a graphical interface to this thing because it's uh um it's something that I really need to visualize and like visually see?

Sean Parent

Yeah, when I'm when I'm teaching classes, you know, or just developing a new slide deck, I use uh Jupyter Notebook, which you know is usually a you know data science thing and associated with Python, uh but it's got support uh through something called Zeus Kling to let you put interpreted C17 embedded directly in your notebook and it's executable and and uh the notebook can output to reveal.js. And so I can build up my whole slide deck with all of my code, and all of my code is executable, and you can see the results directly on the slides, and I can go change the code and and edit it and and figure out the right order to structure things so that, you know, so so as the user's going through the slides they they see all the pieces that that that come together. Um but controlling the output of it is is painful enough that you know it's fine if I'm teaching a course and it's just like the equivalent of a of a whiteboard. Uh but if I'm gonna do a keynote presentation or something, then that's my draft, and then I'll sit down and keynote and and make it pretty.

Bryce

I I do want to take this opportunity to plug a PowerPoint um plug-in that I recently purchased and have used, which has been transformative, which is it's called PowerPoint uh shortcut tools, and it is super awesome. It makes it like so much quicker for me to uh to build my PowerPoint decks because it's got a whole bunch of uh of very useful keybindings and macros. That's cool.

Sean Parent

I've got uh collection of scripts for for Keynote that uh that I've written over the years that probably do some of the equivalent things. It's like you hit one button and that's awesome.

Conor

You would I thought about learning how to I I learned once because Excel macros are a big thing, and I I got into that when I was uh younger. And then I'd heard about access, that's Microsoft Access, like the database, not any other word that you might have confused what I just said with. It's a terrible name. There's access uh VVA like macro programming. But I looked into to see like I think the most useful at this point in my life would be like a PowerPoint um like little scripting language. Uh but when I looked into that, I just found a YouTube video of someone building like a Turing machine and PowerPoint and doing some crazy things, which which I can link that in the show notes. If anyone's ever wondering, because this is probably the number one question I get asked, is how do I do my little code animations? It's uh a transition called Morph. I think Keynote has the same thing called magic or something like that. And yeah, you just you have to change the mode to words instead of objects, and then it figures everything out. It's an amazing algorithm, and I'm I'm very sad that I tried to mimic that stuff uh in pre-Microsoft PowerPoint 2019 because it was just so much work.

Bryce

But no, I I got one more thought on this, but then I got one more thought on this, and then I got a good transition.

Conor

Um Do you know what we're transitioning to though?

Bryce

No, I know what I'm transitioning to. I'm one of the reason that I I invested in in uh the reason I bought a copy of shortcut tools was uh for copy object position, which is a really useful uh you know key binding to have. Like, hey, this thing's at this position on this slide, on this other slide, I want this thing at the same pos I want a different object at the same position. And then of course, like uh key bindings to align various different things. I I drive my colleagues crazy because I'll look at their slide decks and I'll be like, that's not aligned, that's not aligned. Like, you send me your PowerPoint, I'm gonna go through and align all your things for you. Um but but speaking spe here's the transition. Wait for it, it's a really good one. Speaking of user transitions, I I don't work on uh uh graphic user interfaces and like really I I solely work on like libraries in the back end. I don't really work in anything that has like uh quote civilian users. Um and so I never really thought much about user interface uh you know or graphical interface uh until I saw one of Sean Perrin's more recent talks, which I think was at CPPCon in 2018 or 2019 on uh on user interfaces. It was it was one of the better code um talks. And uh it, you know, for somebody who it for somebody who did doesn't think about you know user interface, it made me care about user interface. I really loved that talk.

Sean Parent

Well, thank you. So I'm trying to think of uh because I've done a couple of talks that include user interface bits.

Bryce

It was the it was the one where you had the slides about um uh the user interface of a bathroom in a hotel in Germany that you stayed at for meeting C.

Sean Parent

Yes, yes, okay. Now that's uh uh is I think that's my relationships talk.

Bryce

So Right, the relationships talk. Yes, yes, that's that's what it was, yeah. Yeah. Yeah, it it was really interesting to see how you know to see how you think about that. Um because it just never it wasn't it's a field that I've never even thought about before.

Sean Parent

Yeah, right, yeah, and it's there's a section in it which is you know near the the the bathroom section, uh uh uh which is going through the possible user interfaces for just an implies relationship between two Booleans, you know, A implies B and all the different ways that that could be represented and all the trade-offs and making that representation and and all the ways to get it wrong. And and I send that little snippet out frequently when I'm working with designers because you know it's this problem area where every time uh uh a UI designer hits an implies relationship and they're quite common in user interfaces, they they basically start from a blank sheet. And they're like they're like, you know, okay, so so you know, I've got this relationship where if I click on this and that needs to be true. And and they'll start with, you know, okay, so so how should I represent that and what are the behaviors involved? And I have these frequent arguments where I think, you know, uh the UI industry as an industry should really work on rule sets on like, okay, if we have an implies relationship under these circumstances we're going to build it this way. Under a different set of circumstances, maybe we'll take a different approach. Uh but build up what the rule set is and and document it well and establish standards for things like that.

Bryce

At Adobe, do you have is there like a set of design principles um for something like Photoshop for the for the UI for for things like that?

Sean Parent

Yeah, we have we have a design team and a set set of design principles that that that go around that and you know it uh team of designers that are trying to bring all of the Adobe applications to be more consistent, which is always a problem because Adobe grows largely through acquisition. So you know, as soon as you think you're there, you've kind of sucked in and a couple more products and you've got got got got things to uh to normalize. So we do have a team that works on that. You know, my my criticism of the team would be that they tend to be a little myopic, which is they tend to build the rules around individual features as opposed to building you know what we would call generic rules. Uh-huh. Right. Right, right, what things have that shape and and build the rules around things that have that shape. So when you encounter a new problem, you f you n can figure out, well, what are the attributes of this problem and what rules would apply to this and and come up with a uh with a good design without invoking a designer and having them draw a bunch of pictures.

Bryce

That that uh reminds me of a conversation that I had with uh that I either had with Tony or it was on the podcast with Tony at C ⁇ Now where Tony was talking about he's he maintains this set of design principles at his company. And whenever he does a code review, if he sees something that he doesn't like and there's not a design rule that covers it, he goes and thinks up and writes a design rule for it and puts it into the guidelines.

Sean Parent

Yeah. Yeah. Years ago I wrote uh a layout engine. It's open sourced, it's known as Eve. It's part of Adobe Source Libraries, and it's uh a layout engine for UI. And it gets used heavily at Adobe. Um in fact, almost all of Photoshop is laid out with Eve. And the Eve has its own kind of uh baked-in rule sets and uh for doing layout. And the rule sets came about because at the time I was working with the Photoshop designer and I would you know, this was years and years and years ago, so I would literally do this on paper. I would print out different variants of a UI and go to her and ask her which one she liked better, and she'd point at one and go, you know, this is this is the best one, and then I'd be like, Why? Why do you say that? And you know, you you the conversation would always start with, well, because it looks better, and it's like not good enough. Right? Right. And eventually you would uncover, you know, she had a very strong design sense and she had internalized a bunch of design rules, and and so you would just have to uh you know, I would have to pull those out of her. It's like, well, it looks better because this over here is aligning with that over there, right? And uh so then I would go and print a whole bunch of of things where things aligned in that way, and she would go through and mark them up and be like, Yeah, but this one this one's wrong. And I'd be like, Okay, why is that one wrong? Well, because in this case, you know, this should really be aligning with this other thing because that's a stronger, a stronger visual aspect. And so so it was, you know, months of kind of working with her to dig out her her design sense and encapsulate it into a set of rules and and build that into the code.

Conor

But I think it's interesting that you said like alignment there like three or four times, because a lot of time people ask, like, oh, you know, what should I do to improve slide decks and stuff? And like it really is just a set of like three or four simple rules, and like two of the main things, which I think Bryce, you mentioned came in your plug-in set, are like the alignment, you know, top, bottom, left, right, and then also like the vertical and horizontal spacing. Like small things like that, if you have I think we've even talked about this the last time you were on, where you have like you know, five bullet points, and one of the bullet points is got like an extra half-line spacing in it than the other ones. Like that's not symmetric. I think our eyes are drawn to like symmetry because it's it's pattern recognition, it's easier for our brains to oh, this is all sort of in the same thing. When something is off, uh at least for me, it it doesn't look as nice. And and a lot of the times it's just like lining things up nicely, um, which is a small thing, but it can make a big difference.

Bryce

Well, and also how you use how you use space. You know, like like i if if there's a dead space on your slide, you know, if you're if like you're using all of your your vertical space, but you've got like huge amounts of like dead space like horizontally, just like big blank regions, like oh, that just it just pains my heart, it pains my soul.

Sean Parent

And you know, alignment's a difficult thing too, because it's it's w what are the strong edges that your eyes attracted to, and kind of understanding that. And in the case of text, you really want the baselines of your text to align. And when building UIs, that can get very complicated because you've got, you know, a button next to a pop-up or something, and those things have different heights. And and as a developer frequently using uh an OS toolkit, you don't have control over where the OS is putting the text within those those rectangles, uh, but you really want to align the baselines between those those two rectangles.

Bryce

Well, and you have to think about how it's gonna align when it's localized, right?

Sean Parent

Yes. Yes. And and different languages have different rules, so things like you know, Korean is you know centered aligned as opposed to baseline aligned. So yeah, things like that are challenging when you're worried worried about building UI. Eve does some pretty nutty things to kind of make some of that stuff correct, and it handles bizarre cases like uh you know, mix of left to right and right to right and right to left languages within the same UI, and handling alignment across those two cases, which it turns out you know in some parts of the world is fairly common.

Bryce

Yeah, one one thing that I probably spend more time thinking about than I should is if I'm making a space. spreadsheet, um, how am I gonna align the columns? Because if if it's something like uh uh you know I think I think the left align for you know the rows of a table is probably like the most natural thing to me um just stylistically um I sort of I sort of think it's similar to what like Sean said like I don't necessarily have a good like reason for it but it's um it's just sort of like a you know a gut you know a gut thing um it's sort of like natural language like you might know that something you might know that some that that a way of phrasing something in English is like not grammatically correct but you can't name the particular rule for it. But um but if you left align numbers like currency um then it's not uh uh it's it's harder to see the difference in magnitude between two different rows. Um and this is I think why uh Excel defaults to left alignment for text but then right alignment for numbers. But then like if you if you have some of your columns that are right aligned um because they're numbers and then others are text and they're left aligned like should you right align all of them? What about the t what about the headers? Should those be centered? Should those be uh you know left aligned or right aligned? It's like I I spend more time thinking about these things than I probably should.

Sean Parent

For numbers that's a case where we borrowed numbers from Arabic. So they're Arabic numerals and hence they're right to left.

Conor

Yeah Excel was Excel I think they have an a format for currency where it aligns the currency symbol and then right aligns the two decimal places and the decimal and then the number. And so like it figures out like the maximum width of the integral part of your money amount. And like that's my favorite because that to me has the most symmetry. Like all the decimals are lined up all the money symbols so dollar sign or pound sign are all lined up and then uh the only thing that's off is like when you have a you know $10 amount versus a hundred dollar amount like you're gonna have some empty space there. But like for me that's you can even like just sort of blur squint your eyes and blur them and like you can see what the largest roughly what the largest amount is just by seeing which one is kicked out furthest to the left from the right.

Bryce

This isn't even like a GUI problem you know as as anybody who's ever tried to deal with uh padding um in uh with printf knows this is like not an easy not an easy thing to to to clearly express. It's one of the reasons why I'm so excited about std format um being in the C standard library because uh it's just such a better solution than the prior ones for doing something like I want I want this to be like padded in a certain way so that these things line up when I print them out in a for loop.

Sean Parent

Yeah, yeah. I like I like std format. It's still one of the the things we had in in in ASL was uh a library for for structured serialization and and that's one of the things that I think the is still missing from C and you know I'd at some point I'd love to continue that work. But the idea with structured serialization is is you format things based off the the shape of the object and so you have you know is this thing a dictionary is it an array is it is it just an an atom type right like just a number or just a string. And then the once you have the structural information about what it is is that you're printing and that's all you need to describe to print something, then you can have a bunch of different backend formatters. So you can say well output this structure as XML output it as JSON output it as as uh you know PDF has its own serialization format output it as PDF and so inside of the the the ASL we have this this concept of of uh uh structured serialization and so to to use it you just have to basically describe the shape of your objects and then you can output them into any one of these formats.

Bryce

I I actually do think that this is something that um the C ⁇ standard library will will do eventually and I think it's probably a good idea and um I think a design similar to what you just described will make a lot of sense too because what while I'm not while I'm not a huge fan of the idea of putting say a JSON or an XML library into standard C ⁇ having some way of of taking a representation of a C ⁇ object and getting out JSON or XML would be really nice. And uh you know especially as we get uh once we get reflection in the language um we'll be able to really build a an excellent uh uh serialization facilities too um uh and so I think that's that's something you know I I in my CNO keynote I I highlighted four priorities for the standard library. It was asynchrony and parallelism, I.O, text processing and metaprogramming reflection. And uh I mean that serialization really hits those the the I.O and the metaprogramming reflection and I think it's going to be important in the future.

Sean Parent

And I you know I I hope the standards committee takes an approach of of being agnostic about the format of serialization and focusing on the structural aspects because you know if you look at say Objective C has has serialization but it's in you know Apple's own format, proprietary format and so the the the ones you move to say well I want to be able to serialize in JSON or XML now you're on your own. And so it would be nice if you you know if C went the route of kind of being agnostic and being like no no no we're we're gonna have an API that lets you you plug in the actual formatter and we're just gonna have a standard way to describe the structural information.

Bryce

Yeah. And that that's a very C way to do things. Like I I like to say that the the the thing that makes C is this idea of universality that C doesn't have one programming paradigm and there's not one compiler or implementation. There's not just one domain that you can use it for C supports this really wide ecosystem and so for for any given thing in C there usually is no one right answer. The right answer is to support whatever the right whatever the right solution is for each individual domain.

Conor

Thanks for listening tune in next week for an epic part two. Have a great day