Allen_Wyma:
With a background about you, can you tell us more about about yourself?
Sergey_Chechaev:
Yeah, my name is G. and for me it's difficult to pronounce my last name. I have been the developer for the past six years, and I'm also founder in it of Pushmi company. So our service and messages through different type of channels, such as a Telegram, and what's also, we provide some tools for building boards inside his messengers, And work with different syremsystems. So we use Lexerprogramic language. It's I think all about me,
Allen_Wyma:
Well, I mean, what got you first interested in in doing Elixer? To begin it? Maybe we can start even before that. What
Sergey_Chechaev:
Uh,
Allen_Wyma:
got you?
Sergey_Chechaev:
huh,
Allen_Wyma:
What was your first programming language?
Sergey_Chechaev:
My first program plane, which was Pchpwas, ten years or fifteen years ago, some like that, and after that I worked about with rubiruganals, and six years ago I worked in some company that create a setial, metfor, and there, which from Rubia to Iexyear, Because we hear I were having performance problem, Our project that I, that we work, they need to serve a large number of customers, and forever our application could only handle a limited number of customers. This is how there would be application ever bork. You need more hardware because of the concurrency and this model in The service, and as a result we started to write the most loaded part fit news it, it was Pines of the pplication to lixyear, so, thereby reducing a number of seres from I think five to to one which saved, saved us a lot of cash. So I realized that we could solve huge problem. In this way, I Has a lot of great tools. for example Geneva, So O t P. it's Great to. I think so it's how I start work with her. Then I start thinking about the partance we have when we work with functional programming. And so as a result I write this article and I also start to think about parents and have some sorts At.
Allen_Wyma:
I'm kind of curious, though, right, I understand why you switched from Ruby to Alexa. But the question is how did Alex even come on to your radar? Was there a colleague that told you about it or did you see something on Twitter Or how did it come up?
Sergey_Chechaev:
Um. So rub programs work. What wish jump like device? And I know that the jump was right on by a salary and I know I know this guy and hear about next year. Heard about that It's connected with. and Uh, I think I start some pet project. Understand that I have right in, and that elixir can serve bunch of customers, a bunch of users, and as a result we just tried, tried it in production and eat, save us a lot of money. I mean, so we can induce count of office That we use in production.
Allen_Wyma:
Okay Now, The thing I always hear is that elixer is like. How do I say this? It's kind of it looks like Ruby, but definitely doesn't act like Ruby. Ruby is very much object oriented. Everything is n't object, including integers and everything else. I mean, how was it to to go from very object oriented language to a functional language?
Sergey_Chechaev:
Yeah, it's old question. they have. Ye meant that they have similar syptics, The peredictis, so different, so will be its language and its functional ground language. Yes, and I think for for people would start working with Something in language, functional rundclanse, more native, Because doesn't have bunch of obstructions like class and inheritance, Somethin that. In and for me it was not so difficult to search to function grand language. I think that I really like love this language, and also very like, but marching care, fan, Um, very helpful stuff.
Allen_Wyma:
Um, But actually often hear about functional languages. Is that there's no real like design patterns? I mean, I hear a lot from people who do object oriented programming, so it's interesting and good to hear that you're You're talking about some design patterns, right, Um,
Sergey_Chechaev:
Yeah,
Allen_Wyma:
and actually, most of the famous books for design patterns. I think you're all object oriented languages right. So what kinds of maybe I can start with this Wah, when you're switched from language that's very object oriented Over to a functional language such as Elixir. I mean, how do you start to structure your code? Where do you get your ideas? For
Sergey_Chechaev:
Hm,
Allen_Wyma:
you know design patterns.
Sergey_Chechaev:
Yeah, I notiz that most of the didicision discussion and the principle are around op to, but it doesn't. It does not matter whether you use program language or functional program, earn, which some principle is still relevant. I think like solid or keys or dry. For example, if we Talk about solid single, the first letter, single responsibility, it become intative for programent, right function with one responsibility, and I compos them together. So this principle is still relevant for functional program language Is Or if we talk about open clothes Principle, we can use pipeline Position. It's also where they want. So If we, if you talk principle, it's still rermantbu. Maybe if we talk about partners. Yes, all these books use for bel languages, but I think we can convert some. some of them to function pregramment work like service objects, Uh, that we often use in rude language. I think we can do the same. I think So In Lex, we also have protecol. That can, I think, was, and list of substitution bein some kind like that. We also have behavior and all these some times connect with word so we can combine that combine. It is a step and use in the functional programme word.
Allen_Wyma:
Now you mentioned solid principles right, Isn't that from
Sergey_Chechaev:
Hm.
Allen_Wyma:
Bob Martin? The idea of solid
Sergey_Chechaev:
I'm not sure who was the first guy talked bout it, but yes, I really love the pence because they have some logic and yes, I think it's still relevant for function program and language. Like, like a Lex.
Allen_Wyma:
Now? Can you actually describe solid because solid as an acronem right?
Sergey_Chechaev:
Yeah, Yeah, so the first letter is single responsibility, So it means that your class or do something that responsible for it. And as I said, because, become intuite for program Grit, function With one responsibility if we connected it with Elixer. So the next letter is all open, close, bicep, Um, So it means that you need, Uh, you can change the program. You need to expand, expand or scale it, because when you change, for example your functional omen, you can break something and break the first rule. Single responsibility. The next letter is out list substitution principle, Um, and again, When people generally think about this principle, the first idea that to their mind is that if the parent class behave in a certain way, the children should behave the same, and so in the exter, we have behavior, and I think we can excite our cart. Work with this principle. A second word is I interpase segregation, so it means keep interface small so that users don't, and depending on is on things they don't need. I think we can use protocol here, and I think it depends ency inversion. It's some kind of structure And section is not under the sun as a function peganwordand, the dependency injertion principle is based on abstraction, function, composition and hiorjecfunction, I think can hang here. Yes, so if we talk about solid, I think it's still relevant.
Allen_Wyma:
Okay, um, now, When you, maybe we can get back to the design pattern parameter right, So we
Sergey_Chechaev:
Hm,
Allen_Wyma:
mostly we picked up this article and I thought it was quite interesting, M. because I don't hear a lot of people talking about design patterns in Elixer. At
Sergey_Chechaev:
Hm,
Allen_Wyma:
least, maybe I'm not reading the red stuff. But Um, you were specifically talking here about. Um, Like when you? if you generate an a P from the P. Gen. Jason Command and some fields you're saying are actually to be calculated, Um, that you can apply this pattern right. So
Sergey_Chechaev:
Hm,
Allen_Wyma:
can you go into more description about what would be the main use of this kind of pattern?
Sergey_Chechaev:
Uh, yeah, of course, so sometimes we need to unify data that we get from external service. For example, we have a partner sermsistum for beauty, Ellen. They have many integration with seris like us, and this ermsystm Use a cool metter. I think how to integrate service for singing as a mass inside Their service. They create equmentation for one for a point that messengers, And so we just need to create the same in point with Sime Request response and Jason structure. After that we supquire our domain. They sit up that to the same as most written in that The citation, So they do request and arching box, So for us it means that we have a different structure of request, but under the hood we use the same model and business project for sendin messages. As a result, we built a different spot inside rope file for this partner with different repress structure by Using this part, the part on Paras, and it helps us use the same model and business logic that that we have. So this is part will help for for us, I think the main idea that you can separate journal and that from your business logic you can use the same I don't know service or model under the hood. But your request you can change it So it helped us. not Boboli plate or cord.
Allen_Wyma:
Yeah, because you you create this. How would you call that? It's like I don't ken what what we call that Where you have this use key word and you pass in a second argument, like for your controller, for your view, et cetera And you have one called Prams and that's one is gonna make the you know to scheme, And it creates this function called Fetch And
Sergey_Chechaev:
Yeah,
Allen_Wyma:
the fetch One. I did not quite understand what the point of that one was. Can
Sergey_Chechaev:
Uh,
Allen_Wyma:
you explain that one?
Sergey_Chechaev:
yeah, this, this function just help her on, And we can add other function to this to the scope. Yes, and use face for. I forgot we use this function for or at some vailure.
Allen_Wyma:
You use
Sergey_Chechaev:
I think
Allen_Wyma:
it for fetching the status from the payment
Sergey_Chechaev:
Yeah,
Allen_Wyma:
payment structr?
Sergey_Chechaev:
yeah, it just help. We can add the other function or don't use it at all.
Allen_Wyma:
Yeah, I'm aware that people are using like their coupling their kind of incoming parameters using an embedded schema to kind of make sure that they fit a pattern or it, some style. and then they translate that one back. It seems like a little bit what you're doing in here now?
Sergey_Chechaev:
Uh, yes, maybe you are right, and it's just the one of the way how we can solve the problem like we We have. And and also this part, I think it's some kind of thought that can bilidate your data before
Allen_Wyma:
Yeah,
Sergey_Chechaev:
put it in your controller or something like that. It's like I don't know. Maybe it's like its smell or pot, something like that, but inside them Well now an extreme workers.
Allen_Wyma:
Yeah, that's there was something interesting that you mentioned about and about the protobufs. right
Sergey_Chechaev:
Hm. It's
Allen_Wyma:
You?
Sergey_Chechaev:
just
Allen_Wyma:
yours?
Sergey_Chechaev:
it's just reference.
Allen_Wyma:
H.
Sergey_Chechaev:
It's not that we need to. We don't need to work with brotabaor. Other stuff, It's just some reference for your mind
Allen_Wyma:
M,
Sergey_Chechaev:
that people
Allen_Wyma:
M.
Sergey_Chechaev:
can understand what we talk about.
Allen_Wyma:
Yeah,
Sergey_Chechaev:
M.
Allen_Wyma:
Yeah, so you have this payment, Mosul.
Sergey_Chechaev:
No,
Allen_Wyma:
That's just an embedded scheme
Sergey_Chechaev:
Yeah,
Allen_Wyma:
And that helps to kind of clean up the data coming in from the outside. That's what I am understanding from here.
Sergey_Chechaev:
M. yeah, and we can compare his forms model with That is him of payment.
Allen_Wyma:
Mhm.
Sergey_Chechaev:
But if we try it, compare with P word. For example, when we work with Rub on Rails, have I don't know some gem Drivalidation? It helps us separate vilidation logic from your model, and in some kinds is part of also help your separate some validation, especially if we talk about nontdatebase validation. And it also can give I, The guy who tried to send external paratus to your service. How, what the type of attributes or how they need to work with validation?
Allen_Wyma:
Yeah, Okay,
Sergey_Chechaev:
Yeah,
Allen_Wyma:
But kind of going back into to M the patterns, right? Um, how do you guys often use patterns and principles inside of your company right now?
Sergey_Chechaev:
Ah, so Firstly, we everythink every time I think about clue structure. I mean clear structure of Phodalcontext, where we saw our class model function, meta Cetera, and behind the structures the need to be a logical chain in order to work With. this is called. and I think it helps new programmes, especially those who are new to understand how the future works when when trying to solve, sure or producing a new feature. Just this logic is principle and parent like Gil, and start, I think so When when we don't use some principle or part, I speak from my experience, it's a nightmare. It looks like. When do you work with some part? that her in the principal part looks like her, en programic, language, or spagaticalld, So we we try. Think Lots about how we are going to organize it. Called on. Oh, and I don't know. Um, communicate with each other, because when we talk to each other, some principle can save time by avoiding the need to invent the well for every new project And they also can. They can also improve quite quality and can save time commucate with each other.
Allen_Wyma:
But when you're bringing on, say new developers to the team or
Sergey_Chechaev:
Uh,
Allen_Wyma:
even to the project, Right,
Sergey_Chechaev:
yeah,
Allen_Wyma:
If you're using a pattern that is quite new to them,
Sergey_Chechaev:
Hm,
Allen_Wyma:
how do you kind of teach them this pattern? Because they're going to be doing a lot of things to try to catch up on the project now. So can
Sergey_Chechaev:
Okay,
Allen_Wyma:
they really handle this pattern?
Sergey_Chechaev:
Um, I think, first of all, we start to reference to some book with some principle, as I said, for example, keys or dry or agni or something, So they gave great about it, and also, when you work With a small team that use the same part from the same principle, it looks like only one programme, write or alas cold. And it also helped Nderstand how you need to to write a new cold. How start writing a new future? And yes, I think I think we also have some Ah, some channel inside our disclosed message where we can communicate with each other. The name of this channel. Helping Hands, and everyone in our team can cate between each other and them. how this feature works or what? what we can use? The What, but we can do there. Or Could you explain how this principle work? So something like like that?
Allen_Wyma:
I see. I mean, I'm just sinking Is like a beginning developer. Sometimes you know, in general I'd like to understand how the system works, but picking up new patterns can be quite quite a handful, right, especially if it's a pattern that you've never heard of have never seen before, Let alone. Elixer. is very much a language that most people just don't know, and also let alone again. Functional programming
Sergey_Chechaev:
Hm,
Allen_Wyma:
is also another concept that most people don't get taught in school.
Sergey_Chechaev:
Yeah, And that's also why I ride this article Because firstly, it was to share my experience with my team colleague and batten scrip. Both that prose now project together and secondary to was apparent that the were not many article about this especially and functional provant work and I really want to share. Eat and get feed back.
Allen_Wyma:
Okay, yeah, I mean for this kind of article, I mean, do you do you actually send this article around in the company, or you know how kind of help them to understand, Or this is just something for everybody to take a look at?
Sergey_Chechaev:
I think both both of them Yes, for for my, for my colleague, and for other people may be some. give me a feed bag and we can use is use this principle more better.
Allen_Wyma:
Okay, So so you actually send this article to people in the company for them to actually read and understand?
Sergey_Chechaev:
Yeah, yeah, and also we use his use a practice, as I said, With one of Syria, have different set of internal data, but we should still want use the same business logic, the same service, and we use this parton for super at internal data into two different school.
Allen_Wyma:
Okay, Yeah, I saw that this is actually a multi part article series. right,
Sergey_Chechaev:
Yeah, yeah, I'm going to write the second third and of Park, and I think two days ago I posted the real way rented programming Parton, and I really love this part of principle because this helps create the structure Of our problem as specification, especially handle, handle eros, solve meted cases and simplify complex logic.
Allen_Wyma:
Yeah, the other design. It's called railway oriented programming. Well, what is that is that that? I think I've seen an article a long time ago talking about railway, and like somebody on the track. Is that related or no?
Sergey_Chechaev:
Yes, yes, yes, of course it's related. I also see time. I also saw on confidence involves this approach, and read some article. I think yes, about four years ago and mark how the this Prince Pol and solve nested cases in work with Ro. So And I think it's connected with. If we compare it with wot, it's connected with seris object. And yeah, because if we work with this ultimate principle we can. we use function call, and inside this functional, this form of to call its entry point, And inside this function we can put the chain of other functions that solve specific starts. for example the lidation dificuelidation, And, and it helps to read function call specification and understand what is going on.
Allen_Wyma:
Yeah, I was just reading about that that that. I think I've definitely seen the pictures before talking about this, the railway.
Sergey_Chechaev:
Hm, M.
Allen_Wyma:
Yeah, I know that like. I'm kind of really like. There's like those two key words that came in a couple versions of Lixburg
Sergey_Chechaev:
Vision,
Allen_Wyma:
ago is like Then and tap.
Sergey_Chechaev:
Hm,
Allen_Wyma:
Have you seen those?
Sergey_Chechaev:
No,
Allen_Wyma:
Okay? So because because sometimes I want to keep piping and then sometimes I have this condition I have to execute in the middle and the end up sometimes using the then. So then we'll allow you to pass an anonymous function
Sergey_Chechaev:
Hm,
Allen_Wyma:
as an argument in a pipe line, And you can do you know stuff in the middle, Because like, if you have like a bunch of calls at the beginning that are piped, then you have to do something with conditional, and a bunch of more pipes, And that part you can use it then, and whatever you
Sergey_Chechaev:
Yeah,
Allen_Wyma:
pass In, and whatever you return, so what you pass in will get. Of course, what you got before and then what you pass out will ll actually send back out normally, but they also have function called tap. Tap will allow you to take. so whatever you pass in is also what you pass out. But then you can do stuff with. It May be some Io and spects, or some kind of side effect with the value, which is kind of cool.
Sergey_Chechaev:
Yeah, yeah, this button also help you. I don't know. Um to do really difficult stuff. I mean, if you need to send, for example, if you need to run some worker ogrindbigram job, send some email or can create something after After you put something in that way this person's really have, because it's voideneted case, And you just go through red or green part And if you get red path, you, if you get green pass, you execute this function and if you get red, pass your call to the next function and so on. So
Allen_Wyma:
M.
Sergey_Chechaev:
yes,
Allen_Wyma:
M.
Sergey_Chechaev:
so it's help White necnetid keys.
Allen_Wyma:
I see what you mean.
Sergey_Chechaev:
Hm,
Allen_Wyma:
Okay, yeah, yeah, this is. this is definitely useful. I remember seeing this a long time ago, but I haven't looked at this for quite some time. you.
Sergey_Chechaev:
Yes
Allen_Wyma:
the Happy
Sergey_Chechaev:
and
Allen_Wyma:
path,
Sergey_Chechaev:
yes, And I mentioned the article, Uh, that I was in it about four years ago. M. Well, when you start write my article, She is reference to other to other articles that have a good picture. How the red and green paffworks. So this stuff help as I think so difficult. difficult issue. And yes,
Allen_Wyma:
Hm,
Sergey_Chechaev:
I want to say that also this person had some reference form object, which I compare functional program language and O p. H. I don't now formal form object We use when we need to work with work with difficult form. I mean we pomp where we need to save Dat a different table and execute some ground drop. So it's some kind of Of a board. I think this approach and some people also think that it's some kind of another, but I think it's more obstructive that the, And we also can use manada inside this this approach because I work with a manada, it topleokorero, and it is also easy to use in railway railway programment approach, because if we get, Oh, we, we use green pop, and if we get old, we can follow the red bark and I don't now send the rod to consult, or send rose to centre, or are there the Pagan system?
Allen_Wyma:
You know the railway. I mean, I've also seen system that's more kind of event based. That can kind of happen like this To know if you
Sergey_Chechaev:
Hm,
Allen_Wyma:
send out a signal than send out an event than people can listen and react to that event right, which could be very similar to this kind of railway style.
Sergey_Chechaev:
Yeah, And I think in Function programme all, we also have some principle like pure Function, And I think it also reference to Single responsibility or keys. Prince. keep, keep it simple. so I think funtional. what we need, more, Uhpartans or principal, and I hope Uh, I inspire people to write the same article or may be. Tell me how we can improve this stuff because it's easier to communicate with other programs than when we have some part. When we name it, we can understand each other more briefly.
Allen_Wyma:
M. Understand,
Sergey_Chechaev:
M.
Allen_Wyma:
Are you planning to add more patterns Because it seems like you kind of stopped your series. Now you only have the two patterns that you wrote about medium,
Sergey_Chechaev:
Yes, I want going right about fat toggle. It's not about. I think it's not about out. It's some kind of price that we can use to For for introducing functionality or for B test test, or for turn off or on some function we can. We can use
Allen_Wyma:
M, h, m,
Sergey_Chechaev:
the model where we can put some business Jack and switch off, or which, On this and this this feature it's good for. as I said, for a feeling, Testing. and if we care that we can broke something on production because we can test it in local host, we can use this feature total, our prince.
Allen_Wyma:
M,
Sergey_Chechaev:
Yes,
Allen_Wyma:
M.
Sergey_Chechaev:
and I think it's really useful stuff.
Allen_Wyma:
You know the feature tales right, That's
Sergey_Chechaev:
Yeah,
Allen_Wyma:
something I've been wanted to take a look at. We had a previous episode where there's a company that was handling feature tales for elixer applications. This is something that does come through my head because sometimes you want to be able to switch on. switch off features and productions are even pending certain white label apes for clients, right, or even different environments With
Sergey_Chechaev:
Hm,
Allen_Wyma:
something that I've been thinking about. How can we do that in nice safes? We, and you also want to be able to have your clients also turn stuff on and off at their own, too.
Sergey_Chechaev:
Yeah, yeah. It's really helpful stuff.
Allen_Wyma:
Yeah,
Sergey_Chechaev:
Especially if we scare that something was broken on production. We can use us.
Allen_Wyma:
Oh yeah, yeah. you mean like like a bat feature that you're releasing your alpha, even just to see how it goes and it goes. It goes very bad and you wan
Sergey_Chechaev:
Um,
Allen_Wyma:
to be able to flip that off right.
Sergey_Chechaev:
yes, yes, especially if we have some problem which we have performance probe, for example, and
Allen_Wyma:
Yeah,
Sergey_Chechaev:
were not sure that I don't know. I can break something. Um, Yes, and also, I want to write about Protical, and how we use that in our placation, I think it's some kind of button factory, but for functional preparing word, It's hard to explain. I think we need more example how we can use protcalfor his way, but over all about how patent factory work. so I think it's it's how we use. Perticlit's. the same if you use Factory when you work with. Provide language like I do not rob Antrala, And after that I want to write Aticalboud Presenter. It's also a parte that we use word. It. Help us prepare some Dat and simplified. For for example, For you, We compare it word, for example in Rubia, and we use presenter. For example, If we want Hid Eve or Key statement, And simplify our cord, and also separate logic, business logic logic about you inside side this pattern and at the end of this block was, I want to write some stuff about Gensarahow, How we use it and what program we solve. Because we can make some mistake. For example, when we work with Jonserer, we can put Some task inside Enid Function, and it's not a good idea. for this, We we use Handle continues, and some people don't don't understand why it's a bad idea And there are also other hidden program When when we use ganser Nd we work out, please, Severe, and I think I can share my experience what mistake we have. we have and I think it helped someone not Get get this mistake.
Allen_Wyma:
Okay, Did you find that quite a few people are using Gen servers in a in a not so efficient way?
Sergey_Chechaev:
Yeah, Yes, of course, of course, because it's for people who work is language. Is this urging? It comes from long word from all work and People Then get actually how it works. That's why they make a mistake. Yeah,
Allen_Wyma:
Understand, Okay, yeah, I mean, thanks for introducing a lot of these patterns I can start to use. I didn't really think too much about about these and I may want to start to even employ them to some of my applications. Is there something else you wanted to say because we were actually approaching the end of our time together?
Sergey_Chechaev:
M. M. no, I think a main idea that we need to To use some principle when we were at work with functional programming To, It's not matter that it's not P. I think it's still relevant where we need to think about. Solid is also still relevant and also some parts. We can solve our business cases by Paras, and I want to share it with people and get feed back and I think we be better as a programmer.
Allen_Wyma:
Okay, Sounds good. If people want to get in touch with you, what's the best way to get in touch with you? Is it through you have a Twitter? or should we follow up on medium, or how can we learn more about what's going on?
Sergey_Chechaev:
I think media and I can send you my Twitter, but I just read so I think not, but it all in Twitter. I also have a face book. Yes,
Allen_Wyma:
Okay, and with that I wanted to go switch over to pick. So for me my pick for for this week is just started to play a game called Allen Wake
Sergey_Chechaev:
Hm,
Allen_Wyma:
in'tknwif. You've ever played that one before, sir, but it's kind of like a intkowifi. Gus. You can kind of call like a r. P. G. It's made by Remedy, who made Max Paying one and a couple
Sergey_Chechaev:
Hm,
Allen_Wyma:
of other games. And uh yeah, it's kind of cool. I like it. It seems like it has a lot of checks Point, so I like that I can play for a short while and then turn it off. No need to worry about getting to the next check point. I just start, T think I played about a half hour or so, but I'm like in the game So far I like this kind of style.
Sergey_Chechaev:
Hm,
Allen_Wyma:
Um, yeah, I urge you play games.
Sergey_Chechaev:
Yes, I play games help children, children, and I play. Yes, the fortnight, for example,
Allen_Wyma:
Oh
Sergey_Chechaev:
and
Allen_Wyma:
yeah.
Sergey_Chechaev:
yes, and also I like running and I think my book is, I wrote the book after this book in Carnes. He's from, I think from California, and I read the that book Runners night And it's a cool and I think it's might be this book around. Snipe.
Allen_Wyma:
Okay, Sounds good. M. yeah. I mean if there's no other kind of last words than it's getting laid over here and it was great to hear more about. Um, you know, design patterns and in the lixer, and kind of what you, you guys are doing, So it's good to hear some some real life feedback and how it's going, so I appreciate
Sergey_Chechaev:
Okay,
Allen_Wyma:
you, make a effort to come on and hopefully have you get in the future.
Sergey_Chechaev:
Yeah, yeah, thank you for inviting me to the podcast.