I used Elm in production and it cost me my job – Annaia Berry

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

This is pretty technical but I thought it was hilarious (Lisp devs are lazy) and it touches on problems with capitalism in the programming ecosystem so here you go.

👍︎︎ 2 👤︎︎ u/ViviCetus 📅︎︎ Aug 09 2020 🗫︎ replies
Captions
so I'm my name is Ania I am currently working at future ice and today I'm gonna tell you a little bit of a story about working with Elm but because this is a story we're gonna start with a little background so this is a spectacular example right here because the name of this slide is called the web is buggy and there's supposed to be a picture right there and it's not loading and I'm not really sure why but point made so enter Elm fewer functional web development for the rest of us it's easy to learn it's easy to use most of the developers that I worked with on my last project had never touched it before and we're able to get productive in like a week despite it being all pure functional ish and you know and the error messages are very helpful it's very easy to understand and sort of get started with and the documentation does a very good job of sort of introducing how you actually get real stuff done with it right off the bat so it's nice for that we also have the elm architecture nice boring serious diagram the basic idea is you have this model and we create the model which is sort of the data state structure of the data state of our application this model gets passed to a view function that you create that then takes the model output some HTML essentially as a side effect and then returns a message which then goes to through the Elm runtime and into our update which then again makes a new model and we go around and around in a big circle this used to be called functional reactive programming but we don't use that anymore because it confused people and now you have C sharp developers claiming they do function reactive programming and it makes no sense it is super trendy because Facebook tried it unfortunately the result was react and we all know what that's like the other nice thing about Elam is we have immutable types just like in closure we have immutable data structures there is no mutation of any kind whatsoever you don't you don't you don't need it you don't have it you don't get it and it's not allowed and you have a very nice sort of ML style type system so it's it's fairly expressive you can do a lot of stuff and it has that wonderful type inference so you don't have to worry about making sure everything's typed you can kind of just start writing and then write the type notations later once you figure out how it works so then you kind of get no bugs because unless you have a logic error the type system if it compiles it probably works it's very efficient rapid application development the dream of the 90s is alive in elm these slides this entire slideshow of the actual software framework for this is written entirely in elm it took me about a day of work and the code is up on glitch comm you can take a look at that later but generally speaking I find it's very quick to get up and running with new elm code or extending existing elm code because it's functional so it's very expressive and the type system kind of helps you along without spending a lot of time debugging its enterprise approved big companies are using this Microsoft even has a single open-source library in elm hosted from their account I settled a link and yeah there's a bunch of startups and so you know it's it's it's still cool so the big project it's confidential I can't tell you where it is or who it's for exactly because NDA's and stuff and also I kind of forgot to clear it before I did this talk so content management app for major news organs of readers a day essentially they have a back end in Scala and a front end in Scala and and this content repo and then the the people who write the stuff have this awful third party XML tool that they have to write everything in and then manage like what pages show up on which page and stories show up in which pages so we wrote for them an L map instead to do at least some of the hard part for us twenty-seven thousand lines of elm this is a good example actually of how expressive it is twenty seven thousand lines of elm ten thousand lines of JavaScript that JavaScript basically does nothing but gives us drag-and-drop support and that's technically not even required anymore because now elm has drag-and-drop support in the standard library and six Kaela six thousand lines of Scala on the back end but that's technically fudging the numbers because that's only just a simple proxy to the real back-end which is an enormous monolith of terrifying proportions that nearly drove me insane so impressive upside III I was talking with my co-workers the other day and that we know of it never has gone down in eight months working on this project we had maybe two to four support instances all of them where with either the Java Script drag-and-drop code or they were some weird race condition with the Scala back-end it just runs and runs and runs and runs we had a giant collapse where half of our infrastructure went down overnight because some idiot in Amsterdam deleted a data cluster and it still kept working it didn't have any data but it still kept working so I lost my job so there's this problem that happens is that Elm is so stable and was so quick to develop for that there was no reason to keep me around to keep maintaining it there's no work for me because it never breaks and whenever I get a new feature request it takes me a week to do and then it's like well now what do I do so I don't work on this project anymore and that makes me think so I'm old I started developing professionally only about three or four years ago but I had been developing you know I started before that I started when I was a kid back in the 90s and back in the 90s it was still kind of a thing that you measured the productivity of your programmers by how many lines of code they could crank out incidentally my secret theory is that this is how Java became successful because if it takes you 2,000 lines to print HelloWorld then you look very very productive and conversely at the time there's sort of a legend about illicit azar really haze lazy management hates lists des because Oh what does he do he comes in he sits around and just like thinks for four hours writes ten lines of code and then he clocks out and goes and has a beer that's not productivity and now we have this this functional programming is taking over the world it's everywhere even languages that aren't functional Java has like lambda functions now what the hell is Visual Basic has anonymous functions I am not making this up you can look it up there's even also a free basic compiler which is a version of the old DOS quick basic that also supports first-class functions and then you add on to that we're starting to realize that types can be good if you just do them the right way like ml languages do and make them fun and easy to use so now we're getting super super productive and we can do all this amazing stuff in no time at all and oh it's capitalism so that becomes a problem and I'm a literal economic problem so if I'm a developer consultant I'm a Java consultant I go to a client the client wants a thing built I tell them oh that's gonna take us like two years that's two years of billable hours now if I'm a closure consultant or an elm consultant I can go yeah but I can do the same thing in three months and that sounds really good to the client and it's a really big selling point but it's a problem for us because three months down the line now I got no more what to do so does capitalism actually does this economic system really reward efficiency is the most efficient one the one that us programmers us consultants us developers are actually getting a wort rewarded for I actually don't have an answer to this but so we're doomed what can we do aha I have a solution we'll make everything harder again breaking updates so some of you might have heard that Ellen 0.19 came out recently this is brilliant this is really great because now true story I'm currently in negotiations with that very same project to come back and update it to 0.19 even did this really so we break fundamental api's the the basic browser API itself has been rewritten some of the string functions have been rewritten time functions have been rewritten and and the best part is the Elm compiler technically 4.19 is 100% backwards incompatible if you have a library that has only that has only been written 4.18 it will not compile under 0.19 you have to update it dictate backend api's so one of the changes that went through in elm is we have a new time api evan has decided that the only correct way to do time is POSIX time and so therefore you no longer need api's to work with anything but POSIX time and if anyone has a problem with that his answer is basically well just write your own library and of course it's required to use that because that's that's all you got that III went looking through the code and the documentation for this links for instance there's an instance where it says oh to get the timezone of the browser go to browser dot F env and you click browser env and there is no browser env in the browser library confusing abstractions this was something we were actually pretty good at my project there's this thing that happens with front-end programming where you have to write a lot of things that all kind of look the same you're writing a lot of input boxes because it's HTML at the end of the day whatever we're writing has to be HTML and we write the same HTML a lot so we think well we'll abstract that and abstract that and now we have this abstraction that requires so many parameters that it's basically its own input tag except it's badly documented and no one knows how it works the other thing this fun was elmas you have this whole Model View update concept and each actual view in your application kind of needs parts of all of that so a really great way to slow yourself down is to then split all of those things into separate files so that simple changes require touching 20 different files in your program that's really handy and though functors for days we could just go way heavier type skip alum lets get pure script let's get Haskell let's make it really complicated so nobody can even touch the code unless they know what a lens is we could go for the Scala approach just object oriental the things I mean it's tried-and-true work for Java it works for everything else Hostel dev communities never answer any questions if you've got a slack ignore it it's it they should go on the IRC and see nothing but join and quit messages alienate contributors contributors have ideas about where your language or your library should go why do you need to listen to them that they're idiots they'd write it themselves if they could do it right never ever ever explain anything clearly you if they can understand how to do the thing it will take them less time to do the thing and now we're back in our problem again Elm isn't kind of very good at most of these unfortunately which is again why I don't have a job but at the end of the day we still have CSS and that will torture us until the end of days so to conclude programming is real hard economics is real dumb but I used to wash dishes before this so I mean it's good enough I regret nothing [Applause] and I guess do we have time for questions if anyone has any I can try to answer them I think yeah I think they need to try to ask question anyone yeah thank you for the talk I want to ask the question how can you use how to sell the Elm to the management and the hardcore react programmers well I think the thing with Elm is that for the most part the way it works is kind of already similar to reactive programming that they're used to once you understand the idea of writing declarative code that's more or less functional the transition at least that I've seen seems to be pretty straightforward the big thing that's different is you know being learning the ML syntax and I think Elm makes that a little bit easier than other ML languages by design in fact that was another one of the breaking changes in Elm 0.19 is you're now no longer allowed to make custom operators in Elm because Evans opinion is that this makes things more complicated and confusing and he's not entirely wrong the first time I saw the the operators for JSON parsing I it took me a little while to follow what the hell was even happening so opinions are mixed but I think in terms of the selling point to management it's like I said it is fast to develop for it is really stable that Elm thing is that that bit of elm code is the single most stable service that I worked with on that entire project for this huge company lots of other stuff broke all the time or had endless tickets in the JIRA board but that one just kind of comes along and doesn't does what it's supposed to do and I feel like that's like the talk says kind of the blessing in the curse thanks so they're kind of from the Oh camel talk what's the story about sharing like rich data structures with the back end unfortunately that's something that I haven't spent a lot of time with I don't know what solutions are out there because I was working with just Jason and rest because that's what we had we had a scholar backend and we serve Jason and some very clever Jason structures on top of that I very interested to know the answer to that question I know there are some people that are sort of using Elm with something like Haskell or Oh camel on the back end so you have sort of that whatever that big I buzzword isomorphism or something like that between the front end and back end but to be honest I don't know from my point of view the actually most fascinating thing about this was this programmer logic of whether to do good job or not and I've heard so many times the the the saying that that programmers are there to make themselves unnecessary and I don't think I ever saw it happen like like the simplest thing you do usually doesn't end up being kind of the solution like like it's very hard to get out of that but the worst worst thing is that the job of programmers is also to make other people's jobs and so kind of I I somehow somehow think that in modern times maybe everybody's job is to make most jobs and and that maybe also the job of elam if it's so good I haven't tried it I mean fully automated luxury space communism sign me up tomorrow let's make it happen I mean I think that actually you hit on something that is way bigger topic from this talk but it is a thing like programmers have come under the assumption that because we are the people that make the things that automate things we are safe from automation and I don't know is it gonna stay that way and how much of the work that keeps us all busy is stuff that are problems of our own creation that's the thing that I see and why Elm has worked for me in a way that you know other languages that make those same promises haven't necessarily done is Elm is very focused it makes web single page web applications that's what it does you can I don't even think you can try to do other things but it does it so well and works the first time that it died not over complicating it we over complicate everything as programmers we love it it just I love it I do it all the time I wrote monads in racket with a for-loop that's just ridiculous and there's no reason to do that but I did it because I'm a programmer and that's fun for me which is probably a sign of a mental illness yeah that partly answers my questions there with all the breaking changes in the hostile community would you still choose Elm if getting developers on board is not an issue or would you go for something like pure script I bounced off pure script for the same reason I bounced off Haskell what it doesn't do a very good job of presenting how to actually get my work done and I think despite the drama over point 19 I think mostly the changes are good changes obviously they've upset some people and the way it's handled is the consequence of the BF DL model is kind of sometimes the BF DL has an opinion that doesn't agree with some people and things get very unpleasant for a while but I think it could have been handled better maybe but was actually for all that it's been a big flame war on the internet he was handled better than a lot like in the Elm community that most of the libraries already that I need relied on and the projects that I've written to myself or this project we're already long since ported while it was still in beta because it was available for year several years I think so you know it was very well telegraphed ahead of time but you know and like some of the stuff that broke with stuff that people weren't supposed to be using in the first place there was a huge thread on Hacker News and and on reddit this blog post some guy like raving about how terrible em was and how mean the community was because they broke the native modules API the only problem was there is no native modules API it was just a bit of internal code that no whizzin was supposed to be using and so when it changed because that's what happens to undocumented api's they change they weren't document undocumented for a reason then everybody freaks out and it's like oh no you broke and everything but actually I think Evan did some statistics or something that it was something like 1% of elm packages even used that so I don't know it's it's it's a complicated question but I think in the end it's it was handled about as well as it could be for any breaking change thanks a good talk so now that you back in the game with the company that you're at the Elm front of front-end for have you tried billing them your development time up scaled by how much would take in Jay s instead I like did it work and I have the generous fortune of not having to worry about the numbers at my current job very much because it's a large consultancy and someone else does all the math but that is genuinely something somebody recommended to me pointed out to me when I was talking preparing for this talk is yeah yeah you know Java consultancy a charges X amount for and will take one year and conclusion Sultan CB will only take three months so just charge him the one year but they decided to live in one year as well well yeah you can always just take a lot of vacations it seems to be popular in Finland all right thanks a lot on our Barry [Applause]
Info
Channel: Metosin
Views: 96,766
Rating: 3.9912367 out of 5
Keywords: clojure, elm
Id: RFrKffrKCeU
Channel Id: undefined
Length: 23min 30sec (1410 seconds)
Published: Mon Sep 17 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.