Skip to main content

Interview with the Author of the Brilliant Programming Cookbook Series, Vandad Nahavandipoor

· 20 min read
Vandad Nahavandipoor
Elisha Sterngold

Vandad Nahavandipoor

Vandad has written a number of books published by O'Reilly such as iOS programming Cookbook, Swift Programming Cookbook and others, what’s more recently he has been publishing a ton of content, including videos with tips and tricks relating to Flutter on Youtube and Github. Vandaad currently has more then 2000 stars on Github for “Flutter Tips and Tricks”.

He is employed as the Lead iOS developer in Telia Smart Family. Telia being the leading communication service provider in Nordic Countries.

We’d like to begin by asking, how did you start writing books about coding?

The history behind it goes back to when I was about six years old, my dad had a Commodore 64, and I remember he would write down on a piece of paper all of the things that he was learning along the way. Back then, when you got a Commodore 64 it came with a manual (I don’t know if you remember back then) but there was a manual that came with the computer and that’s where everything started. It’s not like you could go onto the internet to search for something. I remember he kept his notes so organised, and as a kid, wondering how he kept all of his papers so neatly filed and why was he writing all of this stuff down. So, I asked him about it, I said ‘why are you writing all of this down?’. He replied, ‘I’m learning as I am writing’. At my father’s work, he was responsible for teaching other people how to use the Commodore as well, so for me it was a new way of looking at teaching. As a kid, I always thought that the people who teach just know everything. And here, it was exactly the opposite. The teachers also started not knowing anything, then they taught themselves, and as a result, they could now go and teach other people. That kind of solved a lot of mysteries in my head as well, as to the question of where does knowledge come from? It was just experience. I think I had it ingrained in my head that when you are learning something new, you will also enjoy and benefit from teaching others. The questions that people will ask you will drive you to learn more as well, because you have to process those questions and provide answers for them. So, teaching truly is a complete learning experience in and of itself.

When I moved to England in 2007, I thought, Ok, now is a great opportunity to contact a publisher. I contacted O’Reilly, and I remember they just flat out said no. I had sent a comprehensive email with a fully fledged book idea, and I was flat out rejected. I don’t know why, but something told me to ask them if they would at all be interested in working together on a project. It was just an instinct, completely by chance, but I did it. I said, Ok, I can do iOS development, I can do flash scripting, would you be interested in a collaboration? Then, O’Reilly came back to me and said, yes. This is a place where there is currently a hole in the market, and if I could write a book like that they would be interested.

O’Reilly truly is the publisher in these areas, so I think that even to get published by O’Reilly, is, on its own, an accomplishment

Thank you, yes. It was a fun period.

Now, lately, your writing is being published on Github and you haven’t published books in a while. Would you say this is a good example of how knowledge sharing has changed?

Well, when I was working with O’Reilly, I could see the shift, because you receive all of the sales data, and I worked with O’Reilly for over ten years. So I actually witnessed that period where e-book sales began overtaking paperbacks. I’d say, our generation still likes to purchase a published book, and feel the book in our hands. But, I’ve seen a lot of published books used as monitor stands when you've got nothing else to prop up the monitor, so seeing this happen, I knew this wasn’t the future of the industry. O’Reilly actually did publish ebooks, but they didn’t go all the way. When you publish, you write the book, you have one editor, and then it gets published. But when you write with Github, and other places online, and you crowdsource, everyone gets together and you have potentially an endless stream of people reading your work and critiquing it, correcting it. For me, that was the best way to get my stuff out there. I prefer the feedback, the corrections, the dynamic growth of it all. That is just my personal preference though, I still know many people who prefer publishing books. Also, [laughing] I do have three kids now, so I don’t exactly have the time to publish books.

It is much faster to publish this way, and it’s fun. If you can take the criticism, and allow other people to have more knowledge, through your work. A Lot of times critiques are not written in the nicest ways, so if you can weather some unpleasant comments at the gain of getting a flood of input from thousands of impromptu editors, then yes, it is definitely worth opening up your knowledge base to allow it to go through the process of getting patched up and improved.

I remember just starting out as a developer, I learned a lot through books, but once I began to develop with iOS, back then it was Objective-C, there was no Swift, I didn’t pick up a book, I went to search the web, read online articles, and tutorials to piece together whatever it was that indeed to figure out. So, I am with you 100% on that one, I think you are currently in the right place

Absolutely, I mean, you know what you don’t know. If you want to do something in Objective-C, and you don’t know how to do something, that is at least knowing what your end goal is. You can go to Google and write ‘function for class with two parameters’. But if you’re a junior developer you don’t even know what you don’t know. You don’t even know how to search for it. And that is where a book comes in, it actually opens up a lot of ideas. I see a lot of junior developers opening up a book, and senior developers just searching for whatever it is they need online.

That is an interesting distinction. You make a good point. Do you feel that your role as a writer and blogger improves your skills as a developer?

That actually depends. I feel like I am getting more detached from what I write and that makes me a better developer. In the beginning I was so attached to every line I wrote. Every line of code was like my baby. But now, I look at the code more as a medium that takes me from point A to point B, meaning, from the idea to the product. The exact lines of the code matter less, as long as it’s readable, understandable, maintainable, it doesn’t matter whose line of code it is. But in the beginning I was very attached to my lines of code. So, in that sense, writing and blogging has made me a better developer, in that I see code as code, and I am less personally invested in what was mine. My code is not my baby any more.

But I think the answer to your question really depends on how you define a good developer. Some may say the best senior developer is whoever writes the fastest code.

You started out as a real expert on Swift, hardcore native development, and today it seems you are very much focusing your efforts in Dart on Flutter, in otherwords, more cross platform. How would you compare the two, working between Native vs. Cross Platform programming?

I think there are a lot of things that can be compared, but with Flutter, I immediately saw the value in not having to write code for so many different platforms, and for me, I feel that I needed to be mature enough, in my life, to accept that. If that makes sense. I used to get attached to code, as I mentioned earlier, and I saw everything else as a threat instead of taking myself to the next level and just say: I don’t care, software is software, code is code, frameworks are frameworks. The more I know, the better for me. So, I don’t see the benefit in limiting myself to a specific platform, to be a diehard Swift fan as it were. That doesn’t make me a better developer. As a software developer I have value in that I can learn a lot of different things, so I can best help a client. That took a lot of time to process at first, but that is where I am now.

How would you compare working with Swift, or native vs. Flutter?

I think swift, if you want to compare something similar to flutter, it would be SwiftUI. UIKit is kind of old and not as clean as SwiftUI. So if we compare Flutter and SwiftUI, they are kind of similar in what they are trying to do. I feel that SwiftUI came from Swift, but Flutter didn’t come from anything, it was simply Flutter, from the start. If you know what I mean… it's like the thought process behind Flutter was set from the beginning, while Swift evolved into SwiftUI. So if you look at Flutter, everything is a Widget. But in SwiftUI that’s not the case. In a lot of places there are a jumble of different things, even if you’re working with views, sometimes you still have to go to UIKit. So, just comparing the two, I feel that Flutter was great from the beginning while SwiftUI is now trying to make Swift great.

How do you view working with Flutter vs. React Native?

I have some experience with react native. I see the purpose of both, because with react native you get the whole world of react, you get all of the hooks, and all of the styling, so you kind of have the power of the web behind you. That is very strong. That’s kind of like when you’re working with Django, you have a backend and you have the entire html 5, css and javascript with everything in there, while Futter is on its own. So that is one framework against many many mature frameworks. Django is mature, html is mature, css is mature, and they’ve come together to help mobile applications made with react native. Whereas Flutter is just Flutter on its own. I feel that comparing the two is a bit like comparing apples to oranges, even though they are both there to do the same thing, which is create new solutions and software with them. They are just very different frameworks, created by different companies. I think react native is probably a lot easier for people who come into it with a comprehensive web design background, whereas Flutter, you can jump right into it pretty much from whatever background you have. That is at least, my experience. When I first started with react native, I realised that I don’t know anything about css, or oh no, here I need javascript, and I have no idea how to do it. But with Flutter, I knew darts so I got it.

Let’s talk about app quality in general. Obviously Shipbook is a tool that can be used in part of that process. We’ve seen mobile apps are becoming increasingly complex, but even so, we are seeing less and less crashes. What do you think is contributing to that phenomenon?

The first thing that comes to mind is nullability. We just spoke about how starting out with Objective-C, it was really easy to get crashes, and how with Swift you have the ability to unwrap optionals but also, you can explicitly unwrap them and potentially crash the application. I can see in Darts, and Swift nowadays, that nullability is helping a lot with crashes. But… I can also say, that I have seen a lot of cases where developers, including myself, come across a top level error, for example communication with network, or perhaps you connected with an end point but you got your JSON and in the parsing something happened. Well, then this parsing error, at that high level, couldn’t be handled because the UI should handle it. So, it trickled down, came all the way down to the UI, to one special function, and that function didn’t handle it at all, it just ignored it. I’ve seen that a lot, and I mean a lot. I can with confidence say it occurs in every app. There are exceptions or errors that get into the app and just nothing happens. Whereas in the past these things could have crashed the application because there was no way to recover from these errors. Well, now that there are exceptions, exception handling, nullability, in my opinion, this has helped a lot, but it also allowed a lot of problems to hide. There are less crashes, yes, but it doesn’t necessarily mean that the app is working better, you know what I mean?

I understand that completely, actually that is exactly what makes Shipbook so unique. Chances are you wrote an error log for that type of issue, and Shipbook will catch it immediately. Whether it was reported or not by the end user, and in cases you described, Crashlytics won’t catch it, but with Shipbook all the logs are listed according to severity so you don’t need to rely on anything other than your logs.

Yes, that is the point, absolutely. Actually, I read about Shipbook, and I’d like to try it out and see how it works in our application.

I understand, thank you. I’d like to go into some general questions about bugs. Do you believe that all bugs should be fixed?

To be honest with you, most apps that I’ve written have been hobby apps, so I wouldn’t look at those as products. But the products that I’ve worked with, that aren’t owned by me…with a development team, manager, budget etc. So for those apps, with some bugs I can make the call as lead developer, and say, I can’t put my name on this unless we take care of that bug. However, there are other bugs that I need to ask the team lead, one step above me, and maybe he doesn’t know either, and it will go all the way up to the product owner to make the call. I feel like any bug that I fix is time taken from something else I should be working on, so I want to know that my time is spent working on the most important things at each given time. It is a subject that needs to be assessed on a case by case basis in my opinion.

Do you close the bugs that are not a priority, or do you keep those issues open, so that whenever you do have time you can get to the less important ones?

Well, at the moment we are using swimlanes in Jira, so we have all the bugs per app version that need to be fixed. How we work is, in Jira, whoever detects a bug, creates a ticket for it and we don’t assign an app version to it. Usually our team lead will then make the call as to what has to go into each version. The team leader also has the freedom to say, no we are not going to fix this because we don’t have the time, or to drag a different bug that didn’t have a version number and assign it to the current release. We have bugs. We don’t live in a perfect world where everything is completely clean, that’s not realistic. It can get to be spaghetti at times, and we try to make sense of it to the best of our ability. I’ve never closed a bug without a good reason. Either it's been fixed, or it's not essential and there is no time. But I’ve never gone back and said, ok I’m going to go clean all the old bugs. They stay there until we have a good reason to remove them.

What are the main tools you use to improve app quality?

One of the main tools that I use, it’s my new favorite at the moment, (it was actually my old favorite too, that I had forgotten about for a long time, to be completely transparent). It’s called Charles, it’s an HTTP proxy. Your own computer becomes like a proxy for your mobile application. All the traffic from your mobile application goes through your computer and then to the origin, and then comes back to the computer. That way you can sniff all the packages and see exactly what goes on.

Couldn’t you do the same things with a logging system? Just put two logs on all information which is going through the network?

Yes, well, it sniffs out any traffic, anything you do, through http and https so it’s perfect. It allows you to see all the requests that go out, because maybe your application is making an unnecessary amount of requests, so without a tool like that you can’t really see what’s happening. And the biggest advantage of Charles is that you can actually change the responses that come back from a server. You can simulate a lot of edge cases that you may not get from a server in real life. You can, for example, say, I know I’m getting this JSON from a server but I want to change this entity when I get the response, and then send that to my app. It’s so good, really good! [laughing] I’m not a sponsor for them, but I believe that it’s just a really good tool to increase productivity and quality of a mobile application.

Some companies are starting to remove QA teams, what is your point of view on the subject?

We have a rule in our team, whoever writes the code, is not allowed to test it. But again, we are not in a perfect world, where this was always possible. There have been times where I was the only one not on vacation, so only I was available to test my code. But in general I don’t see the point of removing QA. I feel like that would be a bad idea. QA are always ex-software developers, they know their way around frameworks, they know python, they know how to do automated testing, they know how software works. It’s not like they are completely alienated to software and its internals. They are software developers, with a lot more knowledge about how quality assurance works. I think that would be like shooting yourself in the foot. I couldn’t even imagine working without QA. We would probably panic. Who would test the product? Just because a product looks good and works good, doesn’t mean it actually is.

Do you find unit tests are more of a help or a hindrance?

That is a very good question… I am a bit split on this. I have worked on products where almost everything was unit tested, and it was an absolute pain to work with this project. The product owner would come to us ask us to work on this feature, and it was an astronomical workload, because it meant changing 60 to 70 unit tests and writing new ones. We couldn’t be as productive, because we had so many unit tests. But paradoxically, we also didn’t have the best quality, even though we were unit testing everything. No one ever said anything about us having the best quality. So, I think it’s a very grey area. Each scenario needs to be looked at by the whole team and we’d need to make that decision together, as far as what to test and when to test and how much. A lot of people have this black and white idea that everything has to be tested, but I don’t think so. I’ve worked with companies that were just testing functions they didn’t even have to test, but they were writing unit tests just to get the test coverage up, and that’s the wrong reason. They aren’t even looking at the quality of the tests.

I believe that you should test the entire system as a whole, on a high level, without needing to test every function

Yes, like end to end tests, that would make a lot of sense.

I think we’ll end off with a fantasy. I’d like to know, as a developer, which feature would you dream that iOS would have?

Wow, there are a lot. There are so many. Well, my biggest wish has two parts. The first being that Apple gives up on Xcode. Honestly, it just seems to get worse every year. That is no offense meant to the developers working on Xcode, it’s just that Visual Studio Code is so much smoother. I always have Visual Studio Code open with my iOS project in it. I can never trust xcode. It lets me down a lot so I’ve just switched to Visual Studio Code. The second part is that Apple creates an extension for iOS development for working with Visual Studio Code, with code highlighting and all of that. As a lot of others have done. Flutter, Google has done that. The Rust team has created a Rust extension for Visual Studio Code with code highlighting, everything. Everyone is on Visual Studio Code except for Apple. That would be my biggest wish.

I think that is the most unrealistic wish I’ve ever heard.[laughing]

It probably is [laughing]... I’ve also heard that Apple will never do that. But I don’t see why not though. If you look at Android Studio, Google is behind it, they say that this is the IDE for Android development. But, they’ve also done extensions for Visual Studio Code. It’s just Apple not wanting to open things up. One day. One Day. Let’s see.

What about Flutter, which feature would you dream of?

Wow, that is a really tough one. Honestly, I can’t think of anything. It’s not that Flutter is perfect, it’s just that in my perspective Flutter is open. Flutter is getting better and better every day. It is just so easy and with Flutter I feel safe that the community will fix things. But with Apple, for example, I have to wait a year before their engineers decide to maybe fix something. I think knowing that Flutter is so open, you could pretty much wish for anything and it will happen. So honestly I can’t give you a straight answer.

This has been very interesting, from a technical point of view and from our personal perspective, thank you for your time and your participation!

Shipbook gives you the power to remotely gather, search and analyze your user logs and exceptions in the cloud, on a per-user & session basis.