AppForce1 Podcast: news and information for iOS app developers
← All episodes

Daniel Steinberg, extraordinary trainer on Functional Swift and SwiftUI

43:24

Send me a text

In this special Daniel Steinberg and me talk about his history, him helping people, Daniel's hobbies and a whole lot more.

Links on Daniel himself:

People mentioned:

Other items of interest

Join me in Amsterdam for Do iOS 2025, tickets and details available now.

Lead Software Developer 
Learn best practices for being a great lead software developer.

Practical Combine by Donny Wals
Buy Donny’ book on combine and support my podcast. Now that’s a great deal.

Disclaimer: This post contains affiliate links. If you make a purchase, I may receive a commission at no extra cost to you.

Support the show

Do iOS: https://do-ios.com


Rate me on Apple Podcasts.

Send feedback on SpeakPipe
Or contact me:

Support my podcast with a monthly subscription, it really helps.

My book: Being a Lead Software Developer

In this episode

Read the transcript
Jeroen Leenarts: Okay, Daniel is the author of more than a dozen books, including the best selling books with kickstarts. And the Atlanta he has written many apps on the iPhone and the iPad six as the case first appeared, and has written programs for the Mac all the way back to system seven. System seven Daniel. Daniel Steinberg: Yes, it's a very old. I don't even know what that is. That's before we had, you know, back iOS 10. We had nine and eight and seven and seven was around for a long time, probably before you were born. Jeroen Leenarts: What year was that? Daniel Steinberg: Oh, my goodness, it was it was the 80s 80s and 90s. Jeroen Leenarts: I was born in 1979. So technically, I was there. But yeah, I was still doing other stuff. Also, Daniel presents iPhone, Coco and swift trainings and consults through his company them some thinking. Most people know Daniel by his, his given name, Daniel Steinberg. And what I've noticed with everybody I talked to, they all know you. And they always have high regards to to you what you do, and actually how you help that person individually. So what is this? Daniel, you like helping people? I think, is that correct? Daniel Steinberg: I just that's the community. Isn't it all about other people? And it's that's what we do. Jeroen Leenarts: Okay. But what I know is that you have a teaching background, like way back in the day, is that correct? Yeah, Daniel Steinberg: I was a high school math teacher. And then I went on and got my PhD in math, and then taught at the college level for a while. So when you teach high school, and it's really fun for me now, because my daughter has just become a high school teacher. She teaches high school Latin. And when you teach at the high school level, you do teach your subject matter. But you're mainly there to teach kids, it's because you love kids, and you want to help them become who they want to be. Jeroen Leenarts: So but what made you want to become a teacher? Daniel Steinberg: I think I always did. My mom was a first grade teacher. So you know, just for an international audience, kids that are about six years old. And so she was teaching them to read and the first steps. And my dad was a college professor, he taught philosophy. And so I grew up with these these teachers around the house, and it just appealed to me. Where did you do your education. I was undergrad at Brandeis, which is up in the Boston area. And then I did my PhD at case in Cleveland. And it was just sort of, for fun. I was I was working as a disc jockey, I was playing music at night. And I just thought during the day, I should be doing something. So I started taking classes in mathematics. And the next thing you knew I had a degree Jeroen Leenarts: back in the day, when you had to choose your education, were already doing stuff with computers back then. Or Daniel Steinberg: computers. For the most part, there were no computer departments, they were all part of either math departments or physics departments, or maybe double E and so it wasn't on my horizon. I did some programming in the early days. And so I started college in 19, before your report 1977. And so, you know, C was brand new than C was just being taught at the college level. And so I did a little bit, but I was mainly interested in mathematics and theatre, those were my two majors. And then education was my sort of sideline. Jeroen Leenarts: Okay, but when, when was the spark for programming later in your life. Daniel Steinberg: So I was very lucky when I when I was doing my student teaching. I was teaching at Newton North High School in the Boston area. And my mentor said, I want you to teach a computer class, because I want you to teach kids that know more than you do. And he thought that was just a good lesson in humility, where the teacher didn't have to be the one in the room that knew the most, they just had to be someone that could help the students with the things that they happen to know. And it just appealed to me. And so while I was getting my degree, I had this idea for something I wanted to do. And I was using Mathematica to model it. And if those days, I would start Mathematica on my Mac. And I would go to bed, and it would crash overnight. And so I learned to program so that I could do the mathematical side of my thesis, and then use Mathematica to render the the curves that I got out of it. So that's where I taught myself to program. And it was just a lot of fun. Jeroen Leenarts: But that's, that's very scientific plotting graphs, when the things become programming something for an end user. Daniel Steinberg: So I was at Oberlin College, I was teaching mathematics there. And a friend of mine who I grew up with, it was really neat that both of us had grown up in Oberlin, and we were back and members of the faculty down the hall from each other. And he was teaching some intro Java classes and I was sitting in and helping out and design patterns. The book just got released, and I got very involved with that. And so we started writing Things for end users then and started playing with things and seeing other people use what you've written. It's magical. Like you can do stuff on a simulator all day long. But when the iPhone comes along, and you see even the dumbest app running on an iPhone, there's magic there. Jeroen Leenarts: What was the trigger for you to actually switch from being being a teacher in the classical sense that everybody knows, you know, teaching at the faculty to actually going out on your own and teaching programming? Really? Daniel Steinberg: I? That's a great question. I didn't start teaching programming, I started. Like, other people, I know, in this field, covering the programming space, I was covering Java on the Mac, for Java World Magazine. And so I would go out, and I need to learn more and more about Java. And Java was always lagging on the Mac, and it could do things but they wanted it to do the same thing on the Mac, as it did on Windows. And so I wasn't seeing this platform that I loved. And so much that Apple did me a huge favor. Every once in a while, someone at Apple will reach out and just give me a morsel. And you just, they can't tell you what's coming. But you really have to listen to what they're saying between. And basically they told me, If you want to stay on this platform, you need to learn Objective C, you can't be a Java programmer and be on the Mac. And so I was very lucky to come to Objective C, a year before the iPhone shipped. So I was a good, good stead there. And then the pragmatic studio wanted to teach in the space. And so Bill Dudley, and I created a class for we thought we're going to teach the iPhone, but I don't know if you remember, in the early days, the iPhone was still under NDA. And so we sort of did what a lot of people did, which was we, we taught how to program for the Mac, and we sort of winked and said the iPhone would be just like that. And then one day the NDA dropped. And we started teaching that as well. So we taught classes, Mac programming in Objective C and iOS programming and Objective C. And a lot of the people I know today I know because they came through those classes, and they became wonderful friends. And really, they were great developers, it was it was in a way a throwback to my first experience in high school teaching computers where I'm teaching a class full of people who know way more than I do, and they're way more talented than I am. I just happen to know this one thing that I'm able to share with them. And it was just that same delight of seeing them explode with it. Jeroen Leenarts: So but that's the iOS timeframe. There's a lot of years between you being a math teacher, and you being about actually doing the job for one magazine. So what did you do in the time in between, Daniel Steinberg: I was doing the programming for my own enjoyment. At the same time, that's when I was getting my PhD in mathematics I already been teaching. I also was working as a radio DJ. And so there was plenty of time to do so many things. And then as I said that the Java years and turning more to the programming coincided with my children being born. When your dad things change, Jeroen Leenarts: had made me switch jobs and stuff as well. So with that, the Java days, so to speak. I remember some conference in Santa Clara. I think it was it was Eclipse calm. I think Daniel Steinberg: that's where I think I first met you and I think I interviewed you you were doing a job for a railway. Jeroen Leenarts: Yeah, I was working for the Dutch Railways. And I was just walking around here, or my first conference in the US as a guy from the Netherlands. And then here comes up this big guy, very friendly, big glasses. And he says, Hey, what are you doing? And you just start chatting with me. And I was like, Hey, he's nice. And okay, well, we just talked a bit. And then all of a sudden, something clicked in you. And you went like, Hey, can I interview for my podcast? And I can't find the recording anymore. But I think it was talking like really fast. And actually, that's the first time that we met. And there was a bit of time that's passed, and then we've met again. Daniel Steinberg: And so that first time was kind of interesting to me, because I was very lucky because I had all that experience in radio, that when it came time for podcasting, I was really positioned. I knew how to edit audio. I was interested in people I, I understood this medium really well. I understood that even though 1000s of people may listen to you, they listen to you one at a time. So you talk to someone very personally. And so being able to talk to you there was a pleasure that I still remember. And in talking to you it was like the podcast listeners were eavesdropping on a conversation between friends. And I was doing a podcast for O'Reilly the book publishers, called distributing the future and That was just fantastic that they were letting me do that. And that's, that's how I was at that conference, I was producing Java dotnet for Sun, which O'Reilly was managing. And they also had on java.com, which was their Java property for O'Reilly proper. And so that's what brought me into the podcasting space as well. Jeroen Leenarts: Okay. And then at some point, you were, you were, like, heavily involved in the Java world, you may just switch to Objective C, because you had some little morsel of information from somebody inside. But that really sounds like that key moments, there were people in your life that really helped you in the way that you actually, in your life have influenced and impacted other people's life as well. So are they can you name a few of those experience that somebody helped you and, and what they have actually helped you with? Daniel Steinberg: I've been absolutely lucky, the number of people that have helped me, I got tipped off about people, you catch the excitement from other people. So I was lucky enough to catch the excitement of Java very early in the 1.02 days. And so I got to start going to Java one from the second Java one and start meeting some really interesting people that were doing. I'm they were, they were 20 years old and doing amazing things in this space. And it was just a pleasure. So I got into Java very early, I got into Objective C, just in time for the iPhone, I was lucky to have another friend who the two of us were talking and it just seemed to the two of us, another language was coming. And so we prepared ourselves for swift by learning closure and, and thinking about what a language like this would look like. So it's been, it's been a lot of Lucky opportunities with very smart people who are kind enough to sort of, it's not that they're tipping me off, it was just their excitement. You listen between the lines, and you can see things coming. Like it wasn't a surprise, for instance, that something like a swift UI came, because there was just this impedance mismatch between UI kit and swift. And so you knew there had to be a more swift, friendly environment? And who knows how long that was coming. But it just felt natural now that we have it. Jeroen Leenarts: But do you reckon that you picking up on these, these details that actually allow you to make sound guesses towards the future? on what's coming? Do you reckon that that's to attribute to you having a lot of interest in other people and just socializing with other people and just talking with people and talking about what a, our F have fun with? And what I like to do or why? Because it? It does happen a lot to you as a person, it seems, which is an admirable quality that you have. But what's the reason behind that? According to your perception? Daniel Steinberg: I don't know. I agree that I am very lucky. And I know a lot of very smart and very nice people. But also I have, which is kind of surprising. If you think of some of the things that I have gone through. I'm still very much an optimist. And so maybe it's the optimist in me that doesn't remember the wrong steps that I took the guesses that I made that turned out not to be correct, that I tend to focus on the ones that I feel very lucky about. And there's some that I haven't acted on, I feel really bad that I haven't spent the time to learn machine learning and TensorFlow, these seems like areas that would be a natural for me with my mathematics background. And they've been on my list, but oh my gosh, Apple keeps releasing stuff that I need to learn. First, I need to learn more about combine and swift UI and, and there's just so much coming that I hope to get to machine learning and, you know, API's like tensor flow, because they look really interesting to me. Jeroen Leenarts: Okay. Let's switch gears a little bit. Because we've talked a lot about about the past. Let's let's focus a bit on like, the present. I talked to Donnie wells recently. And the Daniel Steinberg: another smart person I've learned a lot from Jeroen Leenarts: and but he's actually saying that he learned a lot of from you and that you actually, in some way, according to his feeling, you actually coached him and helped him improve as a writer and speaker. And is that something you do consciously? Or is it something that just comes natural that you like, Hey, you see somebody maybe flapping their arms a bit, and you know, hey, let's, let's, let's give this person a bit of a hint or like just give some tips and see what happens or what is it? What do you get out of helping people? Daniel Steinberg: So, I really love so I edited Java dotnet for years. One of the things I noticed when I edited articles was that you could often most of the work I did was to say the article starts here, five paragraphs in that people wrote these first five paragraphs to sort of get themselves into the article. But where it started for the reader was down below, and just making these small changes, but not making you sound more like me making you sound more like yourself and make you some more Claire's yourself. That was a real joy. And so someone like Donnie, he's naturally talented, he he's an amazing person, I said it on a workshop to his at swift Island. And from start to finish, it was one of the most thoughtful, he was doing something with instruments, which you'd think would be the most boring topic in the world. And yet, his examples were so well chosen, and his path through the material was so well chosen, that when I was lucky enough to have him speak it at DOT Swift, in Paris, one things I do is I work with the speakers for months ahead of their talks. And to help him find his talk within his talk. I mean, he brought most of the work, all I did was, was find that thing and brush away some of the material, and he was phenomenal. I love doing that. Jeroen Leenarts: But I was once told that a good teacher is somebody that only facilitates and then gets out of the way, that's my hope is is teaching something that you can learn, or it's something that has to be a natural attribute of a person. Daniel Steinberg: I think both I think if you've got a predilection to it, that it can be honed, and you can become a better teacher the same way you can become a better writer or a better coder. I'm not one who believes that everybody can code or maybe everyone should code or everyone should write that novel that they have inside of them. But if that's something you want to do, then someone else can make you better at it. And so I used to train teachers, and it was the same as when I would work with writers or train DJs. My job isn't to make you teach the way I teach or do anything the way I do it. It's, it's to find your way within it and get the most out of your way. Okay. Does that make sense? Jeroen Leenarts: I think so. Yeah, I guess, in my life, I had a few great teachers as well, that really, I don't know, they just but just a few words, a few looks, sometimes they were able to just influence me in such a way that that had so much impact. And actually most of the impact was achieved, by me, doing some tasks, performing the work and just being busy. But just being like nudged in the right direction at the right moment, it's it's so helpful. And so important, Daniel Steinberg: I was lucky enough about I guess it's over a year ago, to take a workshop from Chris hight off, he was at NS north in Toronto, and he was teaching a workshop on functional programming. And that's something that, you know, I've been trying to get my head around for a long time, and, and he's just one of the best. And his teaching style couldn't be more different than mine. And it was fantastic. It fit him perfectly, he got the most out of us. And I just can't imagine him teaching any differently. And I can't imagine myself teaching the way he did. So just appreciating the differences. Lots of us can be good at something and be completely different. Jeroen Leenarts: So if you if you look at your own activities, what's the thing that's that that drives you each day to, to get out of bed to do the things you do? And to be able to, at the end of the day, look back on a day and think yes, that just that was a Dale well spent. Daniel Steinberg: So I would say two things. One, I'd love to learn new things. And so this has been economically a horrible time for so many of us locked down and, and not able to travel or do the things that we do. And being able to say, look, I'm not going to be able to earn the money doing the things I've done. So why don't I just double down and learn more? That's been a fantastic way to spend the time. And the other thing that I think that I do well, is I think I tell stories well, and so what I try to do in my writing, and my training is to give you the framework, so I'm not going to teach you as many of the nooks and crannies of Swift UI as someone say, like Paul Hudson, Paul does a fantastic job of showing you all these different things you can do. What I try to do is give you sort of a picture so that when you learn how to do this particular thing, you can apply it to learn something else that I give you the sort of the holistic story not to say he doesn't, but our approaches are different. And so I'm trying to give you that story arc through it. And he's giving you a lot of individual tools as well. Jeroen Leenarts: You write a lot of books, you publish most of them under your own own label or own name so to speak. You don't use a publisher. What What made you decide to do to write and publish books this way. Daniel Steinberg: So I started writing for publishers, the first programming book I wrote was, I was writing for Java World Magazine. And they needed someone to help with a book called The Java to Bible. And it was one of these huge books, these 1000 page books. And it was just after the time, in the old days, the programming books were how you found the API's. The API's weren't online, they weren't HTML, you would buy the book and you thumbed through to find that the API's. And so this was going to be now 1000 page book, but not filled with API's, it had to be filled with examples. And so they'd had three authors, and one of them dropped out. So they said, Can you come in and just write a couple chapters. So I wrote a couple chapters, and then another author dropped out. So they said, Can you write some more. And so I ended up writing almost a half of the book. And I learned so much. And my philosophy then was to write the stuff that I would want to go back and find later. So a lot of things later, when I had a question, I could go back to my own book and say, oh, yeah, that's how you do it. So that was the Java two Bible. In then I got a very interesting, I'm about to answer a question you didn't ask. So feel free to cut this out, if you'd like. I got a very interesting contact from my editor who said, Microsoft is working on a new language, that's going to be a cleanroom. Java, and at the time, it was called Cool. And you could write the first book on that, because you've written the the Java two Bible. Let's just take that. And let's move it over to do this cool. And I talked to a friend of mine who had worked in the Java world with the servlets. And Microsoft was very different than Microsoft now is such an interesting place. And they're so friendly to programmers, and they're so friendly to multiple platforms. But this wasn't the Microsoft back then. And so my friend said, whatever you write a book on, is probably the type of training you're going to do in the consulting you're going to do, do you really want to work in the world of Microsoft right now. And I didn't. So I passed on the book. And I could have had the first it was the first dotnet C sharp book as it turned out. And so it didn't happen. And I'm, I never looked back and never think about that. Then Then I wrote books for other publishers, I wrote for Pearson did a math book, I took computer books. And then I did, I came to the Pragmatic Programmers. And we started their iOS and Mac OS line, and I wrote a MacBook for them and edited the iOS book. But overtime publishers did less than less. In the early days, the publishers did a lot of the developmental editing and the tech editing and the tech review. And they got the books on the shelves, and they did the typesetting. And they did the promotion. Now if you go to a publisher, for the most part, they expect the author to do the promoting, and the books aren't going to be on bookshelves. Anyway, they're going to be sold online or in electronic form. And so publishers are doing less and less, but they're still taking that same percent. And so I began to look at that and think maybe I can do things if I just self published. And so I started publishing my own works. And I'm very happy with it. I've just recently gone back to doing a deal with the Pragmatic Programmers, where they're also distributing my books, I have nothing but good feeling for them, I left on good terms. And they have a reach that I don't, but I also sell directly on Gumroad. And so I don't know if that answers your question, but that's how I got from working for many other publishers to working for myself. One of my favorite books along the way was for Ron de veau. What Apple now calls Bonjour, which I wrote for O'Reilly with the man who invented rendezvous and so that these are just magical moments. Jeroen Leenarts: How many books have you authored thus far? Daniel Steinberg: I think somewhere around two dozen the the three that I'm maintaining right now is the Swift kickstart the Swift UI kickstart in my functional programming, kickstart. And then coming up next will be combined in a book on baking bread. Jeroen Leenarts: Yeah, that's one of your hobbies. If I'm correct, right, it is it's more than I'll be I think it is. So how much bread do you bake on an average week when you're at home? Daniel Steinberg: So this has been the fun thing about being home is when I travel I can't keep my sourdough alive and growing and, and fresh. So I've been baking a lot more. This week. You call me during the American elections. So unfortunately, with all that stress, I've been baking more. I've made two batches of bagels this week and we've eaten through most of them and some hot dog buns. So Coming up, as soon as I finish updating my functional book, I'm going to start the bread baking book for earnest. And people will be able to bake along with me as I write it. Jeroen Leenarts: Okay, so that's an interesting exercise. If there's any links on that, I'll make sure to catch those from you. And I'll put it in the show, that's Daniel Steinberg: going to be my favorite kind of tech review. Jeroen Leenarts: texture and flavor and springiness, let's dissect one of your average weeks. So, Monday through Friday, how do you spend your time and I'm not talking about what you do in the evenings. But the professional part? Daniel Steinberg: My favorite part of that question is you think my week stops on Friday? You know, when you work for yourself, you're always working. It's Jeroen Leenarts: okay. So let's Let's retry the question. An average week, how does that look for you? Daniel Steinberg: I get up each morning and and feed the dog because that's the first thing that needs to be done. And we have our stand up meeting. Well, I make my coffee. And right now, because I'm updating a book I'm working on that I'm often writing code. Unfortunately, most of the code that I write these days is toy code. It's not shipping code. And that's something that I want to address. Another thing that I thought about during the pandemic was, if you know it, I don't know how to put this the right way. But not making money is in a way freeing because you're now free to do things that you didn't do because they don't make any money. So writing an app for for the app store doesn't make a lot of money. Well, if you're not making a lot of money anyway, you might as well do that. So I'm also working on a couple apps right now. And we'll see if we we progress with those. One is a bread baking app. And one might be for knitting. I don't know if I can get my heads around that. And one is the scheduling app. I don't know if any of these will ship but I'm having just a ball writing real code again. It's been a while. And knitting app. Yeah, one of my one of my hobbies is knitting. And I've been looking into Japanese lace knitting lately. And so one that manages patterns. Jeroen Leenarts: I did not know that you were into knitting actually. It's not something it's not something you you publish in your, in your weekly newsletters, I think. Daniel Steinberg: Actually, I did a couple weeks ago, I posted a picture of a piece that I made a very complicated lace piece that I made and gave to one of my wife's cousins. You mentioned the stand up. No, no, it's just me in the dark. Jeroen Leenarts: So what are you talking about? Which are dogs? And if he likes his food, and if he wants to play or? Daniel Steinberg: Well, you know, one of the, you know, the phrase rubber ducking, yeah, that when you rubber duck an idea, you can tell your idea to or your question to a rubber duck, and then explaining it you sometimes come up with the answers. So one of the things that I missed the most in life is not starting my day talking to my wife, and not being able to discuss things. She had amazing insight into things that I should do next, or things that I shouldn't do next. And one of my favorite parts about you is I remember you meeting the two of us for coffee once in Amsterdam. And it was just a delightful afternoon, we met you by the Amsterdam sign and you walked over to a coffee shop and you recommended museums that we should visit while we were there. And so she she was someone that was not just an extension of me, but she was the better half of me. And so she was able to say things to me. Well, talking to the dog is not like talking to Kimmy. But it's the it's the best thing that I have right now. Jeroen Leenarts: Yeah, but I can you imagine that? She was she was one special lady, because I remember that day. And it was it was a very good day. Yeah. Yeah, I wanted to mention the coffee. But we already did. Daniel Steinberg: Although lately I've started roasting my own again. And that's been that's been a lot of fun. Jeroen Leenarts: Is there anything that's not a hobby of you? Daniel Steinberg: There's plenty of things sometimes just a novice. Jeroen Leenarts: Yeah. But that's the that's the best periods. When you are actually picking up something new. Yeah, then you learn the most right? Absolutely. Okay. back a bit to that technology that we all work with in our day to day, you already mentioned that you are working on developing your own apps a little bit. So to get a bit away from writing only toy code. If you look at developing like bigger code bases, do you see a difference in working with swith compared to working with Objective C when you're writing a decently sized codebase? And what are those differences? Daniel Steinberg: So I was never one that had a problem with Objective C, there are some people that were looking for new language because of things they didn't like about Objective C. I always loved the notion in Objective C if it was like a conversation, where you're asking a method a method sent to me was like a question that you would ask somebody there was a receiver and there was something you were sending and getting better back. That said, I absolutely love swift and I think has made me a better programmer. And so I think more, I think it's a combination having these habits from writing Objective C, with some of the lessons from small talk and other objectives, object oriented languages, like the very small methods and the very cohesive classes and functions and so that a function doesn't do too much, and a class doesn't do too much. I think those lessons written into Swift, make it just a wonderful language. And I've been playing a lot with the Swift package manager lately, and I love splitting up my code into these packages that I can share. And I can update. And it makes me write code that I've hidden things from others. And I know that you recently had John Reed over in the Netherlands, you know, John is the one that always reminds me Have you tested this. And so I find the packages are easy to beat up and test. And now you have this thing that that you feel is more robust, and you can use it in maybe just one project, but maybe more. Jeroen Leenarts: But if you look at Swift, it's has a lot of features that have their roots in a more functional language. Do you think that's something that people are using to the fullest effect in Swift already, or is there a lot to be gained there. Daniel Steinberg: So I don't think they're using it to the fullest effect. And I think the people that do use map, or you know, one of these flat map or something like that, use it for arrays and don't think of it anywhere else as, as a general, I think of map as a design pattern. And that's one of the things I tried to get across in my book is map as a design pattern. flat map is a design pattern. And in a way array is the least intuitive example of them. And so if that's the only thing you know, then it is hard to apply it and to see why it's it's generally something that's good. And there's something that used to happen to us in Java. Back in Java, you'd come up with some insight and you'd say, Oh, we could do it this way. And some would say, Oh, we did that in small talk 20 years ago. And the same thing seems to happen in functional programming in Swift is someone comes up with an insight and someone in Haskell goes, Oh, yeah, we did that years ago, we knew that already. And it's true. These languages, these techniques aren't new. You know, you look back to Lisp, which is older than I am, Lisp was, I think, created 1958. So it's 62 years old. And, and you look back at Lisp and small talk, and despite people saying, one is Oh, and one is more more functional. There's a lot in common, you know, and so the, these lessons that we have from Oh, still pay off in Swift. I just heard an interview with Jordan rose. And he was talking about memory memory, in Swift. And so things that we took for granted in Objective C that objects were created on the heap, and structs were created on the stack. And we can't make those assumptions for swift, because there's these optimizations going on. And so, so much of what we're dealing with in Swift, we have the semantics of value types, and reference types, but what they're doing underneath to get the most out of the language and the most performance, it's just mind blowing. And now, I know you asked me a little question I go on and on but but now we're seeing the proposals for actors and asynchronous code come out. It's a very exciting time. Jeroen Leenarts: But with when you look at this proposal for the asynchronous programming in Swift, they have defined two distinct phases. And the first phase, it's really, to me it looks like they they're just adding some syntactic sugar to introduce the concept of actors within the concurrency model. But then only in the second phase, and at the end of the second phase, that's when the payoff will come, I think, because then the actor isolation will be introduced in the language. So what are your thoughts on that? Daniel Steinberg: So I think that's great that they set us up that way that they say, here's what's coming. But here's what you get first, because this proposal has been around for years, and we didn't know what was going to be implemented in what order? You look at what they did with generics, it's the same thing. There's this beautiful generics proposal, but there was no, we're going to do this first. And we didn't know what we could depend on what the timeframe was going to be. So I really like how they're laying it out so that we can plan our lives around it. And maybe, as you say, if there isn't the payoff to us to embrace this model yet, then we don't. But the other thing we know is, by the time we do embrace it, it will have been beaten up on that people will have experimented with that. And I also think about things that are done at lower levels. For instance, do you remember when we got, we now talk about it as dispatch async. But it was GCD. It was a Grand Central Dispatch. And what they told us was without us knowing it, for loops, some of the for loop stuff, the fast enumeration and for loops, we're using it under the covers that they had sort of swapped out implementation. And I think we'll see a lot of that where distinct that there are a lot of things that we won't have to pay attention to, but we're going to benefit from as they move in this direction. Jeroen Leenarts: But isn't there also a risk involved, if you as a end user of the language, cannot conceptually grasp certain areas of the due to the optimizations happening? Or is that dependent on how they model it conceptually, for the language users? Daniel Steinberg: I think you're right on both sides, that there could be a risk and it depends on the model it. But a lot of it's going to be done at a level where it maybe you could argue this right now that I can't optimize some of my code, because I don't know what's being done on the stack and the heap. And so maybe because I don't know those implementations, I can't mess with it. But maybe I shouldn't be messing with it anyway. So I don't I don't really know, that's a great question. I don't know the answer, Jeroen Leenarts: it's probably something we'll, we'll have to see in the most like next one or two years, because I think this asynchronous proposal will take that much time to actually land in an Xcode version on a Mac, that I will be working on. Daniel Steinberg: And you know that my pattern is, I'll find smart people, I'll hang around with them, and I'll learn from them. And, and once I learned them, I'd look at my role is learning from smart people, and then explaining it to other smart people that don't know that thing. And so I'm not the smart person, I'm the conduit. In the world of combined, they're the publishers, the other people, that subscribers, I'm the operator in between, that's just mapping it that's changing it from what it is to something else. Jeroen Leenarts: So you're actually saying that, that you are a sponge that absorbs knowledge. And that if people want to gain knowledge from you, they only need to squeeze you. Daniel Steinberg: That's it. That's it. So So at future conferences, have people come up and squeeze me I'll know where this started. Jeroen Leenarts: Now, but it's it's, it's, it's an analogy to, like, if you have interaction with somebody, that's the squeezing part. So just talking to you, just just being in a room and sharing ideas is actually one of the best ways to my experience to actually get an understanding of each other's points of view and actually be able to transfer knowledge in the most effective way. Daniel Steinberg: It's what Malcolm Gladwell called a connector. Yeah. And that that's sort of what I see my role as the connector that, that I'm not the source, and I'm not the sing, Jeroen Leenarts: it does sound a lot better than a spoon. So I must agree. So um, so yeah, if you, you're actually a very experienced software developer, if I might say, you've seen a lot of things went through the whole Yafa loop avoided the dotnet trap, and then one went on your merry way with, with Objective C and, and now Swift, to new developers coming of age and getting their first experience with with an actual code base, are there any thoughts or tips that you would like to install on those people, so that they have a better time learning and adopting to their surroundings? Daniel Steinberg: I don't know that this is what you're asking. But one of them is to approach a code base with kindness. It's easy to come into a code base and see a piece of code and think this is awful, Who's the idiot that wrote this? But there are often constraints, or there were reasons that something got written the way it did. Now, I know you come into two, a code base that has 1000 line methods, something's wrong, and they need to be split up. But there might have been reasons that things were done certain ways. I remember coming into a code base. And this was a Mac code base. And there were comments around some code that said, this was introduced for Tiger. And I thought, well, no one has to support Tiger anymore. And so I commented out the code and everything broke, because it turned out it was very old code that was introduced as they were coming to Tiger not to be backwards compatible. So it was for everything that was Macco s that was the tiger release, and everything since then. And so I started to look at the code differently. Not just because of the comments, but someone did it that way for a reason. So I was I was contracted a few years ago by someone who wanted me to look at iOS code that was they had outsourced to India. And they wanted me to tell them that it was done horribly. And what I told them was, because you looked at when the code was written, that's the way we wrote code that we didn't have arc thin. So this was very old code that was before automatic reference counting. That's the way we wrote code that it's not that it was awful. It was actually good code for the time. So when you ask how someone should come to a code base, I think my number one advice is come with kindness. And maybe you can make it better, I hope you can make it better. But probably the person that wrote it in the first place could write it better, too. Jeroen Leenarts: Okay. And that's actually very good advice. I might say, because too often you see people complaining about code that they see that they have to work with, and then they immediately start looking for what person wrote this code with a few more expletives. So I must admit that in my younger years, I fallen in that trap, Daniel Steinberg: as well. We all did. Sure. Jeroen Leenarts: So um, you block you have you write books, you write newsletters, you bake bread, you do knitting? Is there anything that I forgot to walk you though? Daniel Steinberg: Not enough. Being a data still the best thing that I do any day? Jeroen Leenarts: I can agree to that. My favorite Daniel Steinberg: part of my day is talking to my daughter. Jeroen Leenarts: And with that, I would like to wrap up with this. I look at the clock and we already spent close to an hour talking to each other. Daniel Steinberg: And yet that was a pleasure. We don't do this enough. Thank you.

Keep listening

More from the show

Image
Title