 Should I sit down? Can I stand? Yeah, if you want to. Yeah. I'm just so you can hang out. All right. So, I'm Karo. I'm from Poland. And I'm going to be presenting IntelliJ with Parson and a bit of Stuart Sierra's Reloaded workflow. If you're maybe you're familiar with that. So I'm not hungry today thanks to this company. So we are Ayota. We're in digital advertising industry. And we're growing pretty rapidly. What I joined was like 15 people. I think it's like 45, so it's pretty awesome. You probably don't see that, but it's a lot of fun. Like even our management team, like this guy is like I don't know what it is. You don't see that, but it's pretty fun. We are a global leader for audience data with over a billion unique profiles across the world. So I don't want to bore you with that. Our partners are advertisers, advertisers, publishers, data suppliers. And that's it. If you want to know more go to this guy. So what I'm doing right now, so it's my first project. So I don't know everything about it, but I'll try to be helpful. So our project is Web API and it's using Green Composer Libertor and we're using Cassandra Elastic Search and Postgres for legacy data that we are going to migrate to Cassandra Elastic Search. So the corset itself be moved. So the nice, really nice thing about IntelliJ is that it really does understand code. It really does understand, it really builds the ASD, abstract syntax tree. So whenever I have a function like this, I can just use my shortcut and it's going to go to this declaration. I can go back. Now, if I start typing it has this awesome out of suggestions like in that sense, features. So, either I'm doing something like from Closure Core or I'm doing things like in my own project it's going to suggest me that I correct names and it's pretty useful. One thing that is really nice is that either if I'm in some other file like here and I don't have this object it will import it here in this file but I have it here in my project, I still have the suggestions and when I press enter it's going to import me that one. So, that is really really nice and it really speeds up your work. What else I wanted to talk about. So, whenever you are on the you have your cursor on something, you can run the documentation like this. So, it doesn't really matter if it's Closure code or it's Java code, it's going to show you the documentation for that. Now you can find so, I just went to the definition of something so, I can do backwards so, I can find all the usages of this function oh, that's the only one sorry I don't know, Konka yeah, so these are all the places that I'm using Konka in my project so, that's pretty nice and I can just navigate to any of them I can go back so, that's pretty awesome What else So, it has all the features from Paradev as well so you can navigate so yeah so, I can navigate between expressions like this I can kill the expression I can I can what can I do if I have something like like this so, I made a mistake and now, I want this 1, 2, 3, 4 to be an array then, I can just wrap it like this and I can move the brackets like this I can go back so, it's pretty nice and it speeds up your work nicely as well that operation is called Slurping and Barfing in Paradev exactly, and it just implements this Slurping in Paradev you can also do I'm not sure if I remember how to do it I know that you can you can do things like okay, I forgot the shortcut but you can you can do the you can transform any of these to thread to threading macro so, that's pretty awesome too you've got your threading macro and you can transform it back to just functions right yeah so, it supports renaming variables it supports renaming functions as well it supports, it even supports renaming functions across the files so is it the only one? so, if I want to change the name of this function to string to blah blah then it's going to be refactored everywhere in my code this is nice, but it's not as nice as I'd go to any, anywhere some real code oh, like this alright, so it understands keywords so I can, this is these are all the places that I'm using this keyword and the really nice nice thing is that it understands not only the keyword itself but if you're destructuring your keywords, using keys for example it's going to understand it too let me just quickly find any users of that I'm not sure if I can share with this one anyway if you want to change the name of any keyword you can do this in the same way so it's going to change the keyword name across the project which is awesome as well as things like if you're destructuring so by destructuring I'm talking about things like keys and here roles and here I've got an object where my roles are 1, 2, 3 when I want to change this you can see it highlights roles as a keyword so that's really nice that's really nice what else do I have here so it's IntelliJ so you can extract the variable and it's pretty nice let's go here so here I want to extract this variable so I can do it like this so it will ask me where do I want to extract so it will highlight me so I want to extract this one and now it will ask me where do I want to extract this so I'll tell him please do it here and my awesome map so this is really nice as well one other nice thing is that sometimes it will give you some quick fixes so when you do the nest that I don't know how to call it short version of function it will tell you that something is wrong because this is ambiguous so you can I I'm not using this computer totally forgot probably I can just do it here and so please convert the inner one to function or outer one to function and so this is that's nice so there if we mess up our code like this we can just quickly format it back and it is configurable as well so you can find your own formatting scheme and okay so I think that's all about the code of course you can navigate to files like this but okay so go to tests go into tests so if I have my repl running mainly so I have to run my repl usually it's pretty fast now because I have like some tendencies like taking a while but if I have my repl running it's becoming even more powerful and I will show you about in a minute alright so whenever I am here and I have my cursor here I can just run the test and it's pretty fast so if I change something and I run it and I run it again it will show me so this is the place where the test failed and I have the result instantly here and the really nice thing that I really like especially if you have complex objects is that you can show the difference and it's gonna show you in a really nice way where the difference is that's awesome yeah that is that thing saved me so many times so it's really nice so you have a way of running a single test like this or tests like all the tests in your file see I have no idea if you can run all the tests in your project if you haven't checked up like you are showing that in Eclipse but I can use it oh you can use it I've never done so should I go here you only have a tab on the right where can I I see it on the right maybe you can just go find it coming outside yeah so would get us just saying that I can I need to get a tab to save the engine but I think we need to test it yeah so you can run all the engine functions oh right I guess I can right so I'm not using it open all the lines in the command line functions exactly I did probably parse the results and show you a nice test execution I don't know yeah maybe so I'm not using it that often I'm rather using my grapple I should stop doing this as well alright yeah so it understands line engine as well alright what else do I have here okay so usually I don't really use debugger often but if you want there is a diver and it's pretty nice so why not to start uh wrap with rhyming yes I do so if I go here turn it on so the debugger works pretty nice so you can either debug your closure code or if it goes to java you can debug your java code and it's basically the same as in java maybe it's not that awesome like here and I can put the debugger here to work now oh it's not working oh oh thanks I have to run the application first I'll show you in a moment how this works alright so now my application is working so now that's just routes like users me so I'm gonna restart route oh sorry I had to run it as a debug while it's starting any questions so far there's one other thing I think you should show that I think it's great that I told you I mean that's for like I forget the name for it it's the pop up power complete menu that lets you do any action from the ID from any of the menus any action name that's auto-completed so you don't have to use them else for anything like type build here wow I just learned something this is my favorite feature it's like anything you want it'll show you the keystrokes it's not it's amazing that is pretty awesome thank you wow wow that is great indeed that's the command that boosts your work here sorry that's the command that you want to close the tab select keywork so it's like you scroll up here in the windows version command here let's command now here what happens I don't know that is fair because that is the macOS 10 command for close windows so that depends on what key that is alright so I have my debugger running so yay alright so I have my dates I'm a little here so I can just highlight this and I can see the whole the whole structure here so that is pretty awesome I mean I'm not using it often but still if you want it's here if you have some let's would it show you as local variables? if I have the let's if you have some variables bound let some symbols I guess would it show those as local inside the breakpoint? I just I just switch it up but I have no idea to be honest I'm not using it at that time alright still really cool yeah anything more? no alright so from the demo I guess it's all so why do I think it's nice because it understands the code it understands the syntax and really nice thing is that you don't have to have your grapple even running your application running so still to get the suggestions about the code and the navigation is flawless it's really nice you've got hints and it supports the factory and all the compilation errors, warnings like key bit I think key bit is by default it's supported things like erity warnings if you want to if you want to call a function with the wrong erity it will tell you about that as well so that's really nice unused variables so for example this one is not used so I should probably delete that oops and I've shown you that it's supported by a supplier or import for Java is supported as well and it detects even the dependency cycles which is really nice so if you have a dependency cycle it will just show you the alerts that whoa something's really wrong so the best thing about IntelliJ that it's manipulating syntax not text as most of the editors there's some drawbacks of course so now it's in an early stage which means that you don't have to pay for that which also means that it is being updated monthly I guess so sometimes I come to work in the morning and it doesn't work because it's just updated so I have to install it again it's probably like 5 minutes but it's a bit annoying but still it's for free but in the future the guy will be charging for the usage and he told somewhere that it's famous around like high-term prices so I've checked for a single license it's like $99 monthly so yeah so is there just confusion to talk about the maker of cursive and not the maker of IntelliJ yes yes yes we can still communicate each other for free but cursive as extension or plugging or whatever it's going to cost about a hundred bucks exactly so the thing is so because it understands the code so it'll complain you about everything that it doesn't understand it's a real thing so one example will be protocols and records so generally it understands that but if you have your protocol defining one file and then you have a function that returns this a record that implements some protocol and then you're using this it doesn't understand this definition at all so it'll show you that it'll complain, it'll shout that oh I don't know this of course the code works but you have the warnings which can be a bit annoying or sometimes it doesn't understand macros so understanding macros is a pretty hard task because the macro can do anything it can format this or something so it aims to do that but yeah it's probably impossible to support it totally alright let's skip it so that's all about IntelliJ do you have any questions about the editor, about the workbook I'm just curious if you try to handle the closure is that a plugin by JetBrains so macclosure is an old plugin and I don't think it's no longer supported but the plugin was built on top of macclosure so the guy, the author built it because he was annoyed by macclosure so yeah it's developed by I forgot the name calling plenty, thank you any other questions about workflow alright so how many of you have used alright like 4 so do you use reloaded workflow that I was, so my what I'm going to be talking about is Stuart Sierra's view on reloaded workflow you need to think so closer to namespace retool there is just a library written by Stuart Sierra and it will give you mostly nice feature about refreshing your namespaces, resolving the namespaces and refreshing them refreshing the files and the second thing is that you should not have global state in your application at all so the idea the idea is just to be able to shut the application down discard any transient state that it has created and start it again return to a similar state in less than a second sounds crazy, especially when I started working with Poisson, dry elastic search and many libraries stopped, I was going to my retool in terminal and the repool itself was loading for probably like 30 seconds so every time I wanted to reload my application I had to wait for 30 seconds so it was re-enailing and it was slowing me down and that fix the problem so how? instead of having your application as a single item you'd rather want to put your application into just one object and then you can construct the instance of this object of your application and you can do it many times so you can have your constructor for your production you can have a constructor for your development mode you can have a constructor for a test or many tests it totally depends on you but the one thing that is good is to avoid global state if you have any global state I will tell you what I call global state in a moment but if you have any global state it will just not work and really know the global state so what is this weird global state? so if you have your variable defines in any of the files like this so it's a ref or and then you use it in some of your functions there are two problems with that first problem is this function is not really explicitly telling you that you are using some state so the state is coming from some outside world so it's not really functional programming because first of all it's introducing state and then you're not explicitly using your only local variables and the second thing is that you're creating a global state so you might think that I'll be smart to all of that locally because I can do so now it's all local but no it's still exactly the same as this one because it's still coming from outside it's still defined as a global state so how can we avoid that so we can have a constructor function or whatever function we want and then in this constructor function we can return and map that will store those reps items and then we can be explicit so every time we want to execute invoke the op1 function we have to pass the state so the constructor can be different for many many workflows like the production development mode and you just have to pass it to the function and it's really really easy to test as well because in your test you can just call the constructor of your application and that's it no mocking, no anything no yeah it also allows you to reload your code using for example this reload with workload proposed by Steward and there's one thing more so in so many libraries like I don't like SQL Corma or many others you'd probably see some things like like global dynamic resources and then it's exactly the same as the previous example it's just introducing a global state so let's say that you have a file with the definition that's actually our use case you have a file with definitions of your entities in your database so doing that just telling that these are the files you cannot reassign the files you just read once it cannot change during the runtime so you are really limiting yourself there's one defined resource right and what happens if you want to write a test that doesn't have access to these files you just simply cannot do it so you have a situation when you say that I have to connect to my database or I have to create some thread pools or start my web server so I have to do that but no, you don't really have to because you can put everything to your constructor so your constructor can return an object that would consist of everything like the database connection or the database config your cache, your server and you can have, as I mentioned before, you can have different constructors for different environments so for example in my environment I can have my memory store I can have some local config and I can mock the web service but on my production I can use zookeeper some SQL and real server so that gives you a really nice flexibility so then you can implement the functions like and stop so if you're implementing in my case I'm doing the web API so I have start and stop implemented or restart so whenever I want to start or restart the server I just go to my breath pool and it's refreshing all the files and it's going back to the state, like initial state in less than a second I'll show you that in a moment so you might have seen that before so what I have to do is I have to run my breath pool and I have this file defined here that is depth so it's not really a production file, it's just my depth file so I have all the functions like init, like start, stop go and I have two functions here, reset and reset prod here is just like reset will run my web server in debug mode and it will open my browser and reset prod just works like on production without debug mode and it doesn't open it so what I have to do is just I have to use or require this file, it's only user and then what I have to do is just reset prod wait for a while that's the first time I'll show you in a second that it reloads pre-fast after the second time it's our first time so the one thing that I have to require that I can, and it's pre-fast so if I change anything in anywhere it'll I'll just do like this and this and the whole application is refreshed, all the files are refreshed, everything is recompiled and it's working the whole style like a sundial, like a web server everything is working again so how I yeah to use to refresh the namespace again so because so resets so if we go to this reset function it uses this refresh so what is this refresh refresh is a really nice method from this namespace rep pool what it does it refreshes everything so it just like clears everything out and refreshes all the files, loads them again, but it is unfortunately your responsibility to just load the management again but I don't think it's such a big problem so good I have to make sure I understand the value of this if we didn't do it this way the way you're demonstrating a common workflow is I go and I hack on some function I send it to the rep pool I keep updating it, I send it to the rep pool again the rep pool is my state and the problem is with this approach the one I'm describing now I can put my application into a state that we can never put itself into by accident and then I can spend 20 minutes wondering why some other function isn't made the way it should because what I really wanted to do was just refresh everything that's where this is saving me from yeah exactly and so my workflow right now is that I just anytime I refresh I change anything in code I would just reload my whole application so I just go instantly to the initial state so I have nothing coming from rep pool I haven't changed anything I'm sure that it's all being sorted all over again so it saves you I've had the exact same problem and I've lost probably an hour or one time it was the dumbest problem you can just refresh anything you can do that with other problems I don't have to spend an hour sure the problem just is you're debugging a function and you're just playing within the rep pool you're like no this isn't right I don't write in the rep pool I write in my editor I'm using e-max you'll see this in the end when you see that you edit the function, you send it to the rep pool and then you invoke it and you're like yeah that one's right good but the problem is you ended up walking like some other function once and you forgot that you did an undo and you didn't resend the correct version back into the state of the rep pool which is your whole system and then you lose an hour trying to figure out what's wrong with what you thought you were ending when that part ended up being right so this is pretty nice to see so just to show you how my constructor works it is called system so I have some default config the rest of configs I'm loading from some configuration files some magic here but the most important part is here so I'm just returning a simple object so my start server function and my data model my configuration and database configuration and that's it and in the tests I have something similar but I'm not using the actual data model that is on production but I'm using it I'm creating it on fly so I can do that really easily it's just a matter of implementing this really simple with for items here and I think that would be it so links so if you want to start with cursive and you want to know more then there's a really nice talk of calling Flaming the author of cursive that is here and then we know that workflow there's an article how to do that and also talk when he explains everything that I just told and I just spoil everything from his presentation any questions to that? sorry I haven't used it no, I haven't used it so maybe somebody else can answer I've used the component it's basically a implementation of this workflow with a few standards so there's a protocol for start and stop for a component so you can just create and implement that protocol and it's just playing with the standard set of functions but the workflow and the actual functions so it's like a template it's like it's got some standard functions so there's component, stop, component, start alright I assume you're responsible for implementing the body of the function yes, but the nice thing about it is it enables composition of different components using the same designer so you can create a system amount of multiple components as long as they all implement the same protocol the entire system will start up so you can imagine in your component amount you could have a component built by someone else as long as it follows the same protocol to start and stop in exactly the same way and it follows exactly the same pattern so it's I've used it on a few projects it's a nice way of composing a modular system where you've got a database component a logging component a server component etc and they will basically follow the same pattern so a couple of people have built lineways of components that's nice it's effective so maybe I'll just show a little one thing more and I have a question to the young audience because I don't really know how to do it better so our project consists of two projects they are these are like two separate projects so sorry? yeah everything is named Tsukiji and then we've got Uni, Ebi so Japanese names are different kind of creatures that live in the sea so now so Ebi is just a small library that is used by Uni and what I've done is this pretty bad thing is that somewhere here I've got I don't know where it's at yeah I've got my source bots to write it to Ebi so somebody has any better idea how to use dependent project like in Gradle you can have different projects and you can define which one sees what that would be nice to know maybe for the next time for the next presentations next I'm sorry I'm really curious preference of intelligence what's the type here alright modules so what I'm using now is checkouts and lane checkouts so the way it works now it's that yes Ebi is in the folder of checkouts Ebi and then in project CLJ I'm using the source path in source path so composing those two checkouts and source I'm able to see them here I'm able to compile them I'm able to access Ebi from Wuni and Wuni from Ebi so it's all working but I feel it's kind of a hack I can explain what I do in similar situations I don't know how it plays but my idea to do it is have them as separate separate projects and what depends on if you've got a snapshot version and two projects open in the workspace it's smart enough to realise that this is what is actually a main independence of this one and you have to set up the build path for you so that it actually treats it as if you've actually got it as a just a work set in your records and of course I don't think that you ever certainly can make but I think the line would be good so basically these are all source paths two separate projects the nice thing about that is it's the same as if you're actually someone is using it you have this sort of dependency in your projects so it's not exactly the way to use it that's how I do it so that would be it