Неизданное: #9 - JavaScript (с Сашей Белецким)

DotBand

DotBand.com

Неизданное: #9 - JavaScript (с Сашей Белецким)

DotBand.com

Всем привет, это девятый выпуск подкаста .Band, юбилейный.

Hello everyone, this is the ninth episode of the .Band podcast, a special anniversary episode.

Почему девятый?

Why the ninth?

Ну, потому что мы начали с нулевого, если вы не забыли.

Well, because we started from zero, if you haven't forgotten.

Да, сегодня девятый выпуск, у нас есть гость, у нас есть тема.

Yes, today is the ninth episode, we have a guest, we have a topic.

Наш сегодняшний гость это Саша Белецкий.

Our guest today is Sasha Beletskiy.

Саша, привет.

Sasha, hello.

Всем привет.

Hello everyone.

С вами, как всегда, ведущий подкаста Дмитрий Пасько.

With you, as always, is the host of the podcast, Dmitry Pasko.

Толик Колесник.

Tolik Kolesnik.

Тон Винограденко.

Ton Vinogradenco.

Да, и тема нашего сегодняшнего выпуска, как ни странно, JavaScript.

Yes, and the topic of our today's episode, strangely enough, is JavaScript.

И мы хотим поговорить с человеком, который знает и .NET, и JavaScript.

And we want to talk to someone who knows both .NET and JavaScript.

Я бы хотел немножко представить тебя, но я думаю, ты справишься с этим лучше меня.

I would like to introduce you a little bit, but I think you will do it better than I.

Окей.

Okay.

Меня зовут Саша.

My name is Sasha.

Саша Белецкий.

Sasha Beletsky.

Я работаю в компании Ciclum на интересный датский проект под названием Economic,

I work at a company called Ciclum on an interesting Danish project called Economic.

в котором я, в частности, занимаюсь JavaScript.

in which I, in particular, am engaged in JavaScript.

То есть, а на сколько процентов ты занимаешься JavaScript, а на сколько процентов .NET?

So, what percentage of your time do you spend on JavaScript and what percentage on .NET?

Ну, когда я пришел в компанию, у нас два больших продукта.

Well, when I joined the company, we had two major products.

Один очень большой, один поменьше, вот.

One very big, one smaller, that's it.

И первый продукт, он уже довольно такой в возрасте, где-то к десяти годам идет, к юбилейному тоже идет выпуску.

And the first product is already quite old, approaching ten years, and it's also getting ready for a anniversary release.

Он написан на .NET, причем как бы на миксе технологий, начиная там с ASP, заканчивая .NET 3.5.

It is written in .NET, using a mix of technologies, starting from ASP and ending with .NET 3.5.

И новый продукт, который мы делаем, это чисто .NET.

And the new product we are making is purely .NET.

И JavaScript-овый стэк.

And a JavaScript stack.

Учитывая хипстерские вияния, это еще и сервер-сайт JavaScript.

Considering the hipster trends, it's also a JavaScript server-site.

Да, это еще и сервер-сайт JavaScript, абсолютно верно.

Yes, it is also a JavaScript server-site, that's absolutely correct.

Вот.

Here.

И первый наш вопрос, собственно говоря, как ты докатился до такой жизни?

And our first question is, actually, how did you end up in this situation?

Ну, мы насколько поняли, это же работа заставила.

Well, as far as we understand, it was work that made it happen.

Ну, и в рамках этого же вопроса, пожалуйста, ответь.

Well, within the framework of this same question, please answer.

Вот каких усилий тебе стоило как C-Sharp-разработчику переключиться на 100% JavaScript,

Here is the effort it took you as a C# developer to switch to 100% JavaScript.

на клиенте, на сервере?

on the client, on the server?

Потому что лично для меня JavaScript в какой-то момент, ну, для всех разработчиков,

Because for me personally, JavaScript at some point, well, for all developers,

это какие-то штуки сделать на jQuery, плюс прикрутить к jQuery UI какой-то интерактивный элемент,

it's about doing some things in jQuery, plus adding some interactive element to jQuery UI,

там, я не знаю.

There, I don't know.

Да, джак-запросик, дата-питер, и вот на этом ограничиться.

Yes, jack request, date-peter, and let's leave it at that.

Но язык растет, и вот мне бы хотелось услышать от тебя что-то.

But the language is growing, and I would like to hear something from you.

Абсолютно верно.

Absolutely correct.

Вот про JavaScript, у него за ним сложилась такая не очень, может быть, даже хорошая репутация,

Here's about JavaScript, it has developed a rather not very, perhaps even a bad reputation behind it.

и, в принципе, репутация простой и понятной технологии, простого и понятного языка.

And, in principle, the reputation of a simple and understandable technology, a simple and understandable language.

Потому что программирование в JavaScript на протяжении N количества лет,

Because programming in JavaScript for a number of N years,

это был такой копипаст-стайл, мы берем, находим какой-то уже готовый код,

it was such a copy-paste style, we take, find some already ready code,

как правило, какой-то jQuery-контрол, интегрируем его в свое приложение, и как бы мы счастливы.

As a rule, some jQuery control, we integrate it into our application, and we are so happy.

К сожалению, когда мы проходим этот этап очень простого веб-UI,

Unfortunately, when we go through this stage of a very simple web UI,

когда мы приходим к тому...

when we come to the point...

Потому что мы, на самом деле, на фронт-энде строим реальное приложение,

Because we are actually building a real application on the front-end,

этот подход перестает работать.

this approach stops working.

И, в принципе...

And, basically...

За счет объема кода или как?

At the expense of the volume of code or how?

За счет объема кода и за счет того, что jQuery-приложение, оно становится слабо поддерживаемое,

Due to the volume of code and the fact that it is a jQuery application, it becomes poorly maintained.

из-за того, что не используются правильные паттерны,

due to the fact that the correct patterns are not used,

ведет это все к тому, что утечки памяти, неправильный анбиндинг от ивентов,

leads to the fact that memory leaks, improper unbinding of events,

приложение начинает тупить, вы, может, видели большие приложения,

the app starts to lag, maybe you've seen large apps,

написали...

they wrote...

Писанные на JavaScript, которыми ты пользуешься несколько минут,

Written in JavaScript, which you use for a few minutes,

и после нескольких минут клацания в интерфейс, оно начинает жутко тормозить.

And after a few minutes of clicking in the interface, it starts to lag terribly.

Это все, в принципе, как бы утечки памяти и неправильные ghost-ивенты,

This is basically all about memory leaks and incorrect ghost events.

которые накапливаются, и можно в профайле резюметь.

which accumulate, and can be summarized in the profile.

Вне зависимости от любого браузера, да?

Regardless of any browser, right?

В принципе, да.

In principle, yes.

Как правило, IE падает самый первый.

As a rule, IE crashes first.

Chrome держится чуть-чуть больше, но, в принципе, падают все.

Chrome lasts a little longer, but, in general, they all fall.

Вместе с Chrome падает вся операционная система.

The entire operating system crashes along with Chrome.

Убирается более.

It is removed more.

Саша, интересно про утечки памяти в двух словах.

Sasha, it's interesting about memory leaks in a nutshell.

Это как вообще может случиться в JavaScript?

How can this even happen in JavaScript?

Я просто думал, это такой забавный язык, который очень простой,

I just thought it was such a funny language that is very simple.

одно-поточный, как .NET со своими посборщиками мусора.

single-threaded, like .NET with its garbage collectors.

Да, в принципе, так и есть.

Yes, basically that's true.

Казалось бы, что в JavaScript один поток, и есть garbage collector,

It may seem that there is one thread in JavaScript, and there is a garbage collector.

и все вроде бы должно быть нормально, и не за что беспокоиться.

And everything seems to be fine, and there is nothing to worry about.

Но на практике оказывается, что беспокоиться есть о чем.

But in practice, it turns out that there is something to worry about.

И утечки памяти, они возникают и при неправильном отбиндинге от ивентов.

Memory leaks can also occur with incorrect unbinding from events.

Я переведу на всякий случай для русских, это отписание от событий.

I will translate for the Russians just in case, this is a description of events.

О, ужас.

Oh, horror.

Как бы ты это сказал?

How would you say this?

Звучит не так сексуально, как...

Sounds not as sexy as...

Мне кажется, что есть какие-то, допустим, дом-объекты,

It seems to me that there are some, let's say, house-objects,

которые начинают что-то слушать,

who start to listen to something,

а потом эти дом-объекты...

And then these house-objects...

И ты понял, из общего дерева, на них ивенты остаются.

And you understood that from the common tree, the events remain on them.

Абсолютно похоже происходит.

Absolutely similar is happening.

Да, абсолютно верно.

Yes, absolutely right.

И причем, когда мы регистрируем хендлер,

And by the way, when we register the handler,

помимо того, что мы просто слушаем, у нас остается как бы мертвый этот хендлер,

Besides just listening, we have this dead handler left, as it were.

за ним остается closure.

A closure remains behind him.

Вот эта вот вещь, с которой мы знакомимся в JavaScript,

This thing that we get acquainted with in JavaScript,

и closure, весь его scope,

and closure, its entire scope,

и в JavaScript используется refcounting для garbage collector,

and in JavaScript, refcounting is used for the garbage collector,

в принципе, те объекты,

in principle, those objects,

где refclosure используется,

where refclosure is used,

его refcount никогда не уменьшится.

its refcount will never decrease.

И это и идет прямая утечка памяти.

And this is a direct memory leak.

То есть...

That is...

By design.

By design.

Ну, как by design?

Well, how about by design?

Непонятно.

Not clear.

Если бы был другой garbage collector,

If there was another garbage collector,

не по refcounting,

not by refcounting,

а, допустим, как тут, знаете, от дерева корней...

Ah, let's say, like here, you know, from the roots of the tree...

А вот, кстати, в Objective-C у них, по-моему, два garbage collector.

By the way, in Objective-C, they have, I think, two garbage collectors.

Один по refcounting, а один классический.

One is by refcounting, and one is classical.

Я не знаю.

I don't know.

Я знаю, что в iPhone 2 версии вообще не было garbage collecting,

I know that the iPhone 2 version had no garbage collecting at all.

а был только по refcounting.

but it was only by refcounting.

У меня есть очень сложный вопрос.

I have a very complex question.

Саша, можешь задать?

Sasha, can you ask?

Окей.

Okay.

Смотри.

Look.

Я знаю, ты писал на C++ в одно время.

I know you used to write in C++ at one time.

Да.

Yes.

Меня очень долго думал про современный JavaScript в последнее время.

I've been thinking a lot about modern JavaScript lately.

И я хотел провести аналогию,

And I wanted to draw an analogy,

а ты скажи, я правильно понимаю или нет?

So tell me, am I understanding correctly or not?

Моя аналогия следующая.

My analogy is as follows.

Я хочу сказать, что jQuery в современном JavaScript

I want to say that jQuery is in modern JavaScript.

это то же самое, что STL в C++.

it's the same as STL in C++.

Ты согласен?

Do you agree?

Нет.

No.

Почему?

Why?

Ну, смотри.

Well, look.

Они тут буквально вот C++,

They are literally here with C++.

современный построен во многом, ну, давай возьмем и STL, плюс Boost.

Modern is built largely on, well, let's take STL and Boost.

Вот без него трудно представить современный язык.

It's hard to imagine modern language without it.

Окей.

Okay.

И JavaScript, он его ренессанс, и современное развитие,

And JavaScript, it is its renaissance, and modern development,

ну, по сути, jQuery стал стандартным языком JavaScript.

Well, essentially, jQuery has become the standard language of JavaScript.

Вот я не знаю насчет стал или не стал, потому что...

Well, I don't know whether I became or didn't become, because...

Ну, формально не стал.

Well, formally I didn't.

Знакомый, который...

A friend who...

Но трудно представить себе JavaScript без...

But it's hard to imagine JavaScript without...

Почему? Перестань.

Why? Stop it.

Без jQuery, да?

Without jQuery, right?

Нет, да.

No, yes.

Да, jQuery.

Yes, jQuery.

Мне кажется, это еще завязка на стекле.

I think it's still a tie on the glass.

Например, в дотнет-стеке сразу у тебя в приложение опихивается jQuery,

For example, in the dotnet stack, jQuery is immediately incorporated into your application.

и поэтому оно очень распространено.

and that's why it is very common.

Ну, давай Саша скажет.

Well, let's have Sasha say.

На рейтинге?

On the rating?

Да, давай Саша.

Yes, let's go, Sasha.

По моему мнению, что такое, в принципе, что такое jQuery?

In my opinion, what is jQuery, basically?

И почему jQuery стал суперпопулярным?

And why did jQuery become super popular?

И, в принципе, jQuery это вещь, которая, ну, во многом популяризировала сам JavaScript.

And, in principle, jQuery is a thing that, well, in many ways popularized JavaScript itself.

Совершенно.

Absolutely.

Потому что...

Because...

Мы вырежем его.

We will cut him out.

Отвечай, отвечай, отвечай.

Answer, answer, answer.

Почему сложность JavaScript основная заключалась, когда мы начинали программировать, это DOM.

The main complexity of JavaScript when we started programming was the DOM.

И DOM это такая вещь, которая довольно отпугивающе действовала на программистов.

And the DOM is something that had a rather intimidating effect on programmers.

Очень непонятный, очень непонятный, довольно непонятный интерфейс.

Very unclear, very unclear, quite an unclear interface.

И задача jQuery была, это то, чтобы сделать DOM-манипуляцию удобной.

And the purpose of jQuery was to make DOM manipulation convenient.

Вот, STL, в свою очередь, это набор алгоритмов, структур данных и там итераторов и прочего.

Well, STL, in turn, is a set of algorithms, data structures, and there are iterators and other things.

Нет, но тем не менее...

No, but nevertheless...

Нет, тем не менее, jQuery это не только DOM, это подписка на ивенты, там, давай вспомним Deferred и Bind и так далее.

No, however, jQuery is not just about the DOM; it's about event subscription as well. Let's not forget about Deferred and Bind and so on.

Это уже, ну, подписка на ивенты, это не более чем врайперы на DOM, сделанные удобно, скажем так.

This is already, well, subscription to events, it is nothing more than convenient wrappers on the DOM, so to speak.

STL все-таки это, ну, как по моему мнению, немножко в другую степь.

STL is still, well, in my opinion, a little bit in a different league.

Но, с чем я с тобой согласен, что точно так же, как jQuery для JavaScript, STL для C++,

But I agree with you that just like jQuery for JavaScript, STL is for C++.

и тот и другой фреймворк, и та и другая библиотека, сделала жизнь программиста легче.

Both frameworks and both libraries have made a programmer's life easier.

Вот в этом они однозначно схожи.

In this, they are definitely similar.

А по своей сути это, конечно, вещи разные.

And in essence, these are certainly different things.

Кусочек посвящен тем ребятам, которые все подкасты слушали, но при этом пытались найти плюс-плюс,

This piece is dedicated to those guys who listened to all the podcasts, but at the same time tried to find a double plus.

и не было у них знакомых никаких словечек, ничего такого.

And they didn't have any familiar little words, nothing like that.

А тут раз, буст.

And then suddenly, a boost.

Да, в подкасте про JavaScript очень нежно нам слушать такие разговоры.

Yes, in the podcast about JavaScript, it is very nice for us to listen to such conversations.

Саша, а мне такой вопрос.

Sasha, I have a question for you.

А ты знаешь какие-нибудь еще динамические языки, чтобы можно было сравнить с JavaScript?

Do you know any other dynamic languages that can be compared to JavaScript?

Я немножечко программил на Python, но, наверное, точно не так долго и не так глубоко разбирался,

I programmed a bit in Python, but probably not for very long and not very deeply.

как с C-Sharp, и точно не так, как с JavaScript.

as with C-Sharp, and definitely not like with JavaScript.

Антон, а твой вопрос, может, ты его раскроешь как-то?

Anton, could you elaborate on your question a bit?

Ты к чему-то подводишь или нет?

Are you getting at something or not?

Ну да, да, я дал просто ответ.

Well, yes, yes, I just gave an answer.

И я хотел просто, чтобы ты...

And I just wanted you to...

Это два совершенно разных языка, C-Sharp и JavaScript.

These are two completely different languages, C-Sharp and JavaScript.

Хоть они и сиподобные, то есть я имею в виду динамический и статический.

Although they are sip-like, I mean dynamic and static.

Был ли дискомфорт при переходе?

Was there any discomfort during the transition?

Какая парадигма тебе сейчас больше нравится?

Which paradigm do you like more right now?

Ну, короче, мысли по этому поводу.

Well, in short, my thoughts on this matter.

Да, дискомфорт однозначно был, потому что языки абсолютно разные,

Yes, there was definitely discomfort because the languages are absolutely different.

и помимо языка...

and besides the language...

Всех нас...

All of us...

Мы датнет-программисты, но мы очень сильно привязаны не только к датнету и к C-Sharp,

We are .NET programmers, but we are very much tied not only to .NET and C#.

мы очень сильно привязаны к Visual Studio,

We are very attached to Visual Studio.

мы привязаны к...

we are tied to...

Мы привязаны к своим тулам, мы привязаны к своим библиотекам,

We are tied to our tools, we are tied to our libraries,

мы привязаны к Foundation.

We are tied to the Foundation.

Когда попадаешь в JavaScript, в принципе, это как бы попадаешь в такую кустыню,

When you get into JavaScript, it's basically like entering a thicket.

в которой тебе все непонятно, и ты не знаешь, че, с какой стороны,

in which everything is unclear to you, and you don't know what's what or which side to take,

че, с какой стороны начинать решать свою задачу.

What, from which side should I start solving my problem?

И второе, что, конечно, сам язык, тут, наверное, многие разработчики, которые в JavaScript...

And secondly, of course, the language itself. Here, probably, many developers who work with JavaScript...

Я думаю, что только, может быть, в последний год я вот знаю программистов, которые говорят, что мы...

I think that only, maybe, in the last year I know programmers who say that we...

Я вот JavaScript-овый программист, я не знаю ни C++, ни C-Sharp'а, таких еще там пару лет назад было очень мало,

I'm a JavaScript programmer, I don't know C++ or C#, there were very few like that a couple of years ago.

и поэтому, когда ты приходишь в JavaScript, ты начинаешь свой накопившийся опыт, там, C-Sharp'а,

And so, when you come to JavaScript, you start with your accumulated experience from C#.

проецировать на JavaScript, и, в принципе, делаешь очень большую ошибку, идешь не очень правильным путем.

projecting onto JavaScript, and, in general, you are making a very big mistake, you are not going the right way.

Скажи, пожалуйста, а вся твоя команда, она перешла с C-Sharp'а на JavaScript?

Could you please tell me, did your whole team transition from C# to JavaScript?

Да, абсолютно верно, то есть у нас...

Yes, that's absolutely right, which means we have...

Чем было позволено это решение?

What allowed this decision?

У нас .NET-шоп, классически все .NET-программисты, но то большое приложение, которое я начал,

We have a .NET shop, all classic .NET programmers, but that large application that I started,

которое я упоминал в начале своего рассказа, оно развивалось и развивалось до...

which I mentioned at the beginning of my story, it developed and developed until...

До такого момента, когда все пришли к выводу, Web Forms is not enough.

Until the moment when everyone came to the conclusion that Web Forms is not enough.

Мы хотим строить динамические приложения, мы хотим делать Rich UI, мы хотим по максимуму использовать Ajax,

We want to build dynamic applications, we want to create Rich UI, we want to make maximum use of Ajax.

поэтому все началось с того, что мы начали строить большое jQuery-приложение.

So it all started with us building a large jQuery application.

Сингл-пейдж?

Single page?

Это даже был не сингл-пейдж, но с богатым фронт-эндом, с гибкими контроллами,

It wasn't even a single page, but with a rich front-end, featuring flexible controls,

и объемы jQuery-кода, они были очень большие.

And the volumes of jQuery code were very large.

Я уже там не помню, какое количество файлов, но там за две сотни файлов,

I don't remember the exact number of files anymore, but there are over two hundred files there.

и там, не знаю, за сколько, 20 тысяч, или, наверное, гораздо больше строчек кода.

And there, I don’t know, for how much, 20 thousand, or probably many more lines of code.

И мы пришли сами к тому, что jQuery — это совершенно не архитектурный подход.

And we came to the conclusion that jQuery is not an architectural approach at all.

И когда мы на сервере привыкли к MVC, когда мы знали, что такое хорошие паттерны,

And when we got used to MVC on the server, when we knew what good patterns were,

проекты...

projects...

И мы это недополучаем во фронт-энде, мы это не реализовываем так, как мы бы это делали на сервере,

And we are not getting this in the front-end, we are not implementing it the way we would on the server.

мы поняли сами, что нам нужен фреймворк.

We realized ourselves that we need a framework.

И теперь расскажи про архитектуру вашего приложения в данный момент.

And now tell me about the architecture of your application at the moment.

Вот, то приложение, над которым я работаю сейчас, это, ну, в двух словах,

Here, the application I am currently working on is, well, in a few words,

это Node.js Backend и Backbone.js Frontend.

This is a Node.js Backend and Backbone.js Frontend.

А что вы используете в Backbone в качестве темплейт-энджинга?

What do you use in Backbone for template rendering?

Темплейт-энджинга и jQuery-темплейт.

Template engine and jQuery template.

Да, ну, потому что...

Yes, well, because...

А вы пробовали какие-то другие jQuery-темплейты, вот, например,

Have you tried any other jQuery templates, for example,

то ли...

either...

Underscore.

Underscore.

Underscore, Mustache, есть и другие варианты.

Underscore, Mustache, there are also other options.

Да, в принципе, почему jQuery-темплейт?

Yes, essentially, why jQuery template?

Дефолт в Backbone идет с Underscore, и Underscore — это великолепная библиотека,

Default in Backbone comes with Underscore, and Underscore is a great library,

помимо темплейтинга-энджина, это швейцарский нож в JavaScript.

Besides the templating engine, it's a Swiss Army knife in JavaScript.

Я сейчас практически не использую ни одно приложение, которое я там либо пишу дома,

I hardly use any apps right now that I either write or use at home.

либо на работе.

either at work.

Без Underscore я тяжело могу себе представить программинг.

Without Underscore, I can hardly imagine programming.

Это вот как .NET-программист, у которого забрали линк.

It's like a .NET developer who has had their Linq taken away.

Вот, примерно такой уровень восприятия.

This is roughly such a level of perception.

И в Underscore есть свой темплейтинг, но он очень-очень простой,

And Underscore has its own templating, but it is very, very simple,

и мы просто до этого использовали jQuery-темплейт,

and we just used a jQuery template before that,

и логичным образом решили продолжать эту практику в новом приложении.

and logically decided to continue this practice in the new application.

Хотя...

Although...

Саша, есть такой вопрос.

Sasha, there is a question like this.

А вот интересно...

And here's an interesting thought...

Понятно про фронт-энд, но непонятно про бэк-энд.

I understand about the front-end, but I'm unsure about the back-end.

Почему вы перешли на Node.js, а не остались на каких-нибудь там MVC, WebAPI, не знаю, whatever?

Why did you switch to Node.js instead of staying with some MVC, WebAPI, I don't know, whatever?

Да, если в двух словах рассказать историю нашего приложения, нового, над которым...

Yes, if I were to briefly tell the story of our application, the new one that...

То есть у нас, в принципе, чем оно качественно отличалось от того, что мы делали до этого,

That is to say, in principle, how it qualitatively differed from what we were doing before.

у нас был некий карт-бланш.

We had a certain carte blanche.

Мы могли решить, что мы будем использовать и как мы будем использовать.

We could decide what we will use and how we will use it.

Выбирая фронт-энд, выбирая между несколькими фреймворками,

Choosing the front end, choosing between several frameworks,

мы пришли к тому, что мы хотим использовать бэкбон,

We have come to the conclusion that we want to use Backbone.

и это было более-менее легкое решение.

and it was more or less an easy decision.

С сервером было гораздо тяжелее, потому что...

It was much harder with the server because...

А, можно вопрос? Между чем и чем вы выбирали?

Oh, can I ask a question? What were you choosing between?

Выбирали, в принципе, смотрели на все, что было в тот момент,

We chose, in principle, looked at everything that was available at that moment.

но основные конкуренты это нокаут и бэкбон.

But the main competitors are Knockout and Backbone.

В финале встретились нокаут и бэкбон.

In the final, knockout and backbone faced off.

А вы смотрели что-то типа XGS?

Have you watched something like XGS?

Нет, вот, кстати, XGS, почему, я даже не знаю, почему на него не пал выбор,

No, by the way, XGS, I don't even know why it wasn't the choice.

наверное, потому что XGS уже супербольшой проект,

probably because XGS is already a super large project,

которым помимо самого...

which, apart from the...

Что мы хотели получить?

What did we want to achieve?

Мы хотели получить структуру на фронт-энде.

We wanted to get the structure on the front end.

Мы хотели иметь там MVC или MVVM,

We wanted to have MVC or MVVM there.

но не тянуть за собой еще какой-то overhead.

but not to carry some additional overhead with it.

XGS, в принципе, это довольно большая штука.

XGS is, in fact, quite a big thing.

Которую нам не хотелось бы с ней связаться.

Which we would not like to be associated with her.

Ну, да, на самом деле, то, что я, ну, у меня есть опыт в интерпрайзе и в продакшене с XGS.

Well, yes, actually, what I mean is that I have experience in enterprise and production with XGS.

XGS это MVC на клиенте, на фронт-энде и плюс большая библиотека компонентов.

XGS is an MVC on the client-side, on the front-end, plus a large component library.

Ну, это все, конечно, тянет за собой то, что это все платное, причем платное достаточно,

Well, all of this, of course, entails the fact that it is all paid, and quite expensively.

ну, по таким существенным суммам, но, тем не менее, это все из коробки,

well, given such significant amounts, but nonetheless, it's all out of the box,

коробки работают и, ну, в основном, работают, то есть у нас часто возникают проблемы,

The boxes work and, well, mostly work, that is, we often encounter problems,

но, тем не менее, они оперативно достаточно с платной подпиской решаются на форуме.

But nonetheless, they are resolved fairly quickly with a paid subscription on the forum.

С Backbone другая ситуация.

With Backbone, it's a different situation.

Имеешь в виду по одной подпиской, то есть что-то выходит быстренький патч

Do you mean one subscription, like a quick patch comes out?

или вам просто рассказывают, что сделать надо было так и так, а не так, допустим, как вы сделали?

Or are you just being told that it should have been done this way and not, say, the way you did it?

И так, и по-другому, то есть если мы сабмитим свой баг, у нас два варианта есть.

So, in one way or another, that is, if we submit our bug, we have two options.

Или нам скажут, в каком релизе это пофиксят или вышлют нам конкретно,

Or they will tell us in which release this will be fixed or send it to us specifically.

конкретно для нас патч.

specifically for us, a patch.

Я понял.

I understand.

То есть бывают такие.

That is to say, there are such.

Здравствуйте, вы дозвонились в поддержку XGS.

Hello, you have reached XGS support.

Пожалуйста, дождитесь свободных операторов.

Please wait for available operators.

Не, ну, на самом деле, пишешь форум и примерно на половину вопросов получаешь моментальное решение

No, well, actually, you write on the forum and get an immediate solution to about half of the questions.

от тех человек, тех людей, которые сидят там круглосуточно.

from those people who sit there around the clock.

На самом деле XGS, там у них работает очень много людей, они получили большие инвестиции.

In fact, XGS has a lot of people working there, and they received substantial investments.

Ну, мы не будем говорить об этом.

Well, we won't talk about that.

Саша, почему не нокаут?

Sasha, why no knockout?

А бэкбон?

And the backbone?

Сложный, очень сложный вопрос.

A complicated, very complicated question.

Потому что, в принципе, я сейчас уже анализирую после года использования нокаута.

Because, basically, I am already analyzing after a year of using the knockout.

И часто на конференциях, где я выступаю, ребята подходят ко мне и спрашивают, что выбирать?

And often at conferences where I speak, guys come up to me and ask, what should I choose?

Нокаут или нокаут или бэкбон?

Knockout or knockout or backbone?

И я могу сказать, что мы сделали выбор за бэкбона.

And I can say that we made a choice for the backbone.

В принципе, как бы ни о чем не жалеем.

Basically, we don't regret anything.

И нас, в принципе, что чуть-чуть не понравилось с нокаутом, это его основная фича.

And what we, in principle, didn't quite like about the knockout is that it's his main feature.

Байндинг данных через HTML дата-атрибуты.

Data binding through HTML data attributes.

Датабайнд.

Databind.

Это супер, как бы, штука, которая идет с нокаутом.

It's a super thing that comes with a knockout.

Но нас смутило этот, скажем так, полюшен HTML.

But we were confused by this, let's say, little HTML.

Мы привыкли делать вещи немножечко по-другому.

We are used to doing things a little differently.

И бэкбон был близок нам по духу того, что мы использовали, как мы писали код до этого.

And the backbone was close to us in spirit to what we used, how we wrote the code before that.

Кроме того, нокаут, насколько я понял, не предусматривает собой никакой MVC.

Moreover, a knockout, as far as I understand, does not imply any MVC.

Это просто...

It's just...

В нокауте нет модели.

There is no model in a knockout.

Да.

Yes.

Ты все пишешь сам.

You write everything yourself.

В нокауте view, это, по сути дела, декорированный HTML.

In the knockout view, this is essentially decorated HTML.

И все, что, как бы, структурно идет в...

And everything that, you know, structurally goes into...

Что дает нокаут как основную фичу?

What does a knockout provide as a key feature?

Это вот эта точка.

This is that point.

Это вот two-way binding.

This is two-way binding.

Но это не то, что нам было нужно.

But this is not what we needed.

Нам было нужно четкий separation of concerns, четкие модели, четкие вьюхи и destability.

We needed a clear separation of concerns, clear models, clear views, and destability.

В нокауте это все достижимо, но немножко не тем способом, как мы это хотели делать.

In a knockout, all of this is achievable, but not quite in the way we wanted to do it.

Такой вопрос насчет нокаута по поводу декорирования атрибутами.

I have a question about the knockout concerning decoration with attributes.

Меня все время смущало, но я сам не помню, проверял или нет.

I was always confused, but I don't remember if I checked or not.

Правильно я понимаю, что валидация страницы в HTML5 или кто еще на XHTML сидит, не будет проходить, когда атрибуты разрешены?

Am I correct in understanding that page validation in HTML5, or for those still using XHTML, will not pass when attributes are allowed?

Да, да.

Yes, yes.

Это стандарт HTML5.

This is the HTML5 standard.

Стандарт HTML, да.

Yes, the HTML standard.

Да.

Yes.

И валидации, там, статические валидации...

And validation, there, static validations...

Data, whatever.

Данные, что угодно.

Конечно.

Of course.

А XHTML?

And XHTML?

XHTML пройдет.

XHTML will pass.

Тоже, да.

Me too, yes.

Отлично.

Excellent.

Да.

Yes.

Data атрибут — это стандарт, часть HTML5.

Data attribute is a standard, part of HTML5.

И, в принципе, даже, как бы, если это не стандарт и браузером не поддерживается, то браузер просто игнорирует этот атрибут.

And, basically, even if this is not a standard and the browser does not support it, the browser simply ignores this attribute.

Да.

Yes.

То есть ничего плохого, как бы, не возникает, даже если это используется.

That is, nothing bad really arises, even if it is used.

Мы сейчас затронули вопрос тестабилити.

We have now touched upon the issue of testability.

Ты можешь продолжить то, что перед этим говорил, и мы можем перейти к вопросу, как вы тестируете аппликацию.

You can continue what you were saying before, and we can move on to the question of how you test the application.

Да.

Yes.

Зависит от того, с какой стороны мы тестируем.

It depends on which side we are testing from.

То есть мы тестируем, в принципе, и фронт-энд, и бэк-энд.

That is, we are testing, in principle, both the front-end and the back-end.

Команда, которая работает над продуктом, достаточно сильная.

The team that is working on the product is quite strong.

То есть никому не нужно было объяснять, что такое TTT, зачем тестировать и так далее.

That is, no one needed to explain what TTT is, why testing is necessary, and so on.

У нас возникали, в основном, консерны, связанные с тем, как.

We had concerns mainly related to how.

Потому что бэк-бонд был довольно новой вещью, и не совсем очевидно с самого начала, казалось, как это правильно делается.

Because the backbone was a rather new thing, and it wasn't quite obvious from the very beginning how it should be done correctly.

Но, тем не менее, как бы, уже с опытом...

But, nevertheless, having experience...

У нас был хороший опыт тестирования jQuery-приложений, прежде всего.

We had a good experience testing jQuery applications, above all.

Именно на описание тестов на jQuery?

Specifically about the description of tests on jQuery?

Да.

Yes.

На описание тестов у нас большой был...

We had a lot to say about the tests...

Мы тогда еще использовали QUnit для тестирования.

At that time, we were still using QUnit for testing.

Вот.

Here.

И TDD в JavaScript для нас, как бы, была не новинка.

And TDD in JavaScript was not a novelty for us.

Поэтому, ну, накопленный опыт, он благополучно мигрировал в бэк-бонд.

Therefore, the accumulated experience has successfully migrated to the backbone.

И оказалось, что с бэк-бондом, как я сказал, с структурой, которую бэк-бонд приносит в приложении,

And it turned out that with the back-bond, as I said, with the structure that the back-bond brings to the application,

тестирование только в плане облегчилось или улучшилось, стало более качественным.

Testing has only become easier or improved in terms of quality.

Мы перешли, там, на другой тестовый фреймворк еще, Jasmine.

We switched to another testing framework there, Jasmine.

Jasmine возьмете?

Will you take Jasmine?

Да.

Yes.

И тоже, как бы, ну, мне он очень нравится.

And also, well, I really like him.

Саша, а есть у вас какие-нибудь лзы continuous-running тестов?

Sasha, do you have any examples of continuous-running tests?

Да, несомненно.

Yes, undoubtedly.

То есть все тесты, которые мы пишем на JavaScript при пуше в Git, они запускаются на TeamCity.

That is, all the tests that we write in JavaScript when pushing to Git are run on TeamCity.

Не continuous-integration, а continuous-running.

Not continuous integration, but continuous running.

Понимаю.

I understand.

Да, я имею в виду.

Yes, I mean.

Континьюс.

Continuous.

Континьюс-тестинг или continuous-integration?

Continuous testing or continuous integration?

Континьюс-тестинг.

Continuous testing.

Нет, нет, Антон прав.

No, no, Anton is right.

Есть тузы для continuous-running, ну, continuous-тестинга, про которые, в принципе, я тоже могу рассказать.

There are tricks for continuous running, well, continuous testing, that I can also talk about.

Но я уже начал про continuous-integration.

But I have already started about continuous integration.

Давай, давай.

Come on, come on.

И то, и то.

Both.

Доведу уже до ума.

I will perfect it.

То есть на TeamCity запускаются тесты.

That is, tests are run on TeamCity.

Прошли мы тоже довольно такой интересный путь от того, как запускать, в принципе, тесты для фронт-энда,

We also went through quite an interesting journey in terms of how to launch tests for the front-end.

от кастомного кода, который через Selenium WebDriver поднимал браузер, запускал там, разбирал output, который он пишет.

from custom code that used Selenium WebDriver to launch the browser, execute it, and parse the output it generates.

Сейчас у нас используется PhantomJS.

We are currently using PhantomJS.

А что такое PhantomJS, Иван?

What is PhantomJS, Ivan?

Окей.

Okay.

PhantomJS – это очень интересный проект.

PhantomJS is a very interesting project.

Не знаю точно, когда он появился, но он, можно сказать, новый.

I don't know exactly when it appeared, but you could say it's new.

По сути дела, это так называемый headless-браузер.

Essentially, this is a so-called headless browser.

То есть это браузер без UI.

So it’s a browser without a UI.

И это веб-кит для...

And this is a web kit for...

А, кстати, по-моему, во втором выпуске Алексей Дьян рассказал про него.

Oh, by the way, I think Alexey Dyan talked about him in the second issue.

Ну, может быть.

Well, maybe.

Я помню.

I remember.

Прости.

Sorry.

Да.

Yes.

Это, по сути дела, объединенный веб-кит для создания DOM-а и Chromium для запуска JavaScript-а.

This is essentially a unified web kit for creating the DOM and Chromium for running JavaScript.

Поэтому что делает PhantomJS?

So what does PhantomJS do?

Он как браузер может загрузить какой-то HTTP-ресурс.

He can load some HTTP resource like a browser.

Если там JavaScript, он его выполнит.

If there's JavaScript there, it will execute it.

In-memory все делает?

Does In-memory do everything?

In-memory.

In-memory.

Если JavaScript манипулирует с DOM-ом, то есть все это как бы выполнится и можно смотреть на то, что в конечном счете произошло.

If JavaScript manipulates the DOM, then all of this will be executed, and you can see what ultimately happened.

Это работает очень быстро.

It works very quickly.

Скажи, я, честно говоря, думал, что тесты ранятся на JavaScript.

Tell me, to be honest, I thought the tests were done in JavaScript.

Что можно...

What can be...

Как называется?

What is it called?

V9 или...

V9 or...

V8.

V8.

Да.

Yes.

V8.

V8.

Вот это вот можно сказать.

This can be said.

V8.

V8.

.RAM.

.RAM.

Whatever.

Неважно.

Не знаю.

I don't know.

V8.exe.

V8.exe.

Slash.

Slash.

Test.

Test.

JS.

JS.

Нет.

No.

То есть такого...

That is to say...

Отдельности этого движок недоступен.

This engine is not available separately.

Еще раз, Дима.

Once again, Dima.

Тут у тебя есть такое общее заблуждение, что frontend JavaScript, он очень сильно связан

Here you have a common misconception that frontend JavaScript is very closely tied.

с DOM-ом.

with DOM.

И если у тебя...

And if you have...

Нету DOM-а, то у тебя ничего...

If there's no DOM, then you have nothing...

То есть Chromium или V8 engine это JavaScript engine.

That is, Chromium or the V8 engine is a JavaScript engine.

Это реализация языка.

This is the implementation of the language.

Но для того, чтобы эмулировать браузер, ему еще нужен DOM.

But in order to emulate a browser, it also needs a DOM.

И PhantomJS объединяет WebKit и V8.

And PhantomJS combines WebKit and V8.

И позволяет как бы это дело запускать.

And it allows you to sort of launch this matter.

Супер.

Super.

А по поводу Continuous Testing все-таки расскажи, пожалуйста.

But can you tell me about Continuous Testing, please?

Да.

Yes.

Continuous Testing для меня это, в принципе, была такая...

Continuous Testing for me has essentially been such a...

Напряжный момент в JavaScript, потому что в .NET я привык к ncrunch в свое время.

A tense moment in JavaScript, because in .NET I was used to nCrunch back in the day.

Мне подход...

I approach...

Это не реклама.

This is not an advertisement.

Да.

Yes.

Мне подход с Continuous Testing очень нравится.

I really like the approach with Continuous Testing.

И таких, скажем так, прямых решений в JavaScript нет.

And there are no, let's say, direct solutions in JavaScript.

Но недавно я для себя открыл...

But recently I discovered for myself...

Я для себя открыл очень интересную штуку под названием Live Reload.

I discovered a very interesting thing called Live Reload for myself.

Live Reload ставится как плагинчик к Chromium или к Safari.

Live Reload is installed as a plugin for Chromium or Safari.

То есть он работает на WebKit.

That is, it works on WebKit.

И, соответственно, еще нужен один плагинчик в IDE, который ты используешь.

And, accordingly, you also need another little plugin in the IDE you are using.

По сути дела Live Reload, он в Chromium или в Safari, где в зависимости от того, где он запущен.

Essentially, Live Reload is in Chromium or Safari, depending on where it is running.

Он ожидает, что будет существовать WebSocket сервер.

He expects that there will be a WebSocket server.

К которому он приконектится.

To which he will connect.

И если происходит какое-то изменение файлов, этот сервер ему об этом сообщает.

And if any changes to the files occur, this server notifies about it.

И он перезагружает страничку.

And he reloads the page.

То есть Continuous Testing в JavaScript представляет собой примерно такую штуку.

That is, Continuous Testing in JavaScript represents something like this.

Вы ставите Live Reload.

You enable Live Reload.

Я использую Sublim как основной редактор JavaScript.

I use Sublime as my main editor for JavaScript.

К нему тоже ставится Live Reload плагинчик.

A Live Reload plugin is also installed for it.

Вы открываете браузер, открываете тестовую страницу, где запускаются Jasmine или Mocha тесты.

You open the browser, open the test page where Jasmine or Mocha tests are run.

Пишете код.

You are writing code.

И когда вы сохраняете...

And when you save...

Вы сохраняете файл.

You are saving the file.

По сути дела внутри Sublim сервер отправляет клиенту информацию о том, что файл изменился.

Essentially, inside Sublim, the server sends information to the client that the file has been changed.

И браузер обновляется.

And the browser is updating.

Ой, слушай, круто.

Oh, listen, that's cool.

А это можно использовать просто для разработки?

Can this be used simply for development?

Например, у тебя два монитора, ты справа открыл страничку, слева педалишь.

For example, you have two monitors, you opened a page on the right, and you’re pedaling on the left.

И именно так я и делаю.

And that's exactly what I'm doing.

То есть в таком стиле я работаю и показываю своим коллегам.

That is to say, I work in this style and show it to my colleagues.

И это мне очень нравится.

And I really like it.

Единственное что.

The only thing.

Что в последней версии Chromium.

What’s new in the latest version of Chromium?

Почему-то Live Reload начал немножко глючить.

For some reason, Live Reload started to glitch a little.

Он работает, работает, работает.

He works, works, works.

А потом Ctrl-S нажимаешь, а почему-то обновление не происходит.

And then you press Ctrl-S, but for some reason the update doesn't happen.

Приходится перезапускать Sublim.

I have to restart Sublim.

Переконнектировать этот WebSocket.

Reconnect this WebSocket.

Сервер поднимать еще раз.

Raise the server one more time.

Такой есть маленький недостаток.

There is a small drawback.

До этого как-то он работал.

Before that, he somehow worked.

Даже не знаю, где произошла проблема.

I don't even know where the problem occurred.

И в принципе этот approach рекомендую всем фронт-энд разработчикам.

And in general, I recommend this approach to all front-end developers.

Потому что по сути дела.

Because basically.

Это и не только для запуска тестов.

This is not only for launching tests.

Если ты работаешь с фронт-эндом.

If you are working with the front-end.

Бывает, что ты модифицируешь маркап.

Sometimes you modify the markup.

Нужно быстро посмотреть.

I need to take a quick look.

И передвижение курсора от редактора к браузеру занимает какое-то время.

And moving the cursor from the editor to the browser takes some time.

Вместо этого нажимаете Ctrl-S.

Instead, press Ctrl-S.

Браузер перезагружается.

The browser is restarting.

И сразу видно результат.

And the result is immediately visible.

Даже если сделать Tab, F5.

Even if you press Tab, F5.

Все равно это долго.

It still takes a long time.

То есть еще раз повторим.

So let's repeat it one more time.

Для этого нужен плагин для Chrome и плагин для Sublime.

For this, you need a plugin for Chrome and a plugin for Sublime.

Да, плагин для Sublime.

Yes, a plugin for Sublime.

Он скорее всего есть для WebStorm и Eclipse.

It is most likely available for WebStorm and Eclipse.

Мой следующий вопрос был.

My next question was.

Какие IDE ты анализировал?

Which IDEs did you analyze?

Каждый индивидуально у вас решал проблему выбора IDE для JavaScript?

Did each of you individually solve the problem of choosing an IDE for JavaScript?

Или это было какое-то коллективное решение?

Or was it a collective decision?

Что мы все...

What are we all...

Пишем IDE в таком-то...

We write IDE in such-and-such...

Пишем JavaScript в таком-то IDE, потому что мы используем такой-то формат проекта и так далее.

We write JavaScript in a certain IDE because we use a certain project format, and so on.

Практически все, когда мы начали плотно программировать на JavaScript, все начали использовать Sublime.

Almost everyone started using Sublime when we began programming intensively in JavaScript.

Sublime, в принципе, как такой де-факто редактор кода для JavaScript и для Node.js.

Sublime, in principle, is such a de facto code editor for JavaScript and Node.js.

И недавно на Hacker News был опрос.

And recently there was a survey on Hacker News.

И Sublime уверенно победил.

And Sublime confidently won.

И комьюнити выбирает его как основное IDE.

And the community chooses it as the main IDE.

Но, опять же, Sublime — это текстовый редактор.

But again, Sublime is a text editor.

Редактор кода, но не IDE.

Code editor, but not an IDE.

Да. Но очень удобный.

Yes. But very convenient.

Когда наш проект начался как бы с фронтенда, и для фронтенда Sublime более чем хватает.

When our project started, it was more about the frontend, and for the frontend, Sublime is more than enough.

И с несколькими плагинчиками он становится, можно сказать, даже очень-очень удобной средой.

And with a few plugins, it becomes, one could say, a very, very convenient environment.

Сейчас мы постепенно переходим...

Now we are gradually transitioning...

Сейчас мы постепенно переходим в AppStorm.

We are currently gradually transitioning to AppStorm.

Из-за того, что Node.js становится все больше и больше.

Due to the fact that Node.js is becoming more and more popular.

А AppStorm — это продукт Agile Brains со всеми вытекающими отсюда последствиями.

AppStorm is a product of Agile Brains with all the ensuing consequences.

Это удобный рефакторинг.

This is a convenient refactoring.

Это классная сама по себе IDE.

It's a great IDE in itself.

Знакомый hotkey.

Familiar hotkey.

Знакомый hotkey, запуск тестов, запуск дебаг как основная причина.

Familiar hotkey, launching tests, launching debug as the main reason.

Поэтому постепенно-постепенно мы приходим к тому,

Therefore, little by little we come to the fact that,

что AppStorm становится у нас основным.

that AppStorm is becoming our main one.

Кстати, насчет hotkey. Такой вопрос.

By the way, regarding the hotkey. I have a question.

Насколько я знаю, в Visual Studio, когда ставишь ReSharper, там можно два вида hotkey выбрать.

As far as I know, in Visual Studio, when you install ReSharper, you can choose two types of hotkeys.

Ну, Visual Studio hotkey и hotkey в стиле как IntelliJ IDEA было.

Well, there was a Visual Studio hotkey and a hotkey style like IntelliJ IDEA.

В IntelliJ IDEA нельзя поставить hotkey Visual Studio, там они только IntelliJ IDEA ставят.

In IntelliJ IDEA, you cannot assign Visual Studio hotkeys; they only set those for IntelliJ IDEA.

Как в AppStorm можно поставить похожий на Visual Studio?

How can I set up something similar to Visual Studio in AppStorm?

Прекрати.

Stop.

Ну, не понятно. Это совсем по-другому все выглядит.

Well, it's not clear. It all looks completely different.

В ReSharper я...

In ReSharper, I...

Уже очень-очень давно использую именно идеевскую раскладку.

I have been using the idea layout for a very, very long time.

Какую идеевскую?

Which ideological one?

Да, тут на меня немножко повлиял мой коллега Сергей Калинец,

Yes, my colleague Sergey Kalinets had a bit of an influence on me here,

с которым проводим тренинги, там довольно плотно общаемся.

with whom we conduct training sessions, we communicate quite closely there.

Он мне один раз показал.

He showed me once.

Я использовал Visual Studio, Visual Studio раскладку, но использовал ее очень мало.

I used Visual Studio, the Visual Studio layout, but I used it very little.

В основном я все равно как-то там запускал через UI ReSharper команды, запускал тесты.

Basically, I still ran the ReSharper commands through the UI there and executed tests.

Потом я пришел к такому выводу, что...

Then I came to the conclusion that...

Это не путь прагматичного разработчика, нужно владеть клавиатурой полностью.

This is not the way of a pragmatic developer; one must master the keyboard completely.

Я отключил у себя в один прекрасный момент мышь, вообще, и решил пользоваться шорткатами.

At one fine moment, I disabled my mouse and decided to use shortcuts instead.

И разговариваю с Серегой, он говорит, нет, нужно Visual Studio раскладка, это не то.

And I'm talking to Seryoga, he says, no, we need the Visual Studio layout, this is not it.

Вот, надо пользоваться идеевской.

Here, we need to make use of Ideevskaya.

Они более оптимальны для управления одной рукой.

They are more optimal for one-handed control.

Это раз, потому что кнопки сосредоточены вот в области левой руки.

This is because the buttons are concentrated in the area of the left hand.

С контролом, шифтом и каким-то шорткатиком.

With control, shift, and some shortcut.

Я установил себе шорткаты на запуск тестов.

I set up shortcuts for running tests.

И все стараюсь вообще программить без курсора, как по максимуму.

And I always try to code without a cursor as much as possible.

И поэтому в WebStorm у меня уже сложностей не возникало.

And therefore, I didn't have any difficulties in WebStorm anymore.

То есть с шорткатами базовыми, как минимум, я уже был знаком.

That is, I was already familiar with the basic shortcuts, at least.

Ну, раз мы перешли и заговорили про...

Well, since we've moved on and started talking about...

Ты говорил, что WebStorm...

You said that WebStorm...

В свете Node.js вас заинтересовал.

In the light of Node.js, you became interested.

Ну, давай немножко поговорим про сервер-сайт, как у вас там все организовано.

Well, let's talk a little about the server-side, how everything is organized on your end.

Насколько я понял, тестирование сервер-сайта у вас не нуждается в PhantomJS.

As far as I understand, server-side testing does not require PhantomJS.

Это первый вопрос.

This is the first question.

Каким образом вы тестируете сервер-сайт и каким образом...

How do you test the server-website and how...

Ну, вообще, что вы там используете.

Well, actually, what are you using there?

Я думаю, нашим слушателям будет интересно слушать.

I think our listeners will be interested in listening.

Можно сказать, что такое Node.js вообще в двух словах.

It can be said that Node.js can be described in two words.

Да. Что такое Node.js.

Yes. What is Node.js?

Что такое Command.js.

What is Command.js?

И Require.

And require.

Как вы используете.

How do you use it?

Пару слов о Node.js.

A few words about Node.js.

Потому что это, несомненно, наиболее громкий проект в open-source.

Because this is undoubtedly the loudest project in open-source.

И наиболее развивающаяся современная комьюнити.

And the most rapidly developing modern community.

Вот.

Here.

То есть два слова из истории.

That is, two words from history.

2008 год.

2008 year.

Товарищ по имени Райан.

Comrade named Ryan.

Веб-программист, который искал и ищет до сих пор.

A web programmer who was searching and is still searching.

Новые пути разработки веб-приложений.

New ways of developing web applications.

Пришел к выводу, что те языки, те фреймворки, которые были на тот момент,

I came to the conclusion that the languages and frameworks that were available at that time,

они ему не подходят.

They don't suit him.

Потому что его тогда уже будоражила мысль веб-сокетов, куш-нотификаций

Because at that time he was already excited by the thought of web sockets and push notifications.

и удобного и быстрого использования это со стороны сервера.

and convenient and quick to use on the server side.

Он начал свой проект, который оригинально, по-моему, даже не имел названия Node.js.

He started his project, which originally, in my opinion, didn't even have the name Node.js.

С какой-то фантастической скоростью.

With some fantastic speed.

Он его запедалил.

He pedaled him.

Потому что это, я даже не боюсь представить, это большие такие трудозатраты.

Because of this, I can't even bear to imagine, it's a huge amount of labor.

Он взял Chromium, существующий engine для запуска JavaScript.

He took Chromium, the existing engine for running JavaScript.

Взял библиотеку под названием LibEV.

I took a library called LibEV.

Это Event Loop модель, которая, в принципе, это краеугольный камень Node.js.

This is the Event Loop model, which is essentially the cornerstone of Node.js.

И самая главная его концепция.

And his main concept.

И создал платформу, на которой можно было писать, в принципе, как бы,

And created a platform where one could write, basically, kind of,

General Purpose приложения, ориентированные больше чуть-чуть на HTTP.

General Purpose applications, more focused a little bit on HTTP.

Потому что его основная задача была это HTTP.

Because its main task was HTTP.

И асинхронный I.O.

And asynchronous I.O.

И в 2009 году на конференции он сделал презентацию.

And in 2009 at the conference, he gave a presentation.

Там есть это видео на YouTube.

There is this video on YouTube.

Я очень рекомендую посмотреть.

I highly recommend watching it.

Он там сильно волновался.

He was very nervous there.

Но, тем не менее, он обратил на себя внимание.

But, nevertheless, he drew attention to himself.

И на его работу обратили внимание большие компании.

And big companies took notice of his work.

В том числе и Google, и Joint.

Including both Google and Joint.

Которые, как бы, спонсировали его в дальнейшей разработке.

Which, sort of, sponsored him in further development.

И на данный момент Node.js это супер-быстро развивающаяся платформа,

And at the moment, Node.js is a super-fast evolving platform,

которой интересуется и Microsoft.

which Microsoft is also interested in.

Мы все знаем, что недавно в Azure появилась официальная поддержка Node.js.

We all know that official support for Node.js recently appeared in Azure.

И с версии ноды 0.6, по-моему, она стала распространяться на винде.

And since node version 0.6, I believe it started to be distributed on Windows.

И Microsoft проявила инициативу.

And Microsoft has taken the initiative.

Они связались.

They got in touch.

И они сказали, что мы дадим в помощь наших кернл-разработчиков,

And they said that we will provide our kernel developers for assistance,

для того, чтобы нода работала на винде.

to make the node work on Windows.

Потому что до этого она работала чисто на Linux.

Because before that she worked solely on Linux.

И на винде ее нельзя было запустить.

And it couldn't be launched on Windows either.

Ну, официальными методами.

Well, by official methods.

Были какие-то неофициальные методы.

There were some unofficial methods.

Можно было ее сбилдить на Seguin, например.

You could have built it on Seguin, for example.

Но я не думаю, что это работало хорошо.

But I don't think it worked well.

Достаточно для продакшен-уровня приложений.

Sufficient for production-level applications.

У нас на продакшене все равно нода работает на Linux, на Ubuntu.

In our production environment, the node still runs on Linux, on Ubuntu.

Но разработчиков нет.

But there are no developers.

Но разработчики сидят на винде, и все работает классно.

But the developers are using Windows, and everything works great.

Даже в это поначалу мне очень сильно не верилось.

At first, I really couldn't believe it.

И каким образом архитектура вашего приложения Node.js выглядит?

And what does the architecture of your Node.js application look like?

В принципе, то, как используем Node.js мы.

Basically, that's how we use Node.js.

На Node.js у нас построен REST API.

We have built a REST API on Node.js.

Или HTTP API.

Or HTTP API.

Потому что REST, это опасно очень говорить, что у нас REST.

Because REST, it's very dangerous to say that we have REST.

Потому что кто-то потом посмотрит документацию нашего API

Because someone will later look at the documentation of our API.

и будет троллить, что у нас совсем не REST.

And it will troll that we don't have REST at all.

Мы используем ноду как HTTP API.

We use the node as an HTTP API.

И мы очень довольны результатом.

And we are very pleased with the result.

Есть отличная, кстати, блокпост.

There is a great checkpoint, by the way.

Называется «Как убедить босса использовать Node.js».

It's called "How to Convince the Boss to Use Node.js."

И чем он замечательный?

And what makes him remarkable?

Там правильные кейсы использования ноды и неправильные.

There are correct use cases for the node and incorrect ones.

И, в частности, один из правильных.

And, in particular, one of the correct ones.

Кейсов использования Node.js.

Use cases of Node.js.

Это как раз построение API.

This is exactly the construction of the API.

Это не сервинг статических страниц.

This is not serving static pages.

Это не построение приложения со статикой.

This is not the construction of an application with static content.

Да, потому что тогда можно использовать Ruby или ASP.NET MVC.

Yes, because then you can use Ruby or ASP.NET MVC.

Простите, господи, PHP?

Excuse me, Lord, PHP?

PHP, абсолютно верно.

PHP, that's absolutely right.

Сила ноды проявляется при конкурентной,

The strength of the node is manifested in competition,

multiple concurrent request HTTP серверу.

multiple concurrent requests to the HTTP server.

Более того, мы перешли с MS SQL на Mongo.

Moreover, we have migrated from MS SQL to Mongo.

Mongo и нода очень дружат друг с другом.

Mongo and Node get along very well with each other.

Для Mongo компания 10gen разрабатывает нативный драйвер.

10gen is developing a native driver for Mongo.

И очень удобно с ним работать.

And it's very convenient to work with him.

Он high-performance.

He is high-performance.

И такая у нас...

And that's how we are...

штука на сервере.

a thing on the server.

А каким образом вообще?

And how is that even possible?

Можешь в двух словах объяснить, как выглядит Node.js JavaScript?

Can you explain in two words what Node.js JavaScript looks like?

Как раз мы упомянули JavaScript, который пишется для ноды.

Just as we mentioned JavaScript, which is written for Node.

Он основан на библиотеке CommonJS.

It is based on the CommonJS library.

И использует RequiredJS для Include.

And it uses RequiredJS for Include.

Да.

Yes.

Пару слов о том, что привносят эти два фреймворка в мир.

A few words about what these two frameworks bring to the world.

Прежде всего, что JavaScript в браузере, что JavaScript на ноде, это тот же самый JavaScript.

First of all, JavaScript in the browser and JavaScript on Node.js is the same JavaScript.

Можно сразу перебью?

Can I interrupt right away?

У вас есть reuse серверного кода с клиентским?

Do you have a reuse of server code with client code?

Нет, это миф.

No, that's a myth.

Самый главный плюс, который должен переубедить босса, оказался самым главным мифом.

The biggest advantage that should have convinced the boss turned out to be the biggest myth.

Да, там валидация сложная.

Yes, the validation there is complicated.

Нет, ребят, в нашем продукте нет ничего, что мы используем на бэкэнде, что могло бы быть переиспользовано на фронтэнде.

No, guys, there is nothing in our product that we use on the backend that could be reused on the frontend.

Даже модели какие-нибудь?

Even some models?

Потому что фронтэнд и бэкэнд решают, в принципе, совершенно разные задачи.

Because the front-end and back-end generally solve completely different tasks.

И по поводу переиспользования кода на фронтэнде и бэкэнде, это возможно.

Regarding code reuse on the frontend and backend, it is possible.

Например, мы используем на фронтэнде underscore.

For example, we use underscore on the frontend.

И на бэкэнде.

And on the backend.

Хотя бы какие-то утилитарные методы написать.

At least write some utilitarian methods.

Да, на уровне утилит и на уровне какого-то такого общего JavaScript функционала, который не завязан, например, если это фронтэнд на DOM,

Yes, at the level of utilities and at the level of some general JavaScript functionality that is not tied, for example, if it's frontend on the DOM,

и если это бэкэнд на нод API, то это вполне может реюзаться.

And if this is a backend on Node API, it can definitely be reused.

Но если, опять же, появляется dependency, то reuse такого кода практически невозможен.

But if, again, a dependency arises, then the reuse of such code becomes practically impossible.

Хотя, опять же, можно использовать фронтэнд код, если даже есть dependency на DOM.

However, again, it is possible to use frontend code, even if there is a dependency on the DOM.

Потому что есть отличный npm пакет под названием JS.

Because there is a great npm package called JS.

На всякий случай, давай объясним слушателям, что такое npm пакет.

Just in case, let's explain to the listeners what an npm package is.

Это дотнетовским языком.

This is in .NET language.

Дотнетовским языком это нюгет в мире ноды.

In the .NET world, this is a NuGet in the world of Node.

И, в принципе, как по мне, это стратегическое решение,

And, basically, in my opinion, this is a strategic decision,

которое, опять же, было принято.

which, again, was adopted.

Разработчиками Node.js в самом начале проекта, когда у них были какие-то стабильные версии,

The developers of Node.js at the very beginning of the project, when they had some stable versions,

они не стали очень сильно заморачиваться какими-то API или что-то еще.

They didn't get very hung up on any APIs or anything like that.

Что они сделали? Они сделали npm.

What did they do? They created npm.

npm это Node Package Manager.

npm is Node Package Manager.

Это репозиторий с реюзабельным кодом и маленькое приложение, оно так и называется npm,

This is a repository with reusable code and a small application, it is called npm.

через которое происходит инсталлирование нод пакетов.

through which the installation of node packages occurs.

И...

And...

На данный момент я боюсь сказать точную цифру, сколько npm пэкэджей сейчас находится в репозитории,

At the moment, I am afraid to say the exact number of npm packages currently in the repository.

но их очень много и очень много полезных вещей там рождается.

But there are very many of them, and a lot of useful things are created there.

А маленькое уточнение, вы педалите на Windows или на всяких там Mac'ах?

And just a small clarification, do you operate on Windows or on those Mac things?

Нет, практически все разработчики у нас сидят на винде.

No, almost all of our developers are using Windows.

И один, по-моему, парень у нас использует Ubuntu.

And I think one guy is using Ubuntu.

А почему?

Why?

Опять же, потому что все датнет-разработчики, в принципе, к винде все относятся с трепетной любовью.

Again, because all .NET developers, in general, have a tender love for Windows.

С уважением.

Sincerely.

С уважением, и процесс перехода на Ubuntu немножечко запугающий.

Respectfully, the process of transitioning to Ubuntu is a bit intimidating.

Ну, для альтернативы, вы хоть Instagram'ы используете.

Well, for alternatives, at least you use Instagram.

Антон спрашивал, почему не на Mac'ах все сидят.

Anton was asking why everyone isn't using Macs.

А, почему не на Mac'ах?

Oh, why not on Macs?

Да.

Yes.

Да, у меня есть идея когда-то перейти на Mac, но пока что она не реализовалась.

Yes, I have an idea to switch to Mac one day, but so far it hasn't happened.

Окей, и затрагивая идею перехода на куда-то еще,

Okay, and touching on the idea of moving somewhere else,

вы рассматривали возможность написания и JavaScript-кода и на клиенте, и на сервере,

Have you considered the possibility of writing JavaScript code on both the client and the server?

используя, скажем так, не...

using, so to speak, not...

не при написании JavaScript напрямую,

not when writing JavaScript directly,

а при написании JavaScript, используя языки CoffeeScript,

and when writing JavaScript using CoffeeScript,

или TypeScript,

or TypeScript,

то есть JavaScript, который бы был изгенерирован...

that is, JavaScript that would be generated...

Ну, то есть, есть такое современное течение,

Well, I mean, there is this modern trend,

то, что JavaScript, по сути, это ассемблер для веб.

The fact that JavaScript is essentially assembly for the web.

И в качестве этой парадигмы выступает...

And as this paradigm serves...

Ну, я знаю минимум, там, с десяток примеров,

Well, I know at least ten examples there.

то в числе языки Dart от Google и так далее.

among them are languages like Dart from Google and so on.

То есть выбор очень многообразный.

That is, the choice is very varied.

И они все каким-то образом предоставляют более удобные способы написания больших приложений,

And they all somehow provide more convenient ways to write large applications,

основываясь для веба, который будет фактически JavaScript,

based on the web, which will actually be JavaScript,

но чисто юридически они могут представляться...

but legally they can represent themselves...

Понятно.

Understood.

Вы рассматривали его? Если нет, то почему?

Have you considered it? If not, then why?

Да, очень хороший вопрос. Мы не рассматривали.

Yes, that's a very good question. We haven't considered it.

Почему?

Why?

Спасибо за ответ.

Thank you for the reply.

Потому что, ну, опять же, как бы тяжело, может быть,

Because, well, again, it might be hard, maybe.

уже так точно проанализировать,

to analyze it so accurately,

но на этапе первоначальной разработки, скажем так,

but at the stage of initial development, let's say,

мы не супер сильно, мне кажется, владели JavaScript,

I don't think we were super proficient in JavaScript.

чтобы еще рассмотреть там какой-то язык, который нужно было изучать.

to also consider some language there that needed to be studied.

Вот.

Here.

А потом на протяжении времени, когда, опять же, экспертиза накапливалась и так далее,

And then over time, when, again, the expertise was accumulating and so on,

быть к JavaScript ближе всего, это как ты правильно сказал,

to be closest to JavaScript, it's like you said correctly,

JavaScript — это ассемблер веб.

JavaScript is the assembler of the web.

Ну, это не я сказал, это...

Well, I didn't say that, it's...

Это сказал Хансельман, наверное, да?

That was said by Hanselman, probably, right?

Нет, это сказал не Хансельман, это сказал, он процитировал...

No, it wasn't Hanselman who said that, it was said by, he quoted...

Еще кого-то.

Someone else.

Создателя языка Reactive Accessions Эрика Майера, по-моему.

The creator of the Reactive Accessions language, Eric Meyer, in my opinion.

Так вот, программист, который, в принципе, там, владеет асмом,

So, the programmer who basically knows ASM,

он очень хорошо понимает, что происходит и что делает его программа.

He understands very well what is happening and what his program is doing.

Вот точно так же, когда ты понимаешь, как работает JavaScript хорошо,

Just like that, when you understand how JavaScript works well,

тебе, в принципе, потом не проблема перейти на CoffeeScript или на TypeScript,

For you, it won't be a problem to switch to CoffeeScript or TypeScript later on.

потому что тот Synthetic Sugar, те фичи, которые ты с ними получаешь,

because that Synthetic Sugar, the features you get with them,

они, в принципе, как бы классные.

They are, in principle, pretty cool.

Я понял.

I understand.

А вот в данный момент, вот скажем так, если бы ты принимал решение сейчас,

Well, at this moment, let's say, if you were making a decision right now,

ты бы рассматривал какие-то языки как альтернативу?

Would you consider any languages as an alternative?

Может быть, может быть TypeScript и...

Maybe, maybe TypeScript and...

Потому что он за счет почему?

Because he is at someone else's expense, why?

Почему бы не рассматривал?

Why not consider it?

TypeScript мне, в принципе, очень понравился.

I really liked TypeScript.

Я там даже написал свой Hello World.

I even wrote my Hello World there.

Было там очень интересно посмотреть.

It was very interesting to see there.

Но внесение статических элементов в динамический язык,

But the introduction of static elements into a dynamic language,

даже как бы с теми благими намерениями, как Microsoft это позиционирует,

even with those good intentions that Microsoft positions it with,

мне кажется, как бы не очень стоит того, чтобы начать его просто использовать.

I don't think it's really worth starting to use it.

Вот, CoffeeScript выглядит тоже очень привлекательно.

Here, CoffeeScript also looks very appealing.

Очень интересные есть конструкции.

There are very interesting constructions.

И, в принципе, я сейчас его рассматриваю как один из языков, с которыми я хочу познакомиться.

And, in principle, I am considering it as one of the languages I want to get to know.

Но, опять же, начать использовать эффективно JavaScript, в принципе, не так сложно.

But again, it's not that difficult to start using JavaScript effectively, in principle.

И искать языки, которые компилируются в него, их потом можно успешно начать использовать.

And to look for languages that compile into it, which can then be successfully started to use.

Но если ты не знаешь JavaScript хорошо и будешь использовать CoffeeScript,

But if you don't know JavaScript well and you are going to use CoffeeScript,

мне кажется, эффективность твоего эффорта будет чуть-чуть ниже, чем могла бы быть.

I think the effectiveness of your effort will be a little lower than it could be.

Ну и более того, как ни крути, все равно в браузере или на Node.js будет работать JavaScript.

Well, moreover, no matter how you look at it, JavaScript will still work in the browser or on Node.js.

И когда дело доходит до отладки, все равно нужно отлаживать JavaScript.

And when it comes to debugging, you still need to debug JavaScript.

JavaScript надо знать в любом случае.

You need to know JavaScript in any case.

Тут как ни крути.

No matter how you look at it.

Кстати, я как раз хотел про это проговорить.

By the way, I just wanted to talk about that.

Потому что многие ребята, которые используют тот же CoffeeScript,

Because many guys who use the same CoffeeScript,

чувствуют себя не сильно уютно в плане дебага.

they don't feel very comfortable in terms of debugging.

Любой браузер умеет дебажить JavaScript-код.

Any browser can debug JavaScript code.

CoffeeScript даже не видит в глаза.

CoffeeScript doesn't even look you in the eye.

И поэтому, когда ты пытаешься дебажить на стороне браузера, я даже не знаю, если...

And that's why, when you're trying to debug on the browser side, I don't even know if...

Нет, нет, нет. Например, Dart может показать...

No, no, no. For example, Dart can show...

Chrome может показать.

Chrome can show.

Chrome может дебаг делать, насколько я понял, CoffeeScript и Dart.

Chrome can debug, as far as I understand, CoffeeScript and Dart.

И, возможно, даже TypeScript.

And maybe even TypeScript.

У меня было два вопроса.

I had two questions.

Первый вопрос такой. Как обстоит сейчас с дебагом?

The first question is this: How is debugging going now?

Когда я смотрел полтора года назад CoffeeScript, было плохо.

When I watched CoffeeScript a year and a half ago, it was bad.

Сейчас, может быть, стало лучше.

Maybe it has gotten better now.

А второй вопрос такой. Как вообще дебаг сервер-сайта происходит?

And the second question is this. How does debugging a server-side website work?

Да.

Yes.

Собственно, вот они.

Actually, here they are.

Понял вопрос. Значит, по первому вопросу.

I understood the question. So, regarding the first question.

Тут есть такие штуки, что...

There are such things here that...

Я не помню, в каком подкасте я слушал,

I don't remember which podcast I listened to,

но я услышал такую мысль, что Mozilla собирается заимплементить

But I heard such an idea that Mozilla is going to implement

нативную поддержку CoffeeScript в своих браузерах.

native support for CoffeeScript in their browsers.

То есть CoffeeScript будет исполняться...

That is, CoffeeScript will be executed...

внутри браузера и, естественно, и таким же образом и отлаживаться.

inside the browser and, of course, debug in the same way.

Я тогда это услышал.

I heard it then.

И для меня это был основным критерием.

And for me, this was the main criterion.

Думаю, если Mozilla это сделает, то, наверное, я начну изучать себе CoffeeScript.

I think if Mozilla does it, then I will probably start learning CoffeeScript.

Это раз.

That's one.

Что изменилось радикально?

What has changed radically?

Они это до сих пор не сделали.

They still haven't done it.

И непонятно, в принципе, сделают ли они это вообще.

And it's unclear, in general, whether they will do it at all.

Потому что сейчас на подходе стандарт ES6.

Because the ES6 standard is on the way now.

И его уже пора имплементить.

And it's time to implement it.

И, наверное, как бы не до CoffeeScript дело.

And probably, it doesn't matter about CoffeeScript.

Что поменялось в этот момент?

What changed at that moment?

В лучшую сторону есть такая интересная штука под названием Source Maps.

For the better, there is an interesting thing called Source Maps.

Source Maps, если просто объяснить, это карта исходников с одного языка на другой.

Source Maps, simply put, are a map of source code from one language to another.

И, по сути дела, с помощью Source Maps мы можем отлаживать CoffeeScript,

And, in fact, with the help of Source Maps we can debug CoffeeScript,

как будто бы это JavaScript код.

as if it were JavaScript code.

То есть правильно я понимаю, что компилятор CoffeeScript должен сгенерировать какой-то еще файл с метаданными,

So, am I correct in understanding that the CoffeeScript compiler should generate some additional file with metadata?

который вапит одно на другое.

which vaporizes one into another.

Типа как PDB.

Like PDB.

Абсолютно верно.

Absolutely right.

И это, да, можно сказать, что это что-то типа PDB в .NET.

And yes, you could say that it's something like PDB in .NET.

И WebKit собирается сделать поддержку Source Maps у себя.

And WebKit is going to implement support for Source Maps.

И как только это будет, это, конечно же, должно сильно облегчить жизни CoffeeScript разработчикам.

And as soon as this happens, it will certainly make life much easier for CoffeeScript developers.

Кстати, да, уже в данный момент TypeScript использует Source Maps.

By the way, yes, TypeScript is already using Source Maps at this moment.

Он генерирует Source Maps для браузеров.

He generates Source Maps for browsers.

Класс.

Class.

Антон, ты закончил?

Anton, are you finished?

А по поводу отладки серверной, сервер-сайта,

As for debugging the server, the site server,

то есть тут как бы нет ничего, скажем так, необычного с тем, что мы бы не делали в .NET,

That is, there is nothing, so to speak, unusual about what we wouldn't do in .NET.

особенно если мы в AppStore.

especially if we are in the AppStore.

То есть вообще какие опции отладки Node.js?

So, what debugging options are there for Node.js?

Это прежде всего как бы нативная, которая есть в самой платформе, с Command Line.

This is primarily something like a native feature that exists in the platform itself, with Command Line.

Вот.

Here.

Ноду можно запустить в режиме дебага.

The node can be started in debug mode.

И ключевым словом дебаггер поставить.

And set the key word debugger.

То есть, если я точку остановлю в JavaScript коде, и когда engine и runtime туда доходят, он останавливается.

That is, if I set a breakpoint in the JavaScript code, and when the engine and runtime reach it, it stops.

И, по сути дела, вы в командной строке можете задавать команды, смотреть стэк, смотреть текущее состояние переменных.

In fact, you can enter commands in the command line, view the stack, and check the current state of the variables.

Но люди...

But people...

Это ужасно, даже командная строка.

This is horrible, even the command line.

Люди, которые не использовали SoftIce, не использовали WinDBG, не писали на C, на Linux, например, для них это очень дико.

People who have not used SoftIce, have not used WinDBG, and have not programmed in C, for example, on Linux, find it very alien.

Я это попробовал чисто из интересов, потому что мне было интересно как бы на наиболее нативном уровне разбираться с нодой.

I tried this purely out of curiosity because I was interested in understanding Node at the most native level.

В принципе, как бы это не очень сложно, но чуть-чуть неприятно.

Basically, it's not very difficult, but it's a little unpleasant.

И есть такой проект интересный под названием Node Inspector.

There is an interesting project called Node Inspector.

По сути дела, это приложение, которое позволяет приконектиться к нему WebKit браузером, Chrome или Safari.

Essentially, this is an application that allows you to connect to it with a WebKit browser, Chrome, or Safari.

И вот, если вы отлаживали фронт-энд JavaScript в браузере, по сути дела, в WebKit вы видите закладочку Sources и JavaScript в нем, ставите точку останова и можете идти.

And so, if you have debugged the JavaScript front-end in the browser, essentially in WebKit you see the Sources tab and JavaScript in it, you set a breakpoint and you can go.

Точно так же вы коннектитесь к инстанцу ноды, вы видите точно такие же вкладочки и отлаживаете JavaScript в нем.

In the same way, you connect to the node instance, you see the same tabs and debug JavaScript in it.

То есть оно даже позволяет мне законнектиться к понятному инстанцу.

That is, it even allows me to connect to an understandable instance.

То есть не само рано это.

That is, it's not early itself.

Что-то похожее на Node.

Something similar to Node.

Именно так.

Exactly that.

Круто.

Cool.

Именно так.

Exactly that.

То есть нода должна быть запущена в дебаг-режиме.

That is, the node must be running in debug mode.

Она, по сути дела, открывает HTTP-соединение на определенном порту.

It essentially opens an HTTP connection on a specific port.

Node Inspector, к нему присоединяешься и можешь делать отладку.

Node Inspector, you connect to it and can perform debugging.

И, наконец, в AppStorm это все интегрировано внутрь IDE.

And finally, in AppStorm, it is all integrated into the IDE.

Experience точно такой же, как с Visual Studio или любой IDE.

The experience is exactly the same as with Visual Studio or any IDE.

Вы ставите точку остановки красненькую, запускаете приложение.

You set a red breakpoint and run the application.

И когда управление доходит до этого места, там происходит остановка.

And when the control reaches this point, there is a stop.

Потому что он на Java же написан?

Because it's written in Java, right?

Да, написан на Java.

Yes, it's written in Java.

Антон?

Anton?

Саша, а у меня такой вопрос, который суммирует весь разговор.

Sasha, I have a question that summarizes the entire conversation.

Если бы тебе пришлось разрабатывать сейчас именно сервер-сайт приложения, у тебя бы не было ограничений на сервер-сайт.

If you had to develop a server-side application right now, you would have no restrictions on the server-side.

Ты бы выбрал Node.js или .NET или что-то еще?

Would you choose Node.js, .NET, or something else?

Это, наверное, зависело бы от того.

It would probably depend on that.

От того, что я бы пытался делать.

From what I would be trying to do.

Если это был бы REST API и WebSockets.

If it were a REST API and WebSockets.

В чем еще мощь Node.js?

What other strengths does Node.js have?

И, опять же, если посадить за Hacker News, за проектами, которые поднимаются в топ,

And again, if you look at Hacker News, at the projects that rise to the top,

как правило, какие-то Node.js приложения, которые очень активно используют WebSockets.

As a rule, some Node.js applications that use WebSockets very actively.

Почему?

Why?

Потому что в Node это довольно легко.

Because in Node it's quite easy.

С помощью Socket Learning.

With the help of Socket Learning.

С помощью Socket UI.

Using Socket UI.

И это довольно эффективно.

And it's quite effective.

В .NET есть Singular.

In .NET, there is Singular.

В восьмом UIS появляется нативная поддержка WebSockets.

In the eighth UIS, native support for WebSockets appears.

Но, тем не менее, .NET здесь отстает.

But, nevertheless, .NET is lagging behind here.

И если я бы делал приложение, которое бы...

And if I were to create an app that would...

Это был бы REST API с большим количеством обращений.

It would be a REST API with a lot of requests.

И с большим количеством обращений к базе данных.

And with a large number of database queries.

И, по сути дела, некий крат над...

And, in fact, some kind of brief over...

Над Mongo это однозначно был бы Node.js.

Over Mongo, it would definitely be Node.js.

Если строится приложение, которому требуется большое количество вычислений,

If an application is being built that requires a large amount of calculations,

если мы делаем какой-то там server-side processing,

if we are doing some kind of server-side processing,

то это, в принципе, та область, в которой JavaScript не суперэффективен.

So this is, in principle, the area where JavaScript is not super efficient.

И Node тут как бы ничем не поможет.

And Node won't help here in any way.

Потому что на JavaScript для computation она использует float числа.

Because in JavaScript it uses float numbers for computation.

Например.

For example.

Поэтому это не может быть супербыстро.

Therefore, it cannot be super fast.

В .NET, конечно же, дело обстоит совсем по-другому.

In .NET, of course, things are quite different.

Если это какой-то processing данных...

If this is some kind of data processing...

Работа с потоками.

Working with streams.

Работа с потоками, работа с вычислениями, то это был бы .NET.

If it were working with streams, working with computations, then it would be .NET.

Только в этом случае или есть еще какой-то кейс, когда бы ты выбрал .NET?

Only in this case, or is there another scenario where you would choose .NET?

Ну, по-моему, это достаточно общий случай.

Well, in my opinion, this is a fairly general case.

Целый комплекс.

A whole complex.

Понятно уже, да, чем можно руководствоваться при выборе того либо другого подхода.

It's already clear what can guide you when choosing one approach or another.

Да.

Yes.

Ну, я просто так прикидываю на пальцах, сколько приложений перечислить,

Well, I'm just roughly calculating on my fingers how many apps to list,

которых нужен какой-то бэкграундовый processing, которым нужно больше одного потока.

which need some background processing that requires more than one thread.

Я понял.

I understand.

Допустим, смотри, Антон, ты решил запедалить что-нибудь там на TDD.

Let's say, look, Anton, you decided to pedal something there on TDD.

И тебе там надо кучу бизнес-логики писать.

And you need to write a lot of business logic there.

И просто тебе удобнее может быть читать это все, писать на C-Sharp,

And it might just be more convenient for you to read all this, to write in C-Sharp,

потому что проект не умеешь организовывать, там, не знаю, каким-то таким образом,

because you don't know how to organize the project, like, I don't know, in some way like that,

если еще какие-то не балованные контексты есть.

if there are any other contexts that are not spoiled.

Мне, например, это будет проще в C-Sharp делать.

For me, it will be easier to do this in C-Sharp.

Там, я знаю, у меня сборки есть.

There, I know I have assemblies.

Я могу там разве...

I can there at least...

Развенчивать области видимости и тому подобное.

Debunking areas of visibility and the like.

Здесь у меня будет...

Here I will have...

Области видимости немного по-другому обстоят.

The areas of visibility are a little different.

И поэтому, может быть, я не захочу использовать в этом случае Node.js.

And that's why, maybe I won't want to use Node.js in this case.

Не, ну, а может и захочешь, потому что язык динамический, более выразительный,

No, well, maybe you will want to, because the language is dynamic, more expressive,

более легкий DSL-like получить для выражения бизнес-логики.

a more lightweight DSL-like approach to expressing business logic.

Это не факт.

That's not a fact.

Да, ну, может быть.

Yes, well, maybe.

Я на всякий случай скажу нашим слушателям,

I will say to our listeners, just in case,

которые за последние две минуты услышали много незнакомых слов.

who heard a lot of unfamiliar words in the last two minutes.

Вы можете послушать подкаст Being the Worst.

You can listen to the podcast Being the Worst.

Зачем?

Why?

С Антоном и с Ринатом Абдулиным.

With Anton and Rinat Abdulin.

Или на английском языке тот же самый подкаст Being the Worst,

Or the same podcast Being the Worst in English,

где вы сможете узнать значение терминов DDD, Bounded Context, DSL

where you can find out the meanings of the terms DDD, Bounded Context, DSL

и, возможно, еще других трехбуквенных ощущений, которые...

and perhaps some other three-letter feelings that...

Ну, а также еще наш прошлый подкаст.

Well, and also our previous podcast.

А также наш прошлый подкаст, который, я надеюсь, вы уже послушали.

Also our previous podcast, which I hope you have already listened to.

И я вынужден сказать, что мы подходим...

And I must say that we are approaching...

Подходит наш выпуск к концу.

Our issue is coming to an end.

Давай спросим у Саши.

Let's ask Sasha.

Есть ли что-то, что он хотел рассказать?

Is there something he wanted to tell?

У меня есть финальный вопрос.

I have a final question.

Ну, давайте вопрос.

Well, let's ask the question.

Вопрос.

Question.

Пожалуйста, ответь на него максимально кратко.

Please respond to it as briefly as possible.

Что...

What...

Как ты думаешь, что должен знать программист,

What do you think a programmer should know?

который называет себя JavaScript-программистом?

who calls himself a JavaScript programmer?

Ух ты.

Wow.

Ну, JavaScript должен знать.

Well, you should know JavaScript.

Если можно, в деталях каких-нибудь там...

If possible, in some details there...

Ну, и достаточно кратенько.

Well, that's quite brief.

Просто, ну, если очень кратко,

Just, well, if very briefly,

если вопрос заключается в том, что должен знать человек,

if the question is about what a person should know,

который хочет выучить JavaScript,

who wants to learn JavaScript,

ознакомьтесь с прототипной...

familiarize yourself with the prototype...

Прототипной...

Prototype...

Моделью?

Model?

Реализацией...

Implementation...

Реализацией в JavaScript.

Implementation in JavaScript.

Это очень сильно отличается от того, к чему мы привыкли в C Sharp, в Java.

This is very different from what we are used to in C Sharp and Java.

Плюс, наверное, Clojure.

Plus, probably Clojure.

Все нюансы.

All the nuances.

Вот, если вы познакомитесь с прототипами,

Here, if you get acquainted with the prototypes,

и, ну, для этого есть там отличная книжка под названием JavaScript Good Parts

And, well, there's a great book for that called JavaScript: The Good Parts.

от Крокворда, Дагласа Крокворда,

from Crocword, Douglas Crocword,

вот, то следующие концепции, они, наверное, будут довольно...

Here are the following concepts, they will probably be quite...

более легко постигаться.

is easier to understand.

Потому что, опять же, когда я разговариваю с ребятами там на всяческих метапах на конференциях,

Because, again, when I talk to the guys there at various meetups at conferences,

ко мне подходят и спрашивают, как наследоваться в JavaScript.

People come up to me and ask how to inherit in JavaScript.

Вот.

Here.

А я говорю, ребята, там не надо наследования вообще.

And I say, guys, there is no need for inheritance at all.

И мне никто не верит.

And no one believes me.

Вот.

Here.

Потому что люди настолько привыкли к классическому OOP,

Because people are so used to classical OOP,

что есть интерфейсы, есть классы, от которых можно наследоваться, есть виртуальные функции.

There are interfaces, there are classes from which one can inherit, and there are virtual functions.

Ничего этого в JavaScript нет.

None of this exists in JavaScript.

И что, как бы, для меня открылось после, там, года, там, с чем-то, программирования на JavaScript,

And what, kind of, opened up for me after, like, a year, or so, of programming in JavaScript,

это, оказывается, и не нужно.

It turns out that it's not needed.

И стереотип этот, вот, чем быстрее он переломается, тем эффективнее вы будете себя чувствовать,

And this stereotype, the faster it breaks, the more effective you will feel.

как JavaScript-разработчик.

as a JavaScript developer.

И по фреймворкам?

And what about frameworks?

Underscore.

Underscore.

Underscore is a must.

Underscore is a must.

И если это front-end, подберите MV-star, звездочка, фреймворк, который вам нравится.

And if it's front-end, choose an MV-star, a star, a framework that you like.

Их сейчас большое количество.

There are a lot of them right now.

И Backbone, и Knockout, и Ember, и Knockback, и чего там только нет.

And Backbone, and Knockout, and Ember, and Knockback, and whatever else there is.

Очень-очень много.

Very, very much.

Подберите то, что вам нравится.

Choose what you like.

Посмотрите на проект от Adidas Money под названием ToDo MVC,

Look at the project from Adidas Money called ToDo MVC.

где маленькое ToDo-приложение заимплеменчено на всех этих фреймворках.

where a small ToDo application is implemented in all these frameworks.

Посмотрите код, который вам нравится.

Look at the code that you like.

Выберите себе эту идею.

Choose this idea for yourself.

И обязательно ознакомьтесь с нодой.

And be sure to familiarize yourself with the node.

Установите ноду на вашу машину.

Install the node on your machine.

С NPM вы получите большое количество тул.

With NPM, you will get a large number of tools.

Тулов очень интересных.

The views are very interesting.

Я использую много чего сейчас из NPM,

I'm using a lot of things from NPM right now.

потому что там, на самом деле, open source, как бы, двигает очень сильно.

Because there, in reality, open source is really driving things forward strongly.

Разработку.

Development.

И тот же TypeScript, если вы захотите попробовать,

And the same TypeScript, if you want to give it a try,

вам все равно нужен Node.js,

you still need Node.js,

потому что TypeScript-компилятор написан на JavaScript,

because the TypeScript compiler is written in JavaScript,

вернее, как они говорят, на TypeScript,

rather, as they say, in TypeScript,

который все-таки выполняется Node.js, в конце концов.

which is ultimately executed by Node.js, after all.

И нода не должна как бы пугать,

And the node shouldn't really be intimidating,

даже если вы там находитесь на винде,

even if you are there on Windows,

и кажется, что это какая-то там Linux,

and it seems like it's some kind of Linux there,

нужен Linux environment,

a Linux environment is needed,

нода практически на 100% классно работает на Windows,

Node works almost 100% great on Windows.

если не использовать каких-то экзотических NPM-пэкэджей,

if you don't use any exotic NPM packages,

которые требуют сборки на Linux.

that require assembly on Linux.

Я все понял.

I understand everything.

Будем закругляться.

Let's wrap it up.

Но для слушателей в нашем юбилейном выпуске есть маленький сюрприз.

But for our listeners in this anniversary episode, there is a little surprise.

Мы начинаем новую рубрику, что ли.

We are starting a new section, I guess.

Мы собираемся каждый выпуск, в конце выпуска,

We gather every episode, at the end of the episode,

говорить про какую-то полезную вещь,

talk about some useful thing,

которая поможет вам в разработке

that will help you in development

или в личной жизни, так сказать.

or in personal life, so to speak.

И, думаю, Толик есть что-нибудь.

And I think Tolik has something.

Начнет, да, начнет такую традицию.

It will start, yes, it will start such a tradition.

В общем, сегодня, я думал,

In general, today, I was thinking,

у меня было два варианта, между чем выбрать рассказать,

I had two options to choose from to tell.

и мы расскажем о таком приложении,

and we will tell you about such an application,

называется, приложение для умеющих телефонов,

it's called an app for smart phones,

его название — Photobimmer.

Its name is Photobimmer.

Photobimmer, BIM — это луч.

Photobimmer, BIM — this is a ray.

Фото, я думаю, все знают, как пишется.

I think everyone knows how to write "photo."

Оно состоит из двух частей.

It consists of two parts.

Есть сайт photobimmer.com и приложение для телефона.

There is a website photobimmer.com and a mobile application.

Выглядит это короче.

It looks shorter.

Для Windows Phone.

For Windows Phone.

Да.

Yes.

Сразу скажу, что это достаточно сильный эксклюзив.

I will say right away that this is a quite strong exclusive.

Он изначально был для iPhone.

It was originally for the iPhone.

Сейчас, вот, исследования показали,

Now, well, research has shown,

реализован только для Windows Phone,

implemented only for Windows Phone,

и более того, только для Windows Phone,

and furthermore, only for Windows Phone,

которые сделаны Nokia.

made by Nokia.

То есть совершенно такая узконаправленная вещь.

That is, it's a completely narrow-focused thing.

Но это вещь с очень крутым вау-эффектом.

But this is something with a very cool wow-effect.

Ну, я думаю, все остальные могут выключать.

Well, I think everyone else can turn off.

Да.

Yes.

Ну, не знаю, ребята, ищут реализацию.

Well, I don't know, guys, they are looking for an implementation.

Я думаю, есть что-то похожее, в любом случае, если поискать.

I think there is something similar; in any case, if you look for it.

Фото Биммер сделан таким образом.

The photo of the Bimmer is taken this way.

Допустим, я пришел в гости к Саше,

Let's say I came to visit Sasha,

и хочу ему показать фотки,

and I want to show him the photos,

которые сделал в последнем своем путешествии.

that I made on my last trip.

Они у меня есть на телефоне.

I have them on my phone.

Обычно я на телефоне показываю,

I usually show on the phone,

мы смотрим на экранчике 2 дюйма

we are looking at a 2-inch screen

с хорошим разрешением,

with good resolution,

но эффект не тот.

But the effect is not the same.

Что делает Фото Биммер?

What does Photo Bimmer do?

Надо, чтобы был, конечно, интернет-коннекшн.

It is necessary to have an internet connection, of course.

Допустим, на ноутбуке заходим на сайт photobimmer.com,

Let's say we go to the website photobimmer.com on the laptop,

там сразу в лоб QR-код.

There's a QR code right in the forehead.

QR-код подношу к телефону,

I bring the QR code closer to the phone,

телефон считывает, и после этого выглядит следующее.

The phone reads, and after that it looks like this.

Я просто на телефоне листаю изображения,

I'm just scrolling through images on my phone,

и они точно так же

and they just the same

в фуллскрине листаются

In fullscreen mode, pages scroll.

на ноуте.

on the laptop.

Саша уже представляет, как это на ноут GS реализовать.

Sasha is already imagining how to implement this on the GS laptop.

Да, на самом деле,

Yes, in fact,

мне Толик успел показать

Tolik managed to show me.

перед записью подкаста это приложение,

before recording the podcast this application,

которое действительно производит вау-эффект.

which really creates a wow effect.

Я подтверждаю.

I confirm.

Так что, если кому-то интересно, попробуйте.

So if anyone is interested, give it a try.

В общем, оно того стоит.

In general, it's worth it.

Всем спасибо, будем прощаться.

Thank you all, we will say goodbye.

С вами был подкаст DotBand, 9 выпуск.

You were listening to the DotBand podcast, episode 9.

С вами были

You were with us.

Дмитрий Басько, Саша Белецкий,

Dmitry Basko, Sasha Beletsky,

Анатолий Колесник

Anatoly Kolesnik

и Антон Винограденко.

and Anton Vinogradenco.

Всем пока!

Goodbye everyone!

Continue listening and achieve fluency faster with podcasts and the latest language learning research.