“I'm just a project enthusiast and user of the Dart language” - an interview with Ari Lerner, the author of the famous ng-book



    How to write nine books on completely different technologies, including Angular, Vue, React, React Native and others? What is the most important thing in training, what is a “hallway chat” and in general, what does Dart and Flutter have to do with it?

    Today our guest is the author of many books and articles on programming, including ng-book - Ari Lerner . What will be the further book that the author thinks about such a ... contradictory language as Dart, and why it is so important conferences to communicate, ask the guys from software HolyJS Conference Committee ( Dmitry DmitryMakhnev Makhnev and Eugene bunopus Cat ).

    - Hello. In our interview there will be three sections, in the first we will talk about you, in the second about Flutter, and the third will be final. Let's start to tell you a little about yourself?

    - To begin, I would like to thank you for the invitation - I am very pleased to have the opportunity to speak at HolyJS. As for me, I live in Brooklyn in New York and I program as much as I can remember - my first language was assembler in the early 1990s. At the moment I am doing blockchains and deep learning, so far separately. For the most part, I work with clients, helping them get on ICO (Initial Coin Offerings), helping them to work with “token economics”. And still lives with me a wonderful dog Ginger, a mixture of Chihuahua and Corgi - I can talk about it endlessly.

    - What does she look like? The size of a chihuahua, but shaggy, like a corgi?

    - Yes, this is a reduced corgi with a chihuahua's muzzle. Very nice.

    - What do you earn now? Do you write books or work in a company?

    - Both. I am writing a book, but it no longer takes all my time. Until I decided what to do next, I work for myself.

    - As far as I understand, you founded Fullstack.io 5 or 6 years ago?

    - Yes, it was in 2012.

    - Tell us about it.

    - Fullstack consists of two parts, it is a publishing house of textbooks on programming, as well as an educational platform. With regard to the publication of textbooks, our main audience is professional developers, but we also provide textbooks for universities, schools, and advanced training programs. In addition, we conduct online and live training, usually as part of advanced training. We work with companies like General Electric, Walmart, with armed forces and so on.

    - Great. Do you compete with O'Reilly, or do you have a completely different field?

    “We are doing things in many ways similar to what O'Reilly does, but we do not directly compete with them, because we have a completely different scale - we do not represent a threat to O'Reilly's world domination over programming books. In addition, we have a slightly different approach. Usually, books are not updated after publication, so as soon as you read it, it is already out of date. If you buy a book from us, we provide constant updates with it.

    - Do you publish paper books, or just electronic ones?

    - And those and others. We sell paper books through Amazon, but they cannot be updated. Electronic books purchased on Fullstack are automatically updated. You cannot update via Amazon - they have too tight controls.

    - As far as I understand, you are the co-author of many books on Fullstack.io - Fullstack React, Fullstack React Native and, of course, the famous ng-book. To write a book, you need to be very familiar with the subject area you are writing about - be it Angular, React, Vue or anything else. What does your preparation for writing a book look like?

    - Good question. Let me first tell you how I started writing books at all, and why do I like this activity? And then we go on to how work is going on each individual book.

    - Yes of course.

    - In 2012, I reached the ceiling in the company where I worked, and decided that it was time to leave. I created my startup - believe it or not, but it was a scheduling company. For her, I wrote an elegant Erlang and Python backend, it seems, with a touch of Ruby. But there was no good frontend, so I began to explore various frameworks and came across Angular. It was a long time ago, before version 1.0. I started writing frontend for my startup, and I really liked Angular, but the documentation was just awful. To understand how this framework works, I began to read the source code and understand how it works - so my close acquaintance with Angular happened.

    Around that time, I was asked to give a talk on JavaScript at the San Francisco developer training camp, and then I realized that I really liked to teach. Therefore, I decided to combine these two interests and began to write a mini-guide on Angular for beginners. At first, I thought it would be two or three pages of text, but in the end, 650 pages came out, which I continued to update over the years. In the end, I became the author or co-author of nine books. I taught as a volunteer at every major developer training camp in San Francisco. I also volunteer at organizations like Women Who Code and Bridge Foundry projects, and teach ElixirBridge. I even gave classes in a general prison in the San Francisco Bay area, and still teach here in New York.

    Teaching is very important to me, it motivates me to learn more myself. Teaching, I not only help others, I force myself to rise to a new level in order to be able to explain how this or that technology works. I usually prepare by reading the source, especially JavaScript. A year or a half ago, we met Vue, and just started exploring the source code, our work with Vue brought us great pleasure. As I work, I write down all the problems I’m meeting, all search queries on Google, all documentation questions. As a result, we compile a huge and very detailed table of contents, which then with any changes we update along with the entire book.

    - Does this happen automatically, with the help of handlers who follow all this information in the documentation?

    “We have handlers that track release cycles, but unfortunately, almost everything else — editing the content and images — is done manually. We have hooks for React, and we have automatic code updates, but the content has to be updated manually.

    - Clear. As far as I know, you are the co-author of many books. Is it harder to write a book alone or with someone? How do you organize your work, how do you synchronize chapters?

    - Just like when collaborating on an application, we use Git to unify the content, so we have versions and branches. Writing a book in collaboration can be difficult, although I think it is somewhat easier in the case of books on technical specialties than on non-technical ones. I think the hardest thing is to ensure a uniform tone for all sections, and determine which demos to use. But, in general, this is not a very difficult task. All attention is absorbed by writing and editing, and we are constantly in touch with each other, which greatly simplifies the process. Over the years, we have developed letter templates that ensure the unity of style to all our numerous authors. And we do our best to ensure that our co-authors write with us, not for us. We position ourselves as a team in which everyone works with each other, and not as a publishing company, for which the authors work. In addition, we are all co-editors for those books that we write. Having an editor or editors helps ensure a consistent style throughout the book. Each author edits a section written by another author.

    As for tools, we use Git, as well as simple text editors and Markdown. I usually work in Visual Studio Code or Spacemacs - a combination of Emacs and Vim, I highly recommend it if you haven't tried it yet. In addition, we have a lot of our own software, which we wrote to compile, work with style and preview books in real time. We use it before publishing a new release or update of a book. Most of our tools are written in JavaScript, TypeScript or Python.

    - Do you use flexible methodologies like Scrum when writing books?

    - Yes, but not too active. We hold a kind of modified stand-up meetings, but not every day, but every week, or a week, depending on the pace of work on the book. If I work alone, then my whole stand-up is that I open my text editor, but if I work with someone, then we are constantly in touch with each other through Slack and Google Hangouts.

    - How long does it take you to write a book?

    - It depends on what kind of book it is, whether I work with co-authors, on the speed of the framework. For example, I wrote ng-book in four months, working in the evenings and on weekends. But for me it is absolutely unimaginable speed, I still do not understand how I managed to do so much. Usually one book takes from six to twelve months.

    - Interesting. You spend a lot of time working with interesting tools and processes, possibly co-authoring with someone else, then giving the book to the publication. When the publisher tries to translate the fruit of your work into another language, how do you check the quality of the translation? I ask, because when I started programming, I could not read technical documentation in English, so I read many books in Russian - for example, the translation of Good Parts of JavaScript and the most famous books O'Reilly. As far as I know, these translations were terrible. I think about how the authors of the books should have related to this, and what kind of way they could have checked the translations. What is your overall opinion about translations?

    - Here I can only talk about my personal experience and how Fullstack works. We have many situations where we do not speak the language into which the book is translated - for example, most of our books are translated into Chinese, and I do not speak Chinese. True, over time I learned a few words, I have a special application for this, Babbel, with which I learn foreign languages. But in the case of Chinese, the best translations were obtained when our translator was also a programmer at the same time. Thanks to this, for any questions, the translator was easier to ask us a question in English, and then correctly translate the answer into Chinese. In Russian, I, unfortunately, do not speak either. I can say "bicycle" - although no, as you hear, even this I can not say. Of course, it's hard not to know the language in which the software is written.

    - A similar situation was with Vue. As far as I know, his first releases had rather bad documentation, and many issues were described in Chinese. As far as I know, now the mandatory requirement is English.

    - Yes it is. I am lucky that my native language is English. Even though I’m not perfect on it, I don’t have any problems with the documentation. I believe that translations are very important. In addition, we live in a time when machine translation is becoming more and more qualitative, especially due to deep learning - this is one of the reasons why I became interested in deep learning. However, I do not think that for all these problems there is one panacea.

    - I recently stumbled upon a heated discussion in the Russian part of Twitter. One party to the dispute argued that translations are by definition evil, because programmers are required to know English, it is an international language for everyone. Others said that for juniors and those who do not speak English well, the documentation must be translated. Do you have an opinion on this controversial issue?

    - The arguments of both sides are close to me. What I will say now is just my initial reaction, for a long time I did not consider this problem. Perhaps in person we can discuss this topic more deeply. It seems to me that now so much code is written in English that it would be extremely difficult to get rid of English. There are international languages ​​- for example, JavaScript is an international language, if you speak it, then you can communicate with any person anywhere in the world. The presence of an international language - English - makes it easier for us to communicate and collaborate with developers around the world; for example, I spoke with developers in India, France, England, China, Australia. Of course, this is not entirely fair with respect to people who do not speak English - I’m sure if I didn’t speak English, I would have a different opinion on this. In addition, as I have already said, these are just my primary thoughts, I have not considered this problem for a long time, and perhaps tomorrow my opinion will change.

    - Yes, we can discuss this in person. Now let's talk about books - they are becoming less popular than before, due to the emergence of platforms such as Media, Twitter, and so on. Do you think books disappear?

    - I am not convinced that books are becoming less popular. I believe that everyone works and learns in different ways. Online services in their function are similar to classes in classrooms. And it seems to me that online learning is suitable for developers who want to learn different languages ​​and frameworks differently. Some people find it easier to work with documentation, others - with source codes, some work better in groups, others - alone, through trial and error, or reading books on trains and airplanes and then implementing what they read in practice. On the other hand, I taught in classes where everything was exactly the opposite and where the students simply could not sit down for a book, it gave them nothing. Not that they are not able to read at all, they simply receive less from reading than from working with other people. I think One of the very important achievements of the Internet for the programmer community is that it has made learning more accessible and success more achievable. Sites and services like Medium or Coursera help spread knowledge and make possible a variety of ways to learn. I am proud to be involved in this evolution of education. Perhaps in the future our books will become interactive, and we will be able to combine them with online courses.

    - I remember that once books were sold from a CD or DVD with examples. Now this format is out of fashion.

    - Yes, now everyone prefers to send zip-archives - for example, we combine all our demos into one zip-archive. One of the most useful tools we have developed allows us to write all the source code used in the book in one place, and then we have tools that automatically update it from the original sources. Suppose we need to select a row, class, object, or function that we discuss in a book. We have tools through which you can make direct links to the source code. This is also useful because every time you download a book, the source is updated. So we do not write the source directly into the text, but into a separate file.

    - My next question will be related to the previous one. You said that everyone learns differently and I, as a developer, can read books, watch videos on YouTube, read articles on a platform for learning. But why should I attend conferences?

    - This is a good question. Offhand, I can name two reasons why it is worth doing. The first is the most obvious: presentations and reports at conferences are usually well thought out and specifically designed for viewing. As a rule, such a report is devoted to a clearly defined problem - for example, refactoring. When you sit in the audience, where there is a good report on refactoring, it is as if you are refactoring yourself, you are included in the presentation, in the process. Well, for me the personality of the speaker, his emotions are always interesting.

    The second reason is less obvious. I call it “hallway chat” - besides the actual reports, you meet and communicate with people who do the same thing as you. Our activities as developers are by definition individual - but when you begin to communicate with many other people who are in the same space as you and are doing the same things as you, this activity automatically becomes social. Another benefit of “socializing in the lobby” is that you meet people who need your services, your technical knowledge or teaching experience. In my experience, we find more customers than anywhere else — even our books and our videos.

    - You have already written a lot of books - tell me, what are you working on now? Maybe some spoilers?

    - Now I mainly deal with blockchains. If we talk about blockchains, augmented reality, deep learning, in these areas it's great that they are very popular now, so at almost every conference I attended over the past few years, I entered into very lively discussions with people interested in these items. And often it could be the front end developer on Google, who in his spare time deals with other topics.

    As for me personally, the projects that I do are mainly related to the economy - and the most surprising is that this is a very interesting subject. In addition, I am currently working on a book called “C ++ for JavaScript developers”, which is still in the early stages of writing. I will be very happy to discuss this topic, if the meeting at the conference on JavaScript someone who worked with C + +.

    - Will this book be somehow related to WebAssembly? You understand that C ++ and JavaScript ...

    - The book is mainly devoted to EOS - this is a fairly new blockchain. It is similar to Etherium, but created using LLVM, and this allows you to write a contract for anything that compiles into LLVM, including C ++.

    - Great. Let's move on to the next section, it will be more closely related to your presentation at HolyJS. You used to work with Angular, Vue, React, JavaScript - and now you are making a report on Flutter, Google's mobile platform, written in Dart. What prompted you to this?

    - In such a formulation, it really sounds funny. Here is a similar story on how I came to Angular, as I have already mentioned above. I wanted to write a few applications for myself and my friends who use Android, who use iPhone. We already published a book about ReactNative, and I had experience with this platform, but I wanted to try something else. I can write in Java, Kotlin and Swift, so I started writing an application in Swift. As far as I know, attempts are being made to adapt Swift for Android, but those with whom I am familiar are still at very early stages, you cannot count on them. In addition, it seems to me that many of them are hacks. That is, the developer is used to iOS and is trying to simply transfer his experience to Java, or, on the contrary, he is very familiar with Java and climbs with it in iOS. Besides, I did not want to part with the JavaScript community - I had very close ties with it, I could use wonderful tools like Redux, there were a lot of libraries, in the absence of which I would have to reinvent the wheel. As a result, I decided to search for another cross-compiled framework and found Flutter.

    Flutter is written in Dart, it is a compiled language, much like TypeScript. It provides easy integration with JavaScript libraries, so I could build on my experience with, say, Redux. Another advantage of Flutter is that everything in it is a widget, so that the process of writing applications becomes faster and more understandable. And data immunity makes applications safer, errors are detected very quickly. In addition, Flutter has AOT compilation and JIT compilation, and the many built-in widgets make it very easy to create an application using the familiar UI. Due to the fact that you can see how widgets work in Flutter, you begin to better understand how Flutter works.

    Flutter has many other strengths - testing, package management, distribution, compiling. One of the coolest features of Flutter is the hot reload to which we are so used to the web. For example, when you build an application on Swift, you compile, then launch the application, then you may need to press a few keys to return to the screen where you worked, solve the problems that occurred, after which the whole cycle repeats. Further, with Flutter, your UI will always be localized in the same language in which your business logic is written. As for my experience with Flutter, I have written several applications on it, and I absolutely love this process. Still need to say that Dart is quite similar to TypeScript, which, in turn, is similar to JavaScript,

    “But Dart is a strongly typed language, so writing programs on it just as you write in JavaScript will not work. What do you think of Dart in general, how about language? What are its advantages?

    “To be absolutely honest, I think Dart is beautiful.” I like static typed languages ​​- although I have nothing against dynamic languages, I like Clojure the most. But static typing has many advantages, and it seems to me that many developers began to switch from JavaScript to TypeScript because of them, although the latter has the opportunity to remove typing and allow the compiler to determine the types on its own. Dart also has something similar, it performs type inference, so there is no strict typing in it. However, the advantage of languages ​​with static typing, even with type inference, is that they can be translated into other languages ​​very quickly and errors can be detected before the application is launched. As I said before, TypeScript and Flow have it all. Compilation provides predictability and speed. in Flutter, it occurs in native code. In addition, as I said, Flutter has a JIT compilation, which makes the development cycle much faster and simpler, and thanks to it you have a very quick restart when developing an application on Flutter.

    There are many other attractive things in Dart - for example, the scope is much simpler than in JavaScript, you do not need to “bind” functions. Classes are first-order objects, they have explicit interfaces, constructors are named — if you work in Java, you most likely like them. I think this is super cool, it makes it easier for us to write on Dart, and then compile it in JavaScript and then use this JavaScript. By the way, I did not seem to mention, yes, Dart compiles to JS. Isolates inside Dart allow using Web workers along with Dart. In my opinion, Dart greatly facilitates the most difficult aspects of development. In addition, Dart has a lot of great tools, great libraries for Flutter, the launch time is very short, because the Dart code is compiled directly into native code,

    - Deserialization and the like.

    - Yes. In my opinion, the React Native community has created many good libraries, but there are still many difficulties - for example, you cannot pass JavaString objects, they must be serialized into string objects. With Flutter, you don’t need to do anything like that, because the compilation takes place directly into the native code. Finally, since Dart is similar to Java, C #, ActionScript, and JavaScript, the environment in which you write is familiar, and you can rely on your entire experience with these languages.

    - While Clojure, for example, is something completely different. And with Dart it is cozy, as under a blanket.

    - Yes, I wrote on Clojure - everything is upside down.

    - What kind of applications do you think you can - or need - write to Flutter? Is it possible to write a bank client, a financial application or an application that requires many screens? Or is it just good enough to write “Hello World” on it?

    - So far I am very impressed with the speed of development and the speed of the interfaces I created on Flutter. If you choose between native development or a cross-compiled framework like Flutter or React Native, a lot depends on your team. In a properly designed application, I think there is no limit on the number of screens you can write - here Flutter is not inferior to other options. If you have a small team and you need to bring your application to as many users as possible, regardless of platform, without sacrificing the performance of your application in runtime - definitely use Flutter. If you have a lot of employees, and there are developers with a lot of experience in writing native code, then rather the question arises as to how you will recruit your team - will you recruit people, Writing perfectly in Java or Swift, or people who can write code for the frontend of your web application, and for the backend on the server, and for the mobile application. And here, I repeat, the advantage of Flutter for me is that it allows you to write in a language with which I am well acquainted.

    If you answer your question more directly, Flutter is great for apps that display some content — for example, it would work for Twitter. The situation is different when you need performance that only a native application can provide, for example, in the case of AR and VR applications. My only AR application is written in Swift, and I haven’t translated it to Flutter yet. In part, this is because both on iOS and on Android are very convenient frameworks for virtual reality and augmented reality.

    - You mentioned that Flutter would be suitable for writing Twitter - but Twitter is now written in PWA. Can I compare Flutter with applications on PWA? They are also cross-platform, and they have many other similarities.

    - As far as I know, in the future it will be possible to compile applications on Flutter into web applications, for the time being this cannot be done. But if you have written the business logic of your web application on Dart, then you can easily use it in a mobile application. And Dart is very fast. Often, Dart-compiled JavaScript code will be faster than code written directly in JavaScript.

    - I think this is a somewhat controversial statement.

    - Well, I will formulate it differently. Quite often, compiling Flutter code is faster than code that you would write directly in JavaScript.

    - Clear. If we are talking about languages ​​in general, then there are many that can be compiled into languages ​​on other platforms. One of them, of course, is JavaScript - now you can write anything for any platform in JavaScript. There are frameworks of this kind - for Angular it is Ionic, for cross-platform mobile development - Cordova PhoneGap. Is there one language that can satisfy all needs? Maybe this is javascript?

    - Interest Ask. I think the fact is that JavaScript is easy to learn, so its community is growing rapidly, which allows you to generate a lot of ideas — thanks to this, React Native, Node.js and, in part, Dart. Of all the existing JavaScript languages, in my opinion, the closest thing to the universal language model for all platforms. But personally, I am drawn to languages ​​created on the basis of a certain idea - for example, I really like functional languages. I don’t think they will ever fall out of use. Nevertheless, if in 2018 you decided to learn how to write in any language, and you don’t know what else you will be doing - web, mobile applications, backend - you will not regret choosing JavaScript.

    - But if JavaScript is so great, then why are new languages ​​emerging now - Go, ClojureScript, Dart? Why are other languages ​​needed if there is javascript?

    - And if I like apples, why eat other fruits? I will now say the phrase that is often repeated in training camps, and not only there - it is very important that the tool matches the work to be done. I write a lot of code on Go, because everything related to blockchains I do on Go or C ++ - speed is very important there. And I write all the interfaces in JavaScript or Dart, and sometimes I use ClojureScript. The bottom line is that C is not going anywhere in the near future, even though it is rather old. It is designed for applications that especially need speed and good memory management. One way or another, you will have to put up with the peculiarities of the language in which you work. For example, garbage collection will always be a problem for JavaScript, and you will always have to deal with it when writing large applications. Inevitably, you have to sacrifice performance at runtime for the sake of simplicity in the development cycle. My report is by no means directed against Swift or Java - as I said, my application with AR is written in Swift, because, on the one hand, I haven’t ported it to Flutter yet, but on the other hand, Swift is perfect for this task.

    - It seems that in 2013, when they announced the creation of Dart, there was a lot of excitement around it, but then many people forgot about it, and now in many communities you can hear that Dart is dead and there is nothing more to expect from him. What do you think about the future of Dart and Flutter, and about the future of Dart apart from Flutter? After all, there are AngularDart, and Dart for the backend.

    - Good question. If I knew the answer to it, then I would sit somewhere on a warm beach, or on my own yacht with a helipad. If you make any assumptions, then first you need to say that I do not belong to the Flutter team - I am just an enthusiast of the project and a user of the Dart language. I think the Cupertino library - Flutter interface for iOS - will grow. And, it seems, the Flutter team wants to add the ability to write native desktop applications to Flutter - but I’m not sure about that.

    As for the creation of Dart, then, in my opinion, it was announced too early, and this led to excessive enthusiasm and premature hopes. In 2013, it was the year of EcmaScript and, I believe, it was an obvious brute force on the part of Google to try to influence the ECMAScript team. And besides, Flow and TypeScript from the point of view of typing in the language, have become more popular. I wish Dart and Flutter all the best, especially with the upcoming release of version 1.0 of Flutter.

    There is a project that works just like Flutter, called Fuse, but it is based on C #. That's about his future, I really have doubts. At the same time, the JavaScript community is growing very fast, and since Dart is close to JavaScript, it will contribute to the interest of developers in Dart and Flutter.

    - Great! Thank you. I would like to talk about conferences. What is most important about them?

    - As I already mentioned, for me in conferences the most valuable is “hallway chat”. And here a lot depends on the conference participants themselves. Interesting content, memorable speakers and events related to the conference help to create and strengthen a community of like-minded people. All that helps this community thrive is important. And, as I said, I like to go to conferences, because they make my work social, not individual.

    - As far as I know, this will be your first trip to Russia?

    - Yes.

    - What are your expectations from Russia, from Moscow and from HolyJS?

    “Since, apart from Moscow, I will not see anything in Russia, the first two parts of the question will be, in essence, one and the same. As already mentioned, I have never been to Russia - I mainly traveled to China and the countries of that region, that is, to Taiwan, South Korea. As I understood from what I read about Russia, you have a different culture, you do everything a little differently than we do, and it will be very interesting for me to find out how it looks in practice. This is one of the reasons why I like to travel - I am always curious how other people live and what their priorities are. New York has its own culture, and all my acquaintance with Russian culture comes down to getting a visa and visits to a local restaurant. So what awaits me is a new and fascinating experience, what kind of experience it will be - I cannot predict.

    As for HolyJS, as far as I know, the developers in Russia are very purposeful, smart and accurate. I do not want to offend anyone in France or in England, but there the severity can rather be found in communication, so I look forward to serious technical conversations with serious techies. Developers in Russia, in my opinion, are very cool, and I would love to talk with you personally and with your community.

    And, of course, I expect a cold in Moscow.

    - What are you, what a cold, -10 or -15 Celsius, utter nonsense.

    - Just? Then I will be in shorts.

    - And in sunglasses. But seriously, we have cool Dart and Flutter communities - although, of course, they are far from the JavaScript community. And in both cases, soon noticeable events: HolyJSwill be held November 24-25, and on December 1 there will be a conference on Dart and Flutter.

    - Great. By this time, Flutter will be out of beta.

    Although in the case of Flutter, the code is written on Dart, the Ari report on HolyJS will be designed for people with JavaScript experience: a preliminary acquaintance with Dart is not required. And the discussion areas at the conference mean that after the report there will be an opportunity to discuss everything that interests Ari: at least ask a question about Angular, at least give him a ng-book for a signature. In general, see you November 24-25 on Holi !

    Also popular now: