Let's Learn Kotlin/JS! (with Sebastian Aigner) — Learn With Jason

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone and welcome to another episode of learn with jason today on the show we are bringing in sebastian agner thank you so much for being here today how are you hey jason how's it going i'm actually really good i mean it's been a long day uh you know being in europe it's like like half past six now um yeah yeah no it's it's pretty great you're on your your what third fourth event today you're uh you're just all over the place yeah this is the third event uh i'm really trying to embrace all this you know new media as they say [Laughter] we're doing a bunch of like internal live streams these days we have a podcast and yeah i'm i'm involved in all of that so got to keep it busy right yeah the the the new world of trying to do um like devrel and and kind of outreach stuff when you're not able to travel and be in person is um just a whole lot of staring into a camera lens yeah it really is it's it's incredible like we've we've had a bunch of bunch of events where you really re you start to realize how much you feed off the energy of the crowd and when you're just talking to a camera and you make a joke and you have no idea whether it lands or if like you're just like doing like some cringe-worthy stuff yeah it's uh it's tough you just gotta power through this this is my whole life right as i just i taught myself that i'm very very funny because i don't get any feedback so i just had to believe uh so i just stand in front of the mirror and and tell my jokes and i laugh at my own jokes so i'm convinced now that i'm the funniest person on the planet and i'm really scared to go back into society and realize that i'm wrong um so i might just stay inside tell jokes to myself for the rest of time i mean hey whatever works right [Laughter] um but yeah so uh so for for folks who aren't familiar with you do you want to give us a little bit of a background on yourself yeah sure absolutely i'm sure there's a lot of people who are familiar with me let's not kill ourselves here i got like what 1 500 twitter followers uh yeah hi everyone my name is sebastian i'm a developer advocate at jetbrains where jetbrains build a lot of tools which you might be familiar with maybe not if you're coming from the kind of web corner we build a webstorm php storm uh if you're coming from like the java corner we're building intellij but we also have stuff like um pycharm for python c lion for uh c and c plus plus and a whole bunch of other things and last time i counted it was like 26 products plus like our cloud infrastructure with like continuous integration all this kind of stuff but yeah um i specifically focus on the kotlin programming language which is something that we're building at jetbrains um kind of to fit our own needs first of all and then also to kind of really provide the the community with a with a great new programming language um yeah and i kind of it's kind of funny how i got into japanese because i i started uh kind of doing events for them at universities and just kind of teaching people and then at some point i was like well i was at a crossroads and i was like i could continue studying or i could start doing this full-time and yeah here we are yeah um yeah no that's that's uh i mean i i like that path in right where it's kind of you're you're doing a thing and you can see the you see you like start to find something that you enjoy that you maybe were just doing you thought like temporarily and it's like actually you know what this could be my job like what if this is just what i did um yeah that was that's kind of how i feel sometimes when i realized that through whatever twist of fate i've sort of become an internet tv show host it's like yeah definitely didn't have that on my dream board yeah but but this is honestly it's it's the same for me like i was i never thought that you could make a living like giving talks and like doing tutorials for for people around certain technologies i just honestly i just never had that on my radar as well i was always focused on being like okay i'm going to become a software engineer i'm going to write code it's going to be that but yeah twists of fate uh sometimes things go go really well um yeah and and so you uh you focus a lot on um on kotlin specifically right yeah right and so kotlin i think is is for a lot of us especially in in this audience um i think a lot of folks are uh primarily web focused so kotlin is one of those names that i've heard but i'm not really familiar with like what it's used for so could you maybe talk a little bit about what's the problem space that kotlin came in to solve and um and you know what got you excited about it so this is kind of interesting because the problem space kotlin came in to solve and the problem space kotlin really excelled in are kind of different oh interesting because so we started building kotlin almost 10 years ago now almost to the dot we have a couple 10 year anniversary events coming up uh inside jetbrains because we are traditionally a java shop so all of our 26 products they are all built in in java their desktop applications um and they're huge code bases multiple millions lines of code and at that point at some point you kind of you run into the limitations of of the language and also kind of the language evolution right we have a lot of new trends with with functional programming immutability um concurrency all these kind of topics and at some point pretty much we thought like hey we need a a better language that allows us to continue working on our products that were all already written in java but do it in a in a more modern style so what what kotlin really is or what kotlin really started out for us was a 100 java compatible modern programming language which you could use just general purpose build desktop applications build server applications and so on when it really kind of took off and kind of got exponential growth growth was when um google like two or three ios ago announced that that kotlin would be next to java the only officially supported programming language for building android applications and um i think one year after that they announced that android was going kotlin first meaning that all their documentation um all their materials were guaranteed to have samples in kotlin um and maybe they'll also have samples in java but yeah that's at a very clear course and of course that really helped us um also with kind of pushing adoption because once you have like really big global players like google buy into a language uh i mean it's just it gives people the peace of mind that it's not gonna go away from one day to the next that's uh i mean and what a cool endorsement too when you you get buy-in from a company at that scale to say yeah we're going to move you know how many developers get moved over to kotlin when they make that choice like it's uh that's that's exciting um funnily enough traditionally so i'm not an android developer at all so i actually i'm uh my my story is kind of simple like i started writing java code just on like during university i was i don't know building server side applications building all kinds of things then i got into this course where we were building ios apps with swift and after that i kind of went back like after all that was over i couldn't write java anymore because i was like wow i've kind of tasted like there's modern languages there's there's new stuff out there there's better ways to do things than how we do them in java and so i looked around and i found well i found a bunch of like different alternatives but kotlin stood out to me because it gave me the immediate premise of like hey everything you know about java like everything you know about the ecosystem like it translates one to one over um but you get to enjoy all these cool new things and like all these modern paradigms nice that's that's super exciting so um there's a couple questions in the chat that i think are are good which uh is is so is kotlin a c because kotlin is java that means that it's mostly a back end language right you see so this is kind of funny because we we have a bigger vision for kotlin so kotlin for us is really just a general purpose programming language um as i said we at jetbrains are building desktop applications uh with with kotlin so all of our development environments they are written in a mix of java and cotton now of course we're also building server-side applications people are building mobile applications with it um but we are also doing something called kotlin multi-platform which is the idea that well collin code is compatible with java but it's not a java dialect it's its own language which means we can also compile it to native code through colonative where you know at the end of the whole process in x86 x64 apple m1 binary falls out of it um and we also have something called call in js which is our tool to kind of take the whole programming language and bring it either into the browser or into a node.js environment yeah so this this is actually like this is kind of what got me excited about this is is so what you're proposing here is that we can use kotlin which started out as a a kind of like a dialect of java and now we can use that and all of the the type safety and the autocomplete and all the things that come with using you know the the jetbrains ides around this stuff and then we'll we'll look at those in in a bit but we get all that in the browser for our web applications like we can build web applications with this this type of back-end language um that's really exciting and you know i think that one of the things that like i am i am an unapologetic javascript fan i think that javascript is great however i do think that it's problematic that javascript is has for a long time been the only real option if you want to build for the web and so one of the things that i'm excited to see is more languages entering the space where you're you're seeing like you know rust is starting to figure out how to build web tooling and and we're seeing like so here's kotlin making it so that you can write web applications with with uh with with kotlin instead of with javascript and you just js becomes a compilation target instead of the thing you have to write and that opens up some really fascinating opportunities because now you can build for the web but you don't have to be a javascript developer to do so um that seems that seems like it's uh it's a good it's a step in the right direction right like competition in this space seems like a very good thing oh absolutely but we're actually i think we're dreaming even a little bit bigger than that because with this whole concept of of kotlin multi-platform the idea at the end of the day is if you've written it in kotlin you can run like if it's pure kotlin you can run it on any of the targets which means you can define yeah so so uh for example you could have a server that runs on the jvm because you want like really high performance high throughput and you have a web front end uh which runs on on call and js and but you only write for example your form validation logic you only write it once and you you just kind of pull that in on the back end on the jvm on the front end in in javascript and you only have to write it once you only have to test it once you get the same behavior on on two platforms on two extremely like different targets that's very cool and is that so this is i mean this is a big question but that always feels like a like a promise that seems too good to be true like it's like it you know like i feel like we um we saw this a little bit with with react native where they were like oh you can you can write react native and and it'll work on devices and it'll work on the web and and when you actually start to see that play out it's not as like it works but there's more finagling than than you maybe want and it starts to get into this like you know that it works for 85 of the way and then 15 of it is working around these inconsistencies and so i'm curious like is is kotlin seeing that same challenge where when you're you're writing your kotlin code and you're you're compiling the six different targets are you are you seeing the that similar kind of like oh it worked on most of them but we got to go add this this edge case in to to deal with this thing yeah so the i think there's a fundament at the current point there's a fundamental philosophy difference between things like xamarin um or react native um and and multi-platform because the idea with a multi-platform is not you build the same application once and then you run it everywhere the idea is you write out your business logic once so the things that are specific to your application and then when you have stuff that is particular to each individual platform um you can just kind of tie into that so if you're gonna be building um for example an ios application with uh with kind of this whole multi-platform story in mind you really just kind of you write a framework or a library in in kotlin that abstracts away like your your main tasks but your whole user interface you build it in swift ui or you build it with the with the xcode interface builder or whatever you want so you get a completely kind of native application you can integrate natively with the camera api maps api whatever but the the part that is like truly common that you also like believe is common that that doesn't depend on any platform stuff that's the part that you can abstract away got it okay that makes sense i i yeah i like that um and that that does really make sense to me that you know if you if you know your business logic is consistent having it in a way that's actually shareable cross-platform so that you're not having to port it to you know i've been in teams where you know we did we had the java library and then we had to write the node version of that and then we had to write the php version of that because we had different systems and it meant that when we had logic changes we had we had to go make those changes in three or four or more different languages exactly so so this is very promising exactly so so think about if you have to tar like especially if you are a library author i think this is kind of nice because let's say you're building an api wrapper for your checklist application or whatever um and you want to say okay i want android developers to be able to use this i want javascript developers to be able to use this i want ios developers to be able to use this what are you going to do you're not going to like you don't want to write it three times you don't want to keep it consistent three times you write it once and you get like and like exported interfaces from like this kind of common language which is quite exciting yeah okay all right i'm in you you you got me i want to start writing some of this so uh let's go ahead and switch over into the the pairing view and um and let's do a quick shout out to our sponsors we've got rachel with us today doing live captioning as we go where's you gonna whoops what is this hello you gonna do the thing why does it think that it's tomorrow time travel oh no oh no my my my thingy where's what have i done oh god did i break my website okay everybody i broke my website which means i need to do a quick search for the uh let's see there's an iframe that we can look at so that you can see the live captioning and i am very sorry about this give me just one second to get this figured out um we're going to where's the live live player and here is the actual iframe so yes i apologize but you can still see the live captioning it's happening right here in the window um so that is a oh that's a bad link uh that should still work even if it's not that is a funky that's a terrible link i apologize um but this you should be able to see even if the styles don't look exactly right but um you'll be able to see we've got white code captioning doing live captioning for us right here you can uh you can follow that link to see it and that's made possible through the support of our sponsors we've got netify fauna auth0 and hasura all kicking in to make this show more accessible to more people which which i really appreciate it means a lot to me um and i will figure out what i did wrong so this works by next show today we have uh we've got sebby on the show so make sure you go and follow him sebi underscore io that's me on twitter i mean learn all the all the good kotlin things and we're gonna be talking about kotlin lang but specifically today because that's probably the most hope that we have for me is we're going to talk about kotlin for javascript so this is kotlin slash js um and now that's a lot of pop-ups okay cookie laws now we've got a whole other thing i'm using a new ide today and this is uh this is intellij idea which i have used exactly long enough to um let's see what did we do to set this thing up i i downloaded it i installed some indexes like common indexes just so that it would go faster we downloaded them ahead of time and i believe that's all i've done inside of this yeah we created one project and and pressed run once we did like the hello world code to make sure that it was gonna run on my computer that's about how far we got so um yeah let's uh let's let's see what can we use a light theme say you have a bright idea i mean i mean if you want to you can you can press shift twice that's that should put up the uh search everywhere window just shift twice okay and then you can go for quick swing quick switch theme or or i think it's if you type quick it's going to give you a switcher that's going to be even faster quick switch scheme and then you do color scheme editor color scheme the top one and then you can do classic light and yeah for the entire ide oh look at it go there we go bright idea all right we've got a bright idea i love it so by the way before we before we dive in i think someone in the interest in the chat mentioned that they actually have a kotlin multi-platform use case in their in their application i'm not sure unfortunately it's scrolled away by now but someone said they were using multi-platform maybe that's interesting for a couple other people uh yeah let me see if i can find i don't see it no um well people are talking about that it can target a bunch of different platforms uh but i don't see somebody asked about targeting webassembly is that uh is that possible um the short answer is we're working on it so not not quite yet but um it's it's another very interesting target i think for us there we go that's the that's the comment ah there you go sam hamburger oh sorry i did just see i scrolled right past that one okay so using multi-platform to execute a lot of shared business logic and extract away from our independent client apps uh therefore clients are insured to be more aligned and future changes of this logic only need to be made in kotlin yeah that's that's exactly what we're going for excellent i'm glad people are already embracing it all right well i'm i'm ready let's let's write uh line one of of kotlin here so if i'm getting ready to start what should i do all right so well you've already set up intellij idea which is the the most important step right intellij is our free ide actually so there is also an ultimate edition which which you have running but you can do it with the community edition just fine and yeah that's our development environment which comes pre-bundled with the kotlin plug-in which um gives you all the things from uh code highlighting to completion uh to all kinds of fancy navigation you know we're a tooling company so this is kind of our uh um our bread and butter is to provide you with with good tools right and from there we can start a new project by just going to like file new project right now i think we still have a old jvm project open so yeah and we'll go to yeah we have kotlin here we can give it a title let's see so i probably want to i can this is something i can put on like github right so i can just move this around uh yeah absolutely we actually even have integration for uh for github so both for git and for github in the ide um a nice little ui i mean that's kind of a bit beyond kotlin but uh wants me to create a new one let's uh okay so let's do kotlin js sounds great okay um so then we and i can just do i name them [Laughter] if we scroll down a little bit uh in the templates we can start with maybe just a browser application for now but you can see we have a couple of templates we have browser we have react and we have node.js okay and also something dropping in the next uh next iteration is going to be compose for web which is a really fancy way of sharing user interface code between android and web but again well we're getting ahead of ourselves yeah um let's just add uh a project jdk whichever one you have installed uh just to be safe that's just i have two yeah adopt open jdk is perfectly fine okay um anything else i need to set here uh no you can you can unfold the artifact coordinates to have a look that's just kind of how packages are being named but yeah that's already all pre-filled okay it's all good all right so let's click next and now we have um yeah we can just select the template again test framework it doesn't really make that much difference we could be a little bit fancier than than usual and we can turn on ir compiler um that's our our new compiler that's currently in alpha i like to live dangerously so let's let's do that one okay let's do it um and you know what why don't you turn on use cotton x html as well and then we can talk at length about uh what all of these features do okay so then finish yeah yeah just finish this um the yeah i open it yup sam says they would love to see ecmascripts of ecmascript 6 support yeah uh absolutely valid so we're currently working on a bunch of things with the new ir compiler and one of the most exciting things i think is typescript exports so you just get types like you get typescript definitions from from your application if you build them as like a library for somewhere else um all right so let's just make sure that that everything works um yeah this indexing should be should hopefully not take too long oh it's already done okay so that's what happened here with this build and this gradle is uh i barely noticed it but there's a an indexing operation that happened here so can you talk a little bit about what so for for those of us who who come from javascript where like javascript just gets compiled by the browser we don't see a lot of this kind of stuff so so what's happening in the in the kotlin world um when this when this starts yeah right so when you first start um your like when you first open a kotlin project or generally any project in intellij it can also be a java project our main goal is for the next couple of hours to provide you with the best uh like experience right which means autocomplete which means navigation which means super fast search across all your documents so what we do is we create kind of a search index so we read the file like your build files which in our case it's gradle but it's uh like you could compare it to like webpack or or any other um any other kind of build system and from there on uh we kind of create these like binary representations and trees and whatnot that honestly goes over my head there's a couple smart engineers doing that which is going to allow you to see code in beautiful colors and when you type a dot behind an object it's gonna show you all the all the methods and all the extensions and so on so uh you can navigate to the source folder if you'd like and open this probably a demo file in there in the main kotlin and there's a client kt and i think that one is pre-filled let's have a look okay yeah all right so looking at this let's see what i can intuit um so we're importing from kotlin x uh and colin x is the the it was a it said it was a dsl for writing type safe html right so in order to use different features of that we are able to uh we have to import these and this this is a kind of like a yeah it's a it's like a package structure so it's just kind of or i guess you could think of it as like name spaces maybe and each of these packages these are kind of like bundled um so this is another thing that's kind of unusual coming from the javascript world is i don't have to install this it's just like it knows how to go and get it for me if i say that i want it so so partly yes partly no so some of these features are uh are bundled like right with the application but if you go into your build.gradle.kts file um you can see that karlinx html under the dependencies block in line 15 is actually an external dependency ah so perfect okay yeah so this one is an external dependency that we pull in from from maven uh which or maven central which is is just the npm equivalent right it's a central repository uh where where packages live in the jvm and in the kotlin world got it okay cool nah that makes sense um and so so this one is is a built-in and these ones we imported from an external dependency yeah so so if you want to and you you actually want to see where things come from you can hold the you're on mac os right yeah i am you can hold the command key and click on node um you can pretty much click on anything and that's going to send you to where that is where that is defined nice okay and so this is like the the whole the right it's like kind of the interface definition yeah exactly right so now you're kind of like inside the standard library you can even see uh in the in the top bar it kind of tells you where you are so if you click on that again it tells you like collins standard library js version 1 432 yeah that's that's super helpful like i i love the idea of a standard library and you know in in javascript it's it's magic like we've got the the globals but they're kind of abstracted so far away inside the browser that we don't we you know it's harder to see like what's going on unless somebody has built the typescript definitions and put those somewhere for us uh so this is this is kind of interesting like i like this model it's uh it's it's unfamiliar to me but i can see immediately how valuable it is to be able to say okay so what's in the document then i just click on this and go look at it and i can you know kind of see what's in here like that's that's pretty damn cool that we can do that um but all right so so looking at this then going further with my intuiting we've we've pulled in all the libraries we want to be able to use and so i'm assuming that like by pulling in this div i'm able to use that here and by pulling in append i'm able to use that node here document is here window is here so basically any globals that we want to use we just have to like let kotlin know that we're what we're using yeah but i mean realistically you're not going to write those yourself you're just going to type things out press enter and the appropriate import statement is going to get added by your your ide right that's what the yeah oh is that is that is that not familiar to you no that's not i mean it's got like i mean can't you do the same thing like types in like typescript and stuff sorry sometimes i feel like it works eighty percent you know it's it's very much like an anchorman sixty percent of the time it works every time [Laughter] yes i have to say so for example you should maybe give webstorm a try then actually our web ide because this is the way so i get thoroughly confused with how to import things in uh in javascript like i am just like when when is there like squiggly brackets around it when is there uh i i don't know when do i import something with a name when is it as i don't know there's so many like different ways in in webstorm i can do the same thing as i can do in in kotlin which is i type the thing they're like oh yeah like we have like we analyzed the npm dependencies we know that like in that react module that you imported that component exists you like press enter it adds the correct line i don't even have to think about it nice nice yeah so so same thing here um okay so so looking at this then we are going to uh when the window loads we are looking at the document.body and we're running a function called say hello the function say hello is going to append a div with the text hello from js is that a correct reading of this code well the question is where does it append to jason i'm assuming the document right yeah so what you actually see here is is already man our our code is really like throwing you off the deep end what you're seeing here is not just a basic function because the basic um basic say hello function would just be fun say hello what you have here is a function with a so-called receiver type right so it says if i have an object of type node which your body would be for example right that's a node in your html dom tree then i can call say hello on that object so you extend the functionality um off of node with your with your own function and so i can't just call this on like whatever dots say hello it has to be it has to be something defined and and we can already see it's unhappy with me um yeah exactly and if it wasn't a node like if i create a local variable it's still unhappy let's see what it is so yeah so even even if you have some like as long as it's not a node that's not going to work exactly yeah so that's i mean like yeah this is super helpful and so to see this in action if we want to run this uh we so this is all okay so this is by the way the page that your code just gets embedded in it's nothing special right it's it's the same as like single page applications every day just an empty page with a script that loads uh at some point okay um so actually for some reason the default is is browser production run but if you if you go to the top there's the the little elephant in the top bar um right and you can switch this to development run in continuous mode and then you press the little play button and now what's happening is that the whole machinery like kicks into play we have a bunch of infrastructure in the background which abstracts away things like uh npm so it has its own yarn installation you can run this on a system that doesn't have yarn installed uh no problem it it pulls its own thing in pulls its own dependencies in no problem it has its own webpack installation and its own webpack configuration note that we did not have to write any webpack configuration which is always a plus i do not want to write webpack configuration but yeah at the end of the day we still get um it should pop open a it did pop open but it opened in my other browser so i'm gonna close that one over here and and here's where we ended up we we are hello from js wonderful and of course you can inspect element on that and you'll see that it's exactly what we wrote which is it's a div which contains i think a p uh oh it doesn't even yeah just just plain old text yeah well so we could add a p tag inside here of course uh you could probably figure out how that might work so yeah let's so let's see what i can do here i'm going to add a paragraph tag yeah so the the one thing that you're going to benefit from is typing a little bit slower because then you're going to see what the ide actually like tells you okay i'll i will i will stop trying to to go fast here let's let's see what happens so let's go i'm going to go to a p so if you just type a p with without any okay go back once again let's see all right and here we can see that it knows a bunch of things including these like nice p tags yeah exactly so you can click one of those uh or you can select them html element seems like the one i want yeah that seems about right uh i want to move this into it yep and then is this a white space sensitive language or like is what i'm doing it is not and it is the best thing ever but if you want to have nice formatting again you can press command option l and that's going to autoformat your code for you well already formatted if you want to have it in like the multi-line style you can like add an enter key and then if you press command option again it'll rearrange the parentheses as as they're supposed to be oh nice yeah there you go there it goes um okay and we can already see that it did the thing like over here we've got our here's our div here's our hello from js let me make that a tad bit bigger so that people can see it um and so we've now written some javascript and and so or i guess some html uh this is a very good hello world um but i think that we can both agree that if if this was all we were trying to do this is this is a pretty long walk for that so um if we want to go further to really start to see where kotlin shines what should we do next here okay so how about we just do a bunch of like collection stuff so we'll just we'll we'll create some kind of object uh we'll we'll filter it and we'll maybe print out a nice like unordered list or something in html okay how about that uh yeah so i i have if we need it um all of my episodes are in a json file so we just have like this is the the big list of 200 episodes if we want that um we can also get whatever let's let's let's start by just creating a bunch of a bunch of kotlin objects first and then we can we can go to that in a little bit okay cool because i think yeah there's probably there's probably some ways to do that elegantly but i just like let's focus on on some of the language concepts before we start pulling in uh some other stuff all right i will i will contain my excitement i mean honestly it's it's it's great that you are so excited there's so much stuff to learn and for me funnily enough i actually learned web development or a large part of it using cotton.js just kind of just know yeah i didn't know i didn't know react before i uh before i wrote carl and jazz so i learned it you need to bang your head against the wall a couple of times but then you can go through the official tutorials with carl and js and it works okay so um well we can i guess we can create like a a small data model of what could constitute like what some of your episodes why not so let's just have uh so the way we do this in kotlin it's a classically um classically object-oriented language right so we have classes uh so let's create a class called episode yeah starts with a capital e as per classic wonderful now how do we define parameters funnily enough when i talk to java developers uh they always kind of get to get the shivers because this usually means it's like 100 lines if you want to add like four parameters because you have the parameters you add a constructor you add getters you add setters you add a copy method you had an equals method yeah enterprise no um the way we can do it in kotlin uh is uh you just open a parenthesis yeah please do i'd love it yeah so you can uh actually uh regular parentheses are are enough for the time being okay yeah and now we can define the the properties that are supposed to uh be in here so let's say it has a title so what we can say is a vowel or vowel yeah vowel and then we do title and then we do colon and we give it a type which is a string with a capital s that's the one and i guess we could also give it a number so see if you can figure that one out actually the type is called into the number is it uh it's comma comma and we'll we'll talk about why that is common in just a second let's see i don't think i have any kind of like numbers everything strings these days i know everything i know i have dates but who wants to work with dates i i mean we're we're doing some we're doing some stuff actually for doing like multi-platform date management because we want to abstract that away let's okay let's assume for now uh we can just make up an id right exactly yeah and that's going to be a number you said okay yeah well let's let's make it let's let's make it an int actually let's make it a whole number right hint um int exactly that's the one wonderful and that is a whole class in kotlin like that's that's all you need so we don't have to define anything no you don't like this this is the smallest thing uh that you might possibly need so then if i uh wanted to like create one so if i call it f then do i do like new i don't know how to write column at all so i'm just making stuff up here yeah but you you and see how it kind of looks like a function you invoke it just like it would be a function so you just do val app equals episode episode and now are you going to give me auto complete well if you type record if you spell it correctly it might episode yeah that'll that'll do it all right all right so this is like this is this is why i love statically typed languages if something is red i can immediately stop and i can say like what's what's happening what did i break it's it's never a situation of finding this out like 10 minutes down the line when you press the run button right that's right i think that's lovely and this one i just so happened to know was was episode 200 so so we're on 201 today nice so are these white space sensitive like can i break these up nothing is widespread sensitive we also have trailing commas um i like those love a trailing comma so yeah it's all good um and actually the fun thing is i find this super interesting seeing you write this for the first time with like really little input because the um the names for the arguments aren't actually required you can also just write github action with with octokid and 200. that's also going to work i think if you actually oh look at this oh look at that it features the brains and i'll i'll i'll do you one better press alt enter or option enter option enter and you can say things like put arguments on one line again or if you navigate your cursor onto one of the um yeah so you can you can put arguments in separate lines again but you can also press alt enter and say add argument name or something like that uh add title equals to arguments yeah exactly see there you go that's very nice it's it's all about what did i just do oh boy uh you just you just added lazy initialization uh so what i wanted was yeah this is very cool i like this uh i like that a lot and so we can kind of split that up and then yes i went in separate lines was it this this is like your your entry point to um to all the cool things in uh in the kotlin world or just generally in our product is the alt enter shortcut because that's it's like our intellisense actions right it kind of shows you everything you can do so it's it's really useful just kind of pressing alt enter every once in a while because it's just like you know uh you maybe you learn something new maybe the ide knows something better uh than than you do by the way of course navigation also works in these kind of things so if you wonder like if you have episode uh and you're wondering like huh where is that defined uh you can click on on the like the word episode with command so if you do a command click on episode it's gonna send you to line nine it's not very far but and you can also click on that episode in in line nine again and that's well right now we're only using it once but if you have multiples it's going to show you every single point just telling that it's the only time it's used yep it's like i get a lot of anxiety in projects when i go to modify a data structure or something and then i'm like okay so i need to go find every instance of this just having the ide say hey this is only used once don't worry don't worry friend everything's fine but you're but don't worry because in kotlin you're not changing uh you're not changing things like that anyway for example let's let's not call it episode let's call it call it podcast episode just just add podcast to the front of this and don't move the cursor now okay you see the little r with the little pencil yeah so this is what we call like this is one of our refactorings you can click on this and you can say rename and all the instances and of course it's not very impressive if you just have one instance but if you have a thousand classes across a million files gonna update every single one of them it's gonna be up to date again that's that's slick okay all right and by the way uh even if you're if you're getting out of this after this and you're not never touching kotlin js again we have the same thing for typescript and webstore this also works for typescript so yeah cool so we've created our first podcast episode uh maybe we should create like can you add like one or two more uh just just so we have like we can create a little collection out of them afterwards yeah let's uh let's just do hope that doesn't do what i want let's do uh this and then let's see just count backwards so we've got the one more here that's 199 and then we've got one more with prototyping with framer get that one in here and all right so here's our wonderful our three episodes by the way i i guess it's not really worth mentioning since you you kind of did it intuitively and i guess coming from scripting line which makes a lot of sense unlike java kotlin has these kind of top-level properties where you can just you know you write just a thing in a file and it's gonna be fine uh and you can also just add multiple classes to the same file again if you write java one class per file that's the hard limit they don't want you doing it any any other way oh so yeah for like small prototyping stuff it's amazing honestly i don't actually was unaware that you couldn't do that in java and i'm very glad that's not a rule here yeah you're not missing out trust me so um let's put those in a list shall we so let's let's do it so um you can create a vowel episodes maybe and you say equals list off capital o like that uh not capital l okay it's just a function invocation uh and then you pass in as parameters um our three episodes we have there's 98 99 200. wonderful so now we have uh a bunch of episodes right and they're all in a list now the fun thing is this we have like kotlin is a statically type language right but we have like many other modern languages type inference notice how you did not have to specify that this is a list of podcast episodes you just say you just say i want a list of these elements um and yeah so in fact if you want to like the ide can tell you even more things about uh your code than what it currently does okay so if if you want to we can we can turn that on in the ide for a second just to see it so if you go to the if you go to the intellij preferences which is like in the top bar somewhere intellij idea and then preferences and you type kotlin in the search bar that's probably the easiest way there's going to be on the left side there's something called inlay hints almost all the way at the bottom in legends collin yep and now you can click all you can go through each category and make ticks in every single location and we will see the full power of of these things it's very funny because some of my colleagues hate it when their ide adds a bunch of like extra information but now you can see it inferred that this is a list of podcast episodes it knows the type oh yeah okay and that that is really handy like i can see you know i i get grumpy about typescript sometimes but this part being able to see exactly what you're doing is very like i get why people are so all in on on strongly typed languages yeah i mean i i honestly love it by the way short note uh probably force a habit but we do not have semicolons in colin i mean you can do them but they're they're right i'm just saying you know how do you feel about semicolons in javascript jason i i am a i'm a believer okay it's good to know i feel like i just got judged no i'm just i'm just always i'm just always curious honestly because i like i don't i don't do a lot of like javascript developments so it's always interesting to see people advocating for the one the other it's holy wars all over the place my take on it is if there's anything that has an edge case uh i will just do the part that doesn't have an edge case like if you always have a semicolon there's never an edge case if you if you don't have semicolons there are like one or two edge cases and it's like one less thing for me to remember so why not just do the thing that makes me not think fair enough okay so you know what let's just go ahead and let's just put these three things on into our page shall we let's do it okay so we're gonna we're gonna write our first well first of all do you wanna do just like three p tags or do you actually wanna or have like an unordered list either way it's fine you we can just have to just adjust the say hello function too we've already done a div in a paragraph so let's let's do that unordered list okay so just um well how do you write an unknown list in html it's ul so i'm going to do it like this i've got my ul html element just press enter exactly inside i want to do a list item yep that's an html element yep okay but then this part so what i want to happen here is i want some kind of a logical loop right like i want to be able to say for each episode create a list item right so do you believe in do you believe in for each loop so do you believe in functional style for each i believe in the power of love so i'm i'm down for whatever whatever you're more excited about i think i i i personally would probably do like a functional for each but i'm i'm on board with whatever let's do it let's do a functional for each so let's let's get into the scope of the ul scope of the ul yeah so well because we want to wrap the like we want to repeat the li item right and then we'll just do episodes dot for each ah click that and we get a block now block gets an implicitly named parameter as you can see this is why i love these hints right because it gets an it that's a podcast episode so now we can just so to add a string to this exactly you do a plus yeah yeah that's i mean if you just want to have the title that's it how about okay so now if i want to do the id so i would do it id yeah plus a space like that plus yeah and then probably uh you you're gonna have to statically type so you're gonna have to call it tostring on the id oh my god thank you for the sub cassidy cassidy long time follower uh did i screw something up wait what's it doing illegal state exception what about that's just because that's just because it keeps compiling in the background i think this is still shown as red unsolved reference i i can't believe i'm in in kind of this in the proximity of of cassidy to be honest i genuinely like such a bright bright star on my otherwise mediocre twitter timeline [Laughter] generally stop it she's gonna be insufferable later like she's just going to be strutting around like should we we already yeah it's not i'm kidding she's the best um okay so something i have done is wrong here and i'm not i i'm sure that it's something simple but it does not like this concave try to try to put the whole thing in a in parentheses like after the after the first plus uh-huh oh it looks happy now okay so what's happening here is we have this uh we have this funny thing where we're kind of overl the errors you're seeing down there is because it does the the incremental compilation or the hot reloading right so it tries to do it it fails because your code is broken got it um yeah okay so so now that works so the reason why we needed to add parenthesis here is because we're kind of overloading the unary plus operator and when you don't have parentheses it's like well i have a plus in front i have a plus in the back like what do you want from me right does that make sense yes no okay no okay maybe say that one more time all right so so what we do so so the problem is this right like at the behind the scenes what happens here is you have some kind of buildup function right you have something that builds html text at the end of the day right um and what we need to do for that is we need to kind of like if you just put a string in there the programming language looks at is like okay here's a string you don't want me to do anything with it uh just i'll i'll just chuck it i don't need it right so we need to do some kind of invocation the shortest invocation we could have thought of was the unary plus operator right but yeah so if but if you have a plus in front and a plus in the back it's like okay now you're kind of doing like it gets kind of confused with operator precedence because one of them means concatenation one of them means kind of invocation and so what we're doing here is we're changing the order of operations so that it it puts these yeah with precision we make sure but to be fair to be fair this is probably not the code you would want to write anyway because so so go to like if somewhere in the middle of this and just press alt enter again and ideally this has um convert concatenation to template oh that's way easier than what i just did yep and now i think you can even press alt enter again and it's gonna probably tell you to that it can remove the parentheses you might have to be yeah remove unnecessary parentheses look at that and that is probably how you would want to write it actually well that's yeah that's cleaner than what i did so yeah this is great i mean this is uh this is exactly what we want we've got an unordered list in here it's pulling in data and all of that felt pretty straightforward i love that it's showing these um kind of the title and ids so i'm not necessarily having to write this code i'm able to just know that it's true um all good things here i'm i'm feeling pretty happy with the the setup yeah but we can of course we can do a couple more things to kind of show off the the power of the kotlin standard library right because this is one of the things that i've always found so confusing if i want if i have a list and i want to do really simple operations it's unnecessarily hard in javascript like how do you shuffle the list of like of three episodes that we have here so uh before we do that i have one question from the chat which is um when we're doing the you you said like when we're putting these in we're we're overloading the the unary operator here and you can even command click on the plus by the way you can see the implementation that's under it oh actually let's do that because that was what the question was what is happening um so we're just running the we're running the text function when we do it exactly yeah ah okay so cj that's that's what's happening here is we are we are basically using the plus as a shortcut to call the text function yeah and it's a unary plus so it does not receive kind of a left-hand side it's just uh yeah yeah so it just takes one argument got it got it got it okay that makes sense i'm with it uh okay so now let's let's do some some operations on our object here so you said uh shuffle is the the first one yeah sure so how how would you intuitively expect to be able to shuffle i have a theory boom is that that's that that's it just just give it a couple of seconds isn't that amazing isn't that isn't that how every language should do it genuinely believe that i genuinely believe that i've absolutely written a lot of uh very convoluted shuffle codes so i'm i'm pretty happy also i think it shuffled into exactly the right order which is pretty you can just reload the page on the right though manually as well if you want to that's the problem there you go three elements don't really have that many permutations do they it's like six right uh but so this is this is perfect like this is this is exactly what we're after we've got a shuffled list and i had to write one word that is a word that i understood which that makes me feel pretty good right uh we could do the same thing for like filtering the list like okay so let's let's do this i'm going to start typing filter all right so filter yeah press enter again it's going to give you a little bit extra help look at that you get an it that's a podcast episode and it asks you to provide a predicate that returns a boolean so you can just say it id yeah not equals single uh single single uh equals sign is enough yep is that it am i done yeah you're done just give it some time to reload i am uh there you go didn't realize that i was going to be a kotlin expert so fast yeah honestly but isn't this the greatest thing that's exactly how i felt when i first touched the language i was like i can be productive with this like realistically engineers who've done an object oriented programming language with a little bit of functional before and they can be productive within three days they write production apps within three days generally this i mean it is definitely more intuitive than i expected i when and and i you know i come in i'm not i haven't written java before uh so all like now you never will no you never will fair enough but because i did i was worried when when i heard that kotlin was based on java i was worried about verbosity and i was worried about you know needing to know a lot about the standard library and kind of a lot of contextual information because that's what you hear about when when you start looking at writing java and what you know when you hear people talk about their issues with it um so this is this is a pleasant surprise to see that i don't need to memorize a bunch of stuff that we have the the fact that you know this is kind of solving a lot of these problems by by with good auto complete and good type hinting um that's really handy and i i generally think one of the biggest things is just like a super well thought out standard library like it's generally there are like 95 percent of the use cases you can probably think of there's a there's a standard library function for it like if you want to have a map function and it takes like an extra index you can have that if you want to fold there's no problem but even for things like oh i have a sorted list i need to do a binary search on it because linear search is too fast what do you do you do not binary search and you you prov you provide the um like the uh the predicate and that's it like there's that's it's always it's weird because on the one hand it feels magical on the but on the other hand it it never is it's it's just like it just is the thing yeah enough once again you can actually click on again you can command click on filter because all this is just our standard library and you can see how it's implemented well okay it's implemented as filter two so you can command click on filter two so we can see an actual implementation here and you can see here while it does a for loop it's like okay if the predicate's true then we'll add it to the destination that's how a filter works and now here's the here's the kicker right if you look in line 824 you can see the inline modifier right so this means um our you can you can write functions in kotlin that are that have this modifier which means instead of being called at runtime this code will kind of be copy pasted in the position of uh of where you've originally invoked the function so even though even though we've written filter what actually had like what actually com it compiles down to is like just a for loop with with like destination uh where where it's going to add it okay i get that and this is elegant because this also means you can write your own uh collection operations like nothing stopping you from from like writing your own functions so if i wanted to do something like fun inline uh add funk and let's see let's see if i can write a function based on just inference here a lot of generic types in this one i'll give you that but yeah okay so so the so so what do you want to what do you want to build well i was thinking i want to build a function that adds func to a to a to some string or yeah i was just going to like add a property that says funk so if i if i wanted a generic type which would be any collection i assume that i can just use this one uh this one is actually for i think i i actually this one is one too complicated you can just say it will of t because this one is the copy 2 function so like that uh almost so without the without the outer brackets what are those called we call them pointy boys what do you call them pointy boys pointy boys we have pointy boys curly boys pointy boys curly boys and round boys what are the square ones square boys oh okay rocky boys [Laughter] so first of all to to help the ide along a little bit you need to or change the order of it's inline fun not fun inline oh got it inline file and that's what we're having is inline fun exactly okay um and one more thing you need to do is you need to once again this is kind of goofy but um you need to tell it the uh the generic type parameter once more so you need to say inline fun brackets sorry pointy boys t i triple t like that yep like that okay now we have a function called add func and okay looking back at my collections here i get so keeping keep in mind right now you are um you are right now writing like an extension function right so this is something you can call on something else right which means you already have an implicit parameter this which is like what you call it on oh that makes sense so i'm already gonna have this so then i don't need anything yeah you know i can just do like uh this dot funk equals true yeah now we just need to somehow well it's first of all you need a couple of parentheses there no big round boys but the other thing is of course now you have a uh well we're a statically typed language right so how do you know that right so i need to add to my episode yeah but we can also so we can go one further we can create an interface right we can create an interface funky okay and then we'll and then we'll just define this on uh yeah so just say interface funky and that one provides a var func so not val but var because this one now we want to be able to write to it and you say colon boolean and now you say okay so anything that implements this interface needs to provide a func variable which is a boolean so now the next step is probably that we want to say okay instead of on a generic parameter i can see a c-sharp developer in the chat who wants to name it i funky um so instead of the generic parameter i guess now we're looking at only iterables that of type funky so instead of a t this is just funky and now we don't even need this one anymore now we don't even need that one anymore oh perfect okay yeah and now now we are confused because we don't know why that doesn't work okay give me a second here uh you have an integral of oh yeah because you still have an iterable right so you still you have a list of funkies now so probably like you want to do this for each of your elements got it yeah four each yeah look at you you're a natural okay all right and this uh so now i get my i get to add my funk but we have a problem which is that my episodes don't implement the funky interface right can we make it is it is it going to break if i say implement funky these would be invalid then right because they don't have the required property well let's let's take a let's let's take it one step at a time right okay what do we want to do we want to have the podcast episode implement funky so let's go to the podcast episode does order of declaration matter like do i need to move this no fortunately it doesn't it's one of the beautiful things um so no what you actually do sorry uh so what you do is at the very end of the line you do colon funky so both inheritance and uh now it's math that's the other thing called composition so both uh both inheriting and implementing interfaces um works with the colon and column still same rules apply you can inherit only from one thing um yeah okay so now you have so yeah what's the problem with this one hover over yeah this hides the member of the super type funky because for all you know you may have already had funk in here right but it may have meant something completely different so now you gotta make it explicit that the funk you mean here comes from your interface you do that by just adding the override modifier again it i think it gives you like the little link if you just press add override modifier so okay i do command shift enter i mean you could just either you can just click the blue link or once again that's cool okay yeah and and it shows you the next thing it's like oh it's a it's a val property but we said we want to be able to change this so it needs to be a var property so we change it to var so i just basically you you option shift c option shift enter your way to victory with kotlin is is what you're seeing here and now all this code is red you see all the you all see all the little brackets that are red and you see like in the in the right sidebar you see the three little like red icons uh-huh uh well why is that while you didn't pass a parameter but we're not gonna we're not gonna pass that every single time because by default nothing is funky right so we can just provide a default parameter so you just do that by saying equals false okay all right so let's expand this so we can see what's happening here so we've got our our by the way you could once again just press alt enter and say put arguments in separate lines i believe put parameters how you kind of yeah yep that makes it a little bit more narrow much much easier to read then um and so now yeah we've got our our title id funk and funk you are you are not funky by default it implements the interface of funky and now we can put these together safely so so we can see this is also very nice that it does this type type checker says it's all good man all right let's save it and now we probably want to do we want to well first of all we want to actually make sure that this is actually the thing right we want to be able to print the funkiness so probably want to add that to the list so let's add funk and yeah there's no return type that's got a problem yep to string or does it two-string itself uh if you have it inside one of these fancy template literals it's gonna to string itself needs to be it oh yeah not is uh and also we forgot the thing because the right now we have like a call chain but we're trying to add funk to like that doesn't return anything right am i returning that probably wants to return the same iterable again like that wow i think now okay i think we're gonna run into some some funky generics in a second but we'll see well and now we just need to return this again so just say return this uh return yep okay okay and now it's still broken why is it still broken great question well if we scroll down we'll see that well what do we get back we get an it dot func we get something back that is that just implements the funky interface at this point we have lost the information that uh that were still episodes right because all we say is like we only return something that has a property called funk [Music] okay that works you gonna do the thing no it doesn't like that unresolved reference uh oh because i i'm just wrong that's just me being bad at this uh okay i don't see any errors anymore yeah this is looking good give it a give it a moment to think about it okay so that did what we want now uh now i want an if statement so if uh its id is 199 we'll do it funk equals false else i'm making some assumptions here yeah it's all good you see this like tiny little shadow in the background yep it is not redundant if statement what does that mean redundant if statement let's hit the button and see what happens what yeah magically we we understand your code probably better than you do clearly all right so then i'm going to drop this filter and instead what we should see is that we should see true false true here if we do that so one of the things that we're also working on with the new compiler by the way is speeding up the the iteration speed or like this re-compilation speed which is going to take a bit look at it go okay poor episode 199 not funky that's well that was that was on or it was just me by myself there's there's zero chance that was gonna be funky i see actually a question as someone who is not a native english speaker is is funky generally a good connotation or a bad connotation because i know something can smell funky that's usually not a good thing but i think generally like if music's funky that's pretty good right yeah i think it's it's like funky funky dances is really what we're what we're thinking about here okay that sounds great that's that that's what i had in my mind as well so cool yeah um so i i think we've had a had one question in the in the chat which was about immutability because they were asking like if i have i don't i don't like vars i just like vowels uh and the answer to that is uh we we have we have a fancy function if you if you go up to your uh your podcast episode again um and you annotate this class with the data keyboard so you call it data class just the very beginning and then we go back into our um our main sorry our our funky loop we can rewrite this to be actually let's also make sure that the the the funky interface uh is now val we're gonna we're gonna rewrite this into immutability does that make sense yeah let's do it okay so at this point at this point oh i'm sorry you need to change it into a val up there as well exactly can i take out the default uh you can but you don't i'm not sure if you want to let's let's keep it in there for now okay so let's let's go back to the the little red squiggly that you can see the in the right scroll bar exactly so now it says well we can't assign we can we can't reassign wow so now okay so now we're immutable so immutability clearly means we need to switch from a 4-h to a map that makes sense right [Music] and now we kind of need to create copies of yeah that's good good moves look at you no but i'm still wrong yeah it is still wrong but that's fine because now we get a so we get a podcast episode and if you just type it inside and then so we want to create a copy so what do we do is we say dot copy and copy takes a bunch of arguments all of which are optional so we can just and we can use named arguments we can just say funk equals yep and then we say we we put that argument in there oh yeah we want this one though exactly boom just like now it's and now it's happy again yeah and i can i can do you one better okay you see you see how our whole function is just one statement go on the return press alt enter convert to expression body uh press the delete key once and now well it's still a bit wide but now you can see that we're instead of writing a body for the function right we're just saying this function is this expression that follows oh interesting yeah that's that's slick okay i get it that's really nice so so that would take a little yeah so this is like a shorthand function and uh get mapping in my head right so whenever whenever you have a function that's only a single statement which often you do because often you're just aliasing things or wiring up parameters or whatever you can just say that function and then equals the other statement that it represents and you don't even need to do the whole body you return shenanigan and you can even say uh see that it in enforced the um the type again so the list of podcasts episode it still says there yeah yeah again some people don't like this because it generates a lot of text right but i i mean i love it because this always gives me the confidence that my idea understands what i'm doing like i would agree i i think seeing like seeing what you have passed in because you know at the end of the day no matter how no matter how much we all think that we're geniuses computers are going to understand the code better than we do they they interpret it so having the computer tell you what you actually did is this is going to save me a lot of heartache right of not you know because i feel like many of the bugs that i've spent the most time on aren't obvious bugs they're bugs where i you know i i was one level higher lower in the scope than i needed to be or i thought i was doing one thing and i was actually operating on like the original type not the the modified type or or something like that so this this is definitely the sort of thing that can help me kind of save me from myself a little bit here yeah yeah no absolutely because at the end of the day it's also not only that the compiler or that the computer understands our programs better better it's the interpretation of the computer that what is the one that matters right if we mean one thing and the computer understands another it's just gonna explode we don't really have a say in it so me seeing kind of the the the compiler as like a co-pilot who who constantly tells me like okay now you're in the scope now you have this kind of thing and by the way after we turned this on i'm not sure if you actually noticed but you can see the implicit scopes of our domain specific language you can see that if you are inside a p tag for example that you have an implicit this which is a p and that if you are in a div you have a this that's a that's a div right and because these also define the functions that you're allowed that you would be allowed to call like on an a you can add an href on a p you can't because that that doesn't make sense right right so that's pretty slick all right yeah well so we uh we've got about 10 minutes left so is there anything that you want uh that you want to make sure we cover before we start doing doing links and and all that good stuff it's a good question let me think for a second um i mean we can open a a react project with carl and js just for a moment and just look at the the default of what that generates yeah let's do it though so i'm gonna save this and so let's create a new don't worry by the way intellij always auto saves constantly for you oh that's nice and and there's a and now of course the question is like oh but what if i did made a mistake you also have something called local history which is like a git history but it's like all the changes you made over the last like hour um even if you didn't check them in saves that also saves a lot of uh bots let me tell you that's really nice okay so i've i've created a project called kotlin.js react i'm choosing react application the the same jdk that we had before also i'm going to save that and then we'll go here i'm not going to take whatever you want yeah i'm going to skip all these because we we aren't really going to be building anything we're just going to be looking at it so let's finish and let's open a new window all right so inside here we've got and you see here where it's doing the gradle build that's that's the stuff that i was talking about earlier so this is all happening in the background um so we've got our client.kt which let's see so we get into render document in window [Music] and we get the element by root class column js all right and let's look at react okay so in here we've got react uh builder component prop state div and input um all right so we're specifying welcome props so this is like a prop types exactly then we've got state our state okay js export is so that we can do like an export as a named class of welcome so i can import welcome from whatever yeah so js expert is so so that uh react which is an inherently javascript framework understands that this is a is a component right okay yeah that's kind of the interop surface a little bit got my init we're going to drop in the welcome state with the props which come in from here yeah construct the argument exactly then we're going to override because this implements the component interface all right and then we use the render function and the render function is going to return a div with an input some values on change okay i get it i follow this yeah and you can kind of see again like it's like right like sorry it's react right so again in the in the div we have a hello with just we reference directly the state dot name we don't do any kind of funky binding or whatever it's all like reactive from the get-go so if you actually if you stop the development server in the other project um you can kick off this one um yeah either is fine browser development mode is just a bit faster that's the trade-off between file size and compilation speed [Music] by the way i just realized that this is all class-based components which i'm not sure how you feel about those but we also have support for hooks um excellent i was going to ask unfortunately we don't have time so this could potentially be a follow-up episode too to just do some react in collin js i think that could be fun um so let me reload this there it is i think we also should do an episode on webstorm actually now thinking about it because it seems like there's a a lot of stuff that people could could learn from just you know getting getting to know an uh development environment a little bit better absolutely yeah even if they're typescript yeah so yeah i think this is yeah this is great um i think there's some you know there's a lot of potential in this and i can see the the benefits of of the type safety i can see the benefits of how this would you know once you get the hang of the syntax this feels like a pretty well defined way to to go about this um so i i definitely see the appeal i'm i'm i i'm gonna say i'm i'm cautiously cautiously sold on this i think it's uh it's a good thing to to kind of dig into um so for somebody who wants to to take this to the next level they want to dig in further where would you recommend somebody goes if they want to learn more about kotlin and colin.js so i think a great entry point first of all well it's just kotling.org right that's just kind of where where the whole story starts but one link which i think we should make about ten times bigger and in like comic sans red on white background or something uh is the play button on the on the top right so if you click on that one uh first of all you get an ide like right in your web browsers you can just start typing right away uh which is a absolute masterpiece unfortunately you don't get as much of of assistance as you get in the local ide but you can do that and it is going to work hopefully yeah nice um but more important are uh the other three tabs we have at the top there so i usually recommend people who have programming experience to start with our like our cooans or our cones i'm not sure how those are actually be to be pronounced at the very right um and these are kind of like small self-contained samples slash challenges that each introduce a single kotlin uh concept anything from classes to functions uh to extending to scope to whatever so you can like you can go through these i think you can also like save your progress as you go through them um and you can kind of get like an overview so it gives you like a small challenge it tells you like where to look in the docs and you can kind of go from there yeah if you are a newbie beginner programmer um then i would recommend the book atomic kotlin which was written by one of my colleagues sveta zakova together with bruce eckel i think the first couple of chapters may be also free online i'm not sure here it is yeah this is the one exactly all right um and apart from that if you want to dive deeper into things on play.kotlin.org we have the hands-on labs which is one of the other tabs um where you can find things like building web applications with react and kotlin js or creating http apis all kinds of things right not just call and js but colin all over the place i think there's some stuff on mobile there as well um a bunch of different topics yeah okay great apart from that i think the only thing like our marketing department would kill me if i didn't shout it out you can go to youtube.com kotlin um which is our youtube channel that we started like four months ago five months ago um so if you have not seen enough of my face yet i'm there on like 20 different videos at least um yeah and we have videos about the the recent updates but we also i actually have a show called standard library safari where i take people through each uh each kind of subsection of the standard library we talk about lists maps sets and all the cool stuff that you might not know from other languages so kind of really like diving deeper into this nice very cool all right so uh with that everyone make sure you go follow yeah check it out on youtube uh go go follow sebastian on twitter um and remember you have been able to uh to follow along let's see where are the oh no i lost the captions again okay i'm not gonna look that up again but uh the captions have been with us i i apologize for breaking the website um the uh we've had rachel with us all day from wyco captioning and that is made possible by netlify fauna auth0 and hasura who are all kicking in to make the show more accessible uh while you're checking out the site make sure you go and look at the schedule we've got some really good stuff coming up rob sutter is going to show us how to do some cool things in fauna uh it's been a while since we talked about fauna and then we're going to have mark erickson here to talk about modern redux so we're going to look at redux toolkit uh which he says is a a big leap forward from if you if you wrote redux years ago uh the difference is is stark i've heard a lot of people saying good things i haven't seen it yet so i'm really looking forward to checking it out we've got even more coming up i've got a bunch of these that i need to get up on the website that i haven't done yet so maybe i'll fix the website and update the schedule all at the same time you can always get notified of new episodes by clicking this add-on google calendar button i would like to uh have you click that it is fun um you can also follow on twitch to get notified when we go live make sure you leave the subscription bell thing on so okay let me just do smash that like button and ring that bell um okay thanks y'all so with that we're gonna go find somebody to raid thank you so much for hanging out thank you sebby so much for teaching us today we will see you all next time see you everyone you
Info
Channel: Learn With Jason
Views: 2,536
Rating: undefined out of 5
Keywords: Apps, JS, JavaScript, Kotlin, Kotlin/JS, Learn With Jason, Sebastian Aigner, Typesafe
Id: _kM9Y6C0iRI
Channel Id: undefined
Length: 90min 25sec (5425 seconds)
Published: Fri May 21 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.