In the fifth episode, we explore the integration of Clojure into production, its advantages for API development, and the role of community support. Our guest, Jeffy from HolidayPirates, shares insights into transitioning from PHP to Clojure, the importance of code reviews, and how he adopted it as the primary stack for his team during the pandemic.
Whether you're an experienced developer or new to Clojure, this discussion is packed with practical tips and personal experiences demonstrating how embracing change can lead to new opportunities in tech. We talk about the benefits of the Clojure community and practical library choices while addressing challenges like state management and over-engineering. We also highlight strategies for hiring passionate developers in niche technologies.
<div class="heading_h4" style="grid-column: span 2; margin:15px 0">Introduction</div>
Artem Barmin
What advantages were you hoping for when you chose Clojure for building the fresh new product and why?
Jeffy
Capacity to learn new languages is very important. And also as a developer, it also makes me like programming more than before. Clojure would be a better fit for it because of its capabilities to handle data.
Vadym Kostiuk
And how was this process for you in terms of looking for a Clojure engineer?
Jeffy
I see that Clojure is used in Walmart. Without the Clojurian Slack, I might not do it.
Artem Barmin
I've seen huge over-engineering in Clojure projects. I've seen a project where there was a domain specific language built purely in macroses. And then, in this language, was written a file with 3000 lines.
Vadym Kostiuk
What do you think are key business or maybe technical reasons that could drive the company to make a decision to move away from Clojure?
<div class="heading_h4" style="grid-column: span 2; margin:15px 0">Full version</div>
Artem Barmin
Hey everyone, welcome to the fifth episode of our podcast, “Clojure in Product: Would You Do It Again?” And today we are meeting with the lead backend developer at HolidayPirates, a travel deals platform based in Berlin, Germany.
Vadym Kostiuk
HolidayPirates is dedicated to making travel affordable and accessible for everyone by curating the best value-for-money deals, ranging from flights and hotels to car hire, luxury stays, and even weekend getaways.
Artem Barmin
And as a lead backend developer, oversees the team that managing APIs that power all web and mobile applications on this platform.
Vadym Kostiuk
And also today we'll respond to the question left from our previous guest, James Trunk, who is the vice president of engineering at Griffin. James asked, “How do you approach enforcing the shape of the data in your system? How deep do you go into the system with these specifications or you only apply them as boundaries?”
Artem Barmin
Interesting. And let's begin, map our questions and macro-expand them into real-life Clojure experience.
Vadym Kostiuk
Thanks for joining us at our fifth episode of “Clojure in Product: Would You Do It Again?” We're really glad to have you with us. And to kick off our conversation, I would like to ask you to share a bit about your background and about the HolidayPirates team.
Jeffy
Hello, Vadym. Hello, Artem. Thanks for inviting for this. I work as a back end tech lead, lead developer at HolidayPirates. And I've been doing web development for like 18 years. And most of the time I was using different languages like PHP, JavaScript, Python. And I think around 2020-21, I got into Clojure in 2020 and then started using it at work in ‘21. So I have been using it as the primary language for almost three years now. And at HolidayPirates, like we have a small backend team and we have three developers, including me. And we support our website and mobile apps with the APIs they need.<br/><br/>And HolidayPirates as a company, it's a travel inspiration company. So we are like, many people, many departments, and we try to find deals which are suitable for a lot of people and to inspire people to travel. So that's like one of the things motivates us to go. And we are based in Berlin. We have our biggest market in Germany. And we also altogether have like 10 different markets, 10 countries altogether.
Vadym Kostiuk
Yeah, that's interesting. One of my favorite questions is, can you share your story of how actually the Clojure first time did come into the picture for you and for the HolidayPirates team?
Jeffy
Yeah. For me personally, in 2020 there was Corona as we know, and there was also quite some free time from my side. And I stumbled upon a talk on YouTube from Russ Olson. He's one of the persons who worked at Cognitech and he also wrote this book, “Getting Clojure”. And in this talk he was telling about the different programming languages he worked on. So I think he started working from the seventies and he was also a Ruby developer and he's also doing Clojure. He did many languages before. And he was telling like the language, you know, if you work long enough in the industry, that language will go away. And so the capacity to learn new languages is very important. And if you choose a new language, choose something which is very different from what you're already using. So if you use, I don't know, Python or PHP, then maybe not Ruby or Java or JavaScript, something different and like Clojure fit into that because it's different. It's a Lisp. And that is when I thought of trying it out. <br/><br/>So I checked it out a little bit and I also bought this book, “Getting Clojure”. And this book I found really easy to get into, it was easy to understand and it helped me to understand the language, at least the core functions. And I was never thinking that I will use it anywhere for like work or anything. For me, was just to learn something different. And that was completely my goal. I had no like pressure or anything. I was just learning it in my own pace.<br/><br/>And at some point, we had a need to make a new API. And I was also in Clojurian Slack, and I see how people use it. And I was convinced that if you want to have a back-end API, which is mostly a data processing thing, Clojure would be a better fit for it because of its capabilities to handle data, like the different functions, the core functions, which it has. So I thought I would give it a try. And then the problem was I did not know how to make an app with Clojure. I just knew how to write some functions and things like that. <br/><br/>There I did not also want to make some mistakes because I also don't have someone to guide me to do it. So I thought, there was a course from Jacek Schae about creating an API with Reitit. So I used that course and developed the first API starting with that. Yeah, and from there, it's about the different libraries. And then now we have like two backend API applications with Clojure.
Vadym Kostiuk
That's interesting. I mean, that's quite a story. Without prior experience in Clojure, you've tried it yourself, then adopted it to the project. And that's an interesting story because it would be insightful to hear from you if you had any maybe concerns or maybe you were worrying about some potential challenges that will come with this decision.
Jeffy
Yeah. So like by looking at the community and I see that Clojure is used in Walmart. I read a lot about it. People's experience. It was used in Netflix. I see also like Cognitech was there and also this Nubank. So I see that people are using it. So only thing which limits me will be my knowledge on the language. And in this part, I was also relying heavily on the Clojure community. So, this Clojure, without the Clojurian Slack, I might not do it because I was sure that I could ask there a question and most probably somebody would answer and maybe I get a direction if I'm really stuck on something. <br/><br/>Without that, I would be, might not try it. So for me, was like, I don't have someone with Clojure experience with me working next to me, but there are many developers who have this experience and I could ask there. So this was something giving me the confidence and my employers and my team, they also showed the trust in it. So that's how I tried it. And there were some roadblocks here and there, but yeah, managed to overcome it.
Artem Barmin
So you are active participator of Clajurian Slack.
Jeffy
When I had some questions, I was asking there in the past and I'm mostly reading there. I read what people, questions people ask. I read the answers, you know, I might like them and I try them out. I try the questions out and the answers out. So it just makes me learn more.
Artem Barmin
So you were the first person that bring Clojure into HolidayPirates. Am I correct?
Jeffy
That's correct, in the backend team.
Artem Barmin
In the backend team. And can you tell a bit more what was before the Clojure or the project started from scratch? So have you made a decision from the previous backend implementation?
Jeffy
So before Corona, we had quite a lot of back-end applications and after Corona, we made some changes. And we had one back-end application, which was in PHP. And then there was this need to create another back-end application for a different domain. And that's where I used Clojure. And the one in PHP still stayed and still stays.<br/><br/>We moved some of those features from that to the Clojure one, but it was mostly for everything new. So we still maintain the PHP one. There are not so much developments on it, but the active development, would say 95% is on the Clojure side.
Artem Barmin
That's a huge hop from PHP to Clojure and nothing in between. No Node.js, no Java.
Jeffy
No, I mean, we have a separate frontend team and they are using React and Node.js. Yeah, and we have a native Android and iOS team. So they use Kotlin and Swift, if I'm right. Yeah. And I don't have Java experience. So that was also a problem in the beginning. But there actually Clojurian Slack helped me quite a lot. Yeah.
Artem Barmin
And you know, that's a pretty risky decision. What advantages you were hoping for when you chose Clojure for building the fresh new product and why?
Jeffy
The conciseness’s part of it because it's also functional programming and there's less boilerplate. And I find that there is a much higher speed when developing with Clojure. And then the REPL, this changes things a lot. <br/><br/>There is like, for me personally, there's like a jump in the confidence that I can tackle the problems. As long as they are like mostly data processing back and related things can handle it. Yeah, so I did not find it like that risky. I would have found it more risky to make more complex things without that because this gives you some strengths like the REPL and immutability and functional. I think that is actually a good way to go. At least in my experience, it's like that. And also as a developer, also makes me like programming more than before.
Artem Barmin
And we have conversations with the already existing team. So you was the new guy in the team, yeah? Or did you have prior experience in the company?
Jeffy
No, I'm here for more than nine years. I was already in the team and I was a lead. So as a lead, I chose that decision to use Clojure. And we had another developer. He learned it and we hired later a developer who knows Clojure for some time. Yeah, at that time I was also in contact with Radium about finding some developers.
Artem Barmin
And how did team react to this new language, new direction? Because switching from conventional technologies to Clojure sometimes are pretty hard.
Jeffy
Yeah, I think with some guidance it can work out. So my teammate at that time is also with some guidance it worked out well. So you do pair programming. So in the beginning you work together on things and after doing it like that for some time, then you get a hang of it and then you can do it by yourself. And we do code reviews also quite in detail. So we have a call during code review and talk about things and improvements. So like that, gradually it got in and we also provide books or like learning video tutorials, things like that.
Artem Barmin
You already named several benefits like REPL and data, data-oriented programming. Can you name some unexpected benefits that arrived but you haven't expected them? Maybe changes in culture, changes in thinking of tackling the problems, anything that comes in your mind.
Jeffy
I find this structural editing of Clojure code itself. I find that after looking at Clojure code for three years, I noticed this some months ago, that I can look at a namespace and can see the structure of the code. And sometimes when it is different, get the feeling that maybe I should look at that a little bit more, maybe that could be written differently. Maybe you could use a threading macro there instead of some nested function, something like that. Yeah, so that is something which I was not thinking of, but which I recognize now.<br/><br/>Yeah, other than that, it's also nice that Clojure is also used in different fields. Quite often, where people use Python, I see talks that there are lot of data teams also experimenting with Clojure. And also in the LLM field, Clojure is also used. So that makes me think, yeah, it's like there's development going on.
Artem Barmin
I see. Thank you. And can you also name another side of the Clojure experience? Maybe some drawbacks, some unexpected problems that arrived maybe when you're incorporating Clojure into the team or from your own experience of development.
Jeffy
Yeah, I mean, in the beginning, it was difficult for starting with the editor, like which editor do you use? So I tried all of them. I also tried learning Emacs. I dropped it. Then, and then they sticked with IDEa and Cursor. So finding that, trying different things out. And then that was one thing, a challenge. <br/><br/>And then the other thing is the library. So since mostly people don't use framework, you set up your app with different libraries. And then there is different libraries for the thing you want to do. you can use different servers, for example. For HTTP client, you have different ones. For managing environment variables, yeah, if you want to connect to Redis, do you want to use the Java libraries or do you want to use the Carmen library?<br/><br/>These kind of things. So you have to experiment a little bit with different options and kind of make a guess out of one and then you stick with it and go forward. And I did not come into any problems with any of these libraries I chose. And also because I think having this course I mentioned earlier from Jacek Schae, he also already picked some standard more used library. I also had like a base which was also more used. Some problems I faced in the early time was like the finding the right IDE and how to connect the REPL to it and also choosing the libraries. Yeah.
Artem Barmin
And do you have some recommendations inside the team what IDE should be used for newcomers?
Jeffy
We are all using the same one. We are all using IntelliJ IDEA with Cursive. But I think for newcomers, if you don't mind, I would go for VS Code with Calva because I find the Calva's getting started thing from Peter Stromberg like really amazing. But we just stick to it because we were already using JetBrains products before, so we stick to that. And Calva is also free, so I would recommend that actually.
Artem Barmin
I also was thinking about these problems with libraries because sometimes it's quite hard to navigate the ecosystem. Some tutorials looks like outdated. They still using Leiningen and some other stuff. And it's hard to understand what really should be used right now. What is current trend.
Jeffy
Yeah. Yeah. I think it also does not that much matter. We are using Leiningen. And if you look at the Clojure survey, there is still a lot of people using Leiningen. And I was thinking about this and I was reading somewhere in the Clojurian Slack about this. I think it was someone mentioned that like, if you use Leiningen and if it works for you, then it's fine. You know, it's only if you reach a stage where that tool becomes a problem, then you need to maybe think of changing it. For our use case, it works.
Vadym Kostiuk
Can you please tell us a bit more about your role as a Lead Backend Engineer at HolidayPirates? What are your responsibilities? What do you actually do within the team? It would be nice to hear it from you.
Jeffy
Yeah, so I'm responsible for the work we do in the backend team. And also I'm responsible for the growth of the people I'm leading. I try to focus on that. We have one-to-ones and feedback and development talks where we discuss and make some development goals for the developers. And we touch on that in our one-to-ones.<br/><br/>And that's like one of my, like as a lead, that's that. And the other part is like when we want to do something as a feature or change of change requests, we groom them together and we think of technical solutions and yeah, we together try to come up with solutions. And there I play a role in also helping out if there is something if they don't know. And if I don't know, I need to find out as well. <br/><br/>Yeah, so these are like the main two parts, like the development of the team members and the responsibility of the code base and the application which we are developing. So I also take care a lot with the merge requests. So we take time to review the code and if there are changes, we make those changes, we talk about it. So try to keep the code in the best quality as possible. Yeah, but there are so many things I have in mind to improve. Many of them I don't know how, and there are things like that.
Artem Barmin
And speaking about quality of the code, can you tell a bit more about recruiting to the team? Because Clojure is a very niche language and sometimes it's hard to find talent in the team. And personally, I make maybe 200 interviews for Clojure developers and sometimes it was really hard to find the right person. Can you share your experience? How do you find people?
Jeffy
I only recruited one developer. So the other developer, we were already here, and he switched to Clojure, like I did. So I basically posted in the Brave Clojure job board there. I posted in Clojurian Slack. I also somehow got in touch with FreshCode.<br/><br/But we were looking for hiring someone who is here and we got some applications, like there were like different types of applications and there were many good candidates and we fixed on one person who was also based on the location. Person is already in Germany and everything fits to our expectations. I think it took time, maybe a couple of months, but quite often with developers it's like that. It takes some time depending on the language, of course. <br/><br/>Yeah, and I think if you are a company who wants to have Clojure developers, it would really be helpful if you're open for remote even like, you know, a couple of time zones away, then you have a lot of options, I think. It gets harder if you want to other people in the country you're working on.
Vadym Kostiuk
And you said that you've been searching for engineers for roughly two months. Can you please dive a bit into the process how was it? I mean, for instance, I know when you post a JS JavaScript job or Java job, you can get about 200 applicants for a week. And how was this process for you in terms of looking for a Clojure engineer?
Jeffy
Yeah. So it was like more than like two months. I think it was maybe four months or something altogether, four or five months. What I understood is that you have to basically post the ads where Clojure developers are. So if you put it in LinkedIn, maybe you might not get that much. But if you put it, for example, in Clojurian Slack or in Brave Clojure jobs or go to a conference and show your presence there, I think these things would bring you more developers. And when I look at the Clojurian Slack, I see that there is quite a lot of people who would like to work as Clojure developers. So there's quite a lot. If I need to hire, I don't think finding a Clojure developer won't be that much a problem right now for me.<br/><br/>I also have last option as you guys.
Vadym Kostiuk
So from your words, it doesn't seem like the prior Clojure experience is really the must-have for all the candidates. It seems like the willingness to work with Clojure is also one of the key factors. Is that correct?
Jeffy
Yeah, it depends. It depends if you want to have like, if you're looking for someone who's more senior, who has done, who has experience in Clojure, then you really need to find someone who has some experience in Clojure and ideally a little bit longer experience in some other languages. But if you also want to hire someone who is a mid-level developer, maybe you can find someone who is just learning Clojure. And I think like someone who tried Clojure and really liked it and do it on their free time because they really like the language, but don't work, don't do their like the paid work on it. I think this person would be completely fine because the person really likes it. And I think that is very important.
Artem Barmin
Yeah, agree. Actually, I noticed that internal recruiting of a Clojure developers is a very common thing. And we even sometimes run internal courses in the company for guys who want to switch from JavaScript to Clojure. And it works pretty well.
Jeffy
Yeah. Yeah. And it makes a difference when people choose it because they choose it, and not that somebody asked them to. And that can make a big difference when you go there, go to Clojure by yourself. That's because you like it and that is always a good sign, I think.
Artem Barmin
I want to talk a bit more about technical things inside the Clojure projects. And I'm curious about how do you approach technical decision-making into your product? So what libraries are you using? And what libraries are you going to use? And how do you discuss the different approaches? <br/><br/>Because Clojure gives a lot of freedom and a lot of different ways of doing the same thing. And sometimes it's really hard for newcomers especially to find one way of doing things. So, for example, you can take framework, you can use dependency injection if you have Java experience, or you can go purely with libraries and build your own framework. You can use macros, you can build DSLs, and you can do anything basically.
Jeffy
So we are using only libraries, so no frameworks. And there are some core libraries which you start using. So for example, connecting to the database, so we use Postgres as database, so connecting to that. And then Redis we use for caching. There is some AWS libraries which we are using to connect to AWS. <br/><br/>And there are some like basic things which you, and most of your needs are covered with that. When there is some special case coming up, you can either write it by yourself. Maybe it's just a function you can write, which is like 10 lines. If you can do that, we try to do that instead of pulling a library for it.<br/><br/>But if the library has more benefits, then you can also think of using the library. So these are things I keep in mind. And regarding macros, I don't know much about macros. I haven't been to that part. I recently bought a book about Clojure macros, which I would like to read somewhen. I heard about the rule of macro, like try not to use it. So I just try not to use it unless I really have to.<br/><br/>Yeah, there was some one situation where I also asked this question in Clojurian Slack and someone told me about using macro for it. But in the end, I find a way without macro and I stick to that way.<br/><br/>Yeah, libraries, I don't know if there's any new libraries which I want to use, which I wouldn't mind. I mean, there are some, like there is this Clojure D-Rf which comes every week and there are libraries, so I quite often check their libraries and I just look at it and just sometimes try it out in the REPL, but that's it. And then I also know that, okay, there is this thing available. If that use case ever comes, I could use it.<br/><br/>And there are something like this, we call Spectre. It has a of, it's like some functions which are like an extension on Clojure things. I don't use it, but I tried out that quite a lot. And there was Portal recently coming out, it's also a use in development. Today I just upgraded it to like Clojure 1.12. So we're using 1.11.3, I guess. So the stable version came out some weeks ago, and today we updated it. And I also keep the project .clj up to date. I run this line ancient command, this is what I have configured local and keep the libraries up to date.
Artem Barmin
So you as a newcomer to Clojure or from your team, have you sometimes faced with cases of overengineering? You already mentioned macroses, so you don't use it, but maybe some other parts of a system that need to be refactored afterwards.
Jeffy
I mean, that's like difficult to say when it is. And it also comes with experience. I think it does not really matter on what language. So I feel like you have a problem and you're trying to find a solution for the problem and try to make the solution as simple as possible, which is very difficult. You have to remove every unnecessary thing and then you have like a simple solution.<br/><br/>And quite often that is also the one which lasts long in the sense that it's maintainable. Because requirements keep changing. You can have a requirement right now and six months or one year later, the requirement can turn 180 degree to the other direction. So you should be anticipating change as much as possible. So these things, I think something you also learn when you work many years in software development. I also have this readme where we have the coding guidelines. So one of the things we try to do is this YAGNI that you ain't going to need it. So if you see this problem might come in the future, not almost all the time, we try to solve it now. Maybe we leave it open to solve it later.<br/><br/>It's a hard thing to bring into reality that is to avoid over-engineering. I think also discussing together, so not working in isolation. So when there is problems, you discuss together multiple people and having code reviews, these things can help you in maybe focusing on the problem you're trying to solve.
Artem Barmin
I see. I'm asking because I've seen huge over engineering in Clojure projects. I've seen a project where it was a domain specific language built purely in macroses. And then in this language was written in a file with 3000 lines. So basically it was a huge macros with a lot of logic inside it. And to debug something you need just to, you know, macro expand, go inside, understand and we spent several years trying to get rid of this and move it to purely data-treating approach. So, sometimes I've seen it.
Jeffy
Quite often maybe someone working in isolation can also lead to this kind of things. So working together, taking turns in the features, like pair programming, these things might help.
Vadym Kostiuk
We've been talking a lot about different use cases for Clojure and some obvious and unexpected benefits as well as about the possible drawbacks. And I'd like to ask you a question. It's rather a question to get your opinion on the matter.<br/><br/>Because lately, for the past few years, I've seen that some products that historically, they were like Clojure-based products, they moved from Clojure. And for some cases, we were able to get some details why it happened. For some cases, it's just really hidden and there is no way to explore the decision that led to this.<br/><br/>So I wanted to ask in your opinion, what do you think are key business or maybe technical reasons that could drive the company to make a decision to move away from Clojure?
Jeffy
I can imagine like the, not really the availability of developers, but like the cost of the developers. So because quite often Clojure developers are already having experience in some other languages. There are quite a lot of people who are like ten-fifteen years experience in something else and then moving to Clojure. And they really like it. They start liking programming again and this kind of things. And they might ask a higher salary. And I think this can be a reason for, like from a financial sheet point of view to hire developers which are available for lesser salary. Maybe that's one reason. <br/><br/>But I think the quality of work can also be different. So maybe it's also worth it to go that way. And you can see that from the people who apply for it. For example, Nubank is using Clojure and it's the largest online bank in South America.
Vadym Kostiuk
Yeah, definitely. You know, for these cases that I mentioned, sometimes it was, like you mentioned, not really a decision, not really a technical choice. It was like rather a political choice because of the change in the management, in the technical leadership.
Jeffy
Yeah, yeah, that can be. Yeah, it could also be that there's a change in the technical leadership who does not know Lisp, but that happens all the time. There can be a change in the higher level, in the technical higher level, and they might choose something which they are familiar with. This can happen.
Vadym Kostiuk
And past this like three years of Clojure in HolidayPirates teams, have you ever faced maybe any pressure, external or internal, to migrate from Clojure?
Jeffy
Not at all. We are pretty happy with how it's going. We also see that it is a little bit faster. And like I said, concise, so I think there's a little bit lesser code written. And there is this REPL, which is really helping in finding things out early. So you can try things out early and then start really implementing the thing.<br/><br/>It's like you are losing an arm if you go back in that way. Yeah, we find it as a good thing. But also it's still one tool and you can also, like you earlier mentioned, very complex code using Clojure. So you can also do that. So it also depends on how you evaluate each other's code and how you read about other people's experience and how you keep your knowledge up to date to have a good code base. So having Clojure alone won't solve it, I think.
Vadym Kostiuk
It's interesting you said that. We had our previous guest, James Trunk from Griffin. He said the same thing. He said that having Clojure, it doesn't mean that you'll have a clean code and Clojure itself doesn't solve all the problems you might face. So it's interesting you said that.
Jeffy
Yeah, and what I like about the community is that most of the developers are also having a lot of experience. So tapping into that also helps me out. So in that way, I think the Clojure community is really good. And if you tap into it, you can also get some of those benefits in your work as well.
Artem Barmin
I sometimes hear the phrase that Clojure works as a filter for people that really use Clojure. They usually filter it through the all obstacles, through the syntax and everything else. And in the end, we get very experienced and motivated developers that really like development. By the way, are you still doing development fully?
Jeffy
Yeah, I'm actively doing programming. Yeah. Yeah. So I'm also working on features. So we are like three developers. Yeah. And I really like it as well.
Artem Barmin
That's the common thing that we hear from our podcast. Everybody says that it's really fun to write in Clojure.
Jeffy
Yeah, it is. It is. Yeah, it is.
Artem Barmin
If you would start a new project for the front -end development, would you choose a Clojure script today?
Jeffy
I am not that much experienced in the frontend development in the last like 10 years. Before that, like during the jQuery days, was doing some frontend, HTML, CSS and stuff. With that experience right now, I would not do it by myself, but like if I have another developer who has experience in ClojureScript and who also has experience in React, then with that developer, I would think of doing that.
Artem Barmin
Sometimes I see this mix of backend in Clojure and frontend in TypeScript or JavaScript because sometimes it's hard to find this intersection of experience with frontend, React, HTML, CSS and Clojure. Yeah, yeah, yeah. And...
Jeffy
Yeah, yeah, and databases and et cetera.
Artem Barmin
How do you actually assess the state of a Clojure ecosystem right now? So do you like the trends where Clojure is moving the tooling support everything else?
Jeffy
Yeah, I don't find like that it is in any way bad or something. I see that as like, for example, the LLM things, there is a lot of talk on that on the Clojure side and also with the data things. And when I listen to talks from conferences, so it is doing well, I think. The direction is going. And the reason is 1.12 release. And if I need some libraries, I'm always finding it. So, yeah, I'm very happy about how the ecosystem is.
Artem Barmin
Do you do some open source work?
Jeffy
No, I don't.
Artem Barmin
Maybe you're thinking about releasing some of internal libraries as an open source?
Jeffy
Yeah, so far we did not have anything like that to release. So we have our applications and they are mostly the code needed for them, and I also don’t have that much time.
Artem Barmin
And the resume of what we discussed, would you choose Clojure as a main technical stack right now, if you would start a new project?
Jeffy
If I have to start a back end project, 100% yes. Yeah.
Vadym Kostiuk
Can you please maybe think of advice that you can give as a lead engineer, the one who successfully integrated Clojure into your engineering processes, into your backend team, to other tech leaders who are about to choose maybe the path for the programming or maybe who are choosing what to use in their projects. What would be your advice for those tech leaders? Why do you think they should look for Clojure or maybe with what parts of Clojure they should be careful?
Jeffy
It depends. Like if you are already having some Clojure developers, then it makes sense to have your application in Clojure. But if you have a team with developers with not Clojure but other languages, then maybe it's also better to stick to those languages. <br/><br/>So you should have a reason to switch. And one of them is that you have those developers. And if you have Clojure developers and if you are yeah, going to start a Clojure project. Or if you are the one Clojure developer and you want to start it.<br/><br/>Yeah, the advice is like rely on the community. You can get help from there and don't spend too much time accessing all the libraries. You can take something which is good and go forward. You can always switch it back if you want to change them.<br/><br/>And also don't fuss too much about the editor. Take something which works for you first. These are the advices I can say to someone who wants to try out Clojure in a project. I don't know what other advices I should give.
Vadym Kostiuk
No, that's good. That's a good advice.
Jeffy
Yeah. And again, like, there are still like the problems which you have everywhere else. And, you know, it's also not like there's this thing like language elitism. So, you have this, I have the same problems I had before, like, the managing state, you know, so, I still write code where status is bred, quite a lot. so I am, this is still, I'm trying to tackle, find out how to do that. So there is also a lot of things to learn. Yeah. <br/><br/>And it gives a confidence. This is something which I like for using Clojure, that you can tackle most problems. This kind of confidence I get with that.
Artem Barmin
Speaking about, you know, libraries and ecosystem, Clojure has widespread of different libraries that sometimes solve the common task. For example, for spec, for schema validation, we have three libraries, pretty widely used. Do you think this is a benefit of Clojure ecosystem? It's kind of drawback.
Jeffy
Yeah, I think it can be like both. Yeah, I had the same problem, like Malli and Schema. So we choose Schema and we stick to that. And I have this idea that maybe I should switch to Malli. But right now it's working, so I stick to that. It can be confusing. I think it's really good if somebody already done it come and tell you this is how you do it. But this is not the case most of the time.<br/><br/>Yeah, it is difficult when you don't know it. And I think, like I said, you should not too much think which one is the best one. Maybe try one. And if it really brings you to a dead end, then you can always switch it back to some other option.
Artem Barmin
If you can go back 15 years ago and talk to Rich Hickey, what suggestion would you give him? Maybe choose something in Clojure, do something differently.
Jeffy
I would tell him, you're doing good. Keep doing that. Because his talks are amazing and I really like to listen to them. I'm happy for that.
Vadym Kostiuk
Yeah, you partially answered this question, but still. So we had our previous guest, James Trunk, who is the vice president of engineering at Griffin. He asked a question and it is as follow basically, how do you approach defining the shape of data in your system? Like what tools do you use for that? And what are the challenges and advantages you've experienced?<br/><br/>Do you use tools like spec or Malli, schema? That's what you already covered a bit. And how deep into the system are you using these specifications or you're only applying them at the boundaries? So this is the question or set of questions, I must say.
Jeffy
Yeah. I can just tell from what I understood and from my experience. So we are keeping it at the boundaries. So we are using spec with schema at the boundaries. And as per the shape of the data, we are using maps everywhere. So we are not using records and protocols. So we are using maps.
Artem Barmin
Can you maybe give amount of lines of code of the project? So to understand.
Jeffy
I was thinking of checking this yesterday because of a scroll, but I didn't check it, actually I don't know. It must be, I don't know, a couple of thousand. Yeah.
Artem Barmin
And you keep it on the API?
Jeffy
Yeah, so we are just developing the backend APIs. Yeah, so we have smaller code base, but there were some challenging problems which we solved with it.
Artem Barmin
Okay, great. Thank you. And you can ask the question to the next guest, actually.
Jeffy
Yeah, for me, it's about the problem which I always had. So in the beginning, I heard that with Clojure or with functional programming, have like most of your code is stateless, pure functions, and you have the state in a small part. But when I write code, maybe because of experience in other languages, where state is all over the place, it is not that much different. So I have like pure functions and like tests for that.<br/><br/>But still, find quite often I have a function. It calls another one and calls another one. And that one has state. So then the whole thing is stateful. So how to separate state into as small part of your code base as possible? Do you have some ideas on how to do it? Like, how do you do it? Do you do it? So this is the question I have.
Artem Barmin
Can you elaborate on the... So you're talking about stateful code, yeah? Not the pure functions that just get the arguments and return a new shape of the data.
Jeffy
Yeah, exactly. So a stateful thing. So let's say you have an API. It adds a record to the database and the whole flow till the end of adding to the database. There are stateful things and there can also be pure functions. Maybe you validate something and you can have some pure things. So how do you handle this? Because quite often it ends up like there's quite a lot of stateful code everywhere because you call a function which has state.
Artem Barmin
Okay, got it. I can share my experience…
Jeffy
Yeah, please.
Artem Barmin
…because I wrote some code in Haskell and there is a clear separation on the type level in the Haskell program between pure functions and stateful code. <br/><br/>And what I usually do is do as much as possible beforehand in a pure function, just prepare, for example, list of objects that they're going to save. Do this purely, write the unit tests, anything I want. And in the end of each method, put this dirty stateful thing that just goes through the list of operations and apply it to the database. So that's how I do it usually. Prepare instructions in the pure parts of the program to do and implement them and apply it to the state in another part of the program. So kind of operation.
Jeffy
Yeah, cool. I was also reading, like, I think it's hex signal architecture, where you have the ports and adapters. So you kind of have this part where you can use it by later. Like, I think it's similar to what you said.
Artem Barmin
You can try to develop some toy programs in Haskell and see this clear separation there. Idea of monads for input-output.
Jeffy
Yeah. I think like in 2014, a friend of mine actually told me about Clojure. That was my first time. Also told me about Haskell and functional programming. He thought of trying out Haskell. And I also thought of trying out Haskell. I dread it a little bit. I did not understand it. So I stopped it. So yeah, Clojure is something which I understood. So this was also easy for me to get into.
Artem Barmin
Yeah, I agree. Clojure is much more practical, in my opinion.
Jeffy
Yeah, also, yeah.
Artem Barmin
Thank you for talk about your real production experience with Clojure.
Jeffy
Thank you guys very much for doing this. I think it's a good thing that you also try to share it, like how people use Clojure to bring more awareness. That is really nice. So thank you, Artem, and thank you, Vadym.
Vadym Kostiuk
Thanks also to our listeners. And if you'd like to explore more about HolidayPirates, we'll share links to their website below this video. So yeah, make sure to check them out.
Artem Barmin
Big thanks to the audience. See you next time. Bye bye.