 This is I'm gonna I'm gonna give you a piece of advice before I start if you ever want to make a talk or submit a talk for RubyConf Do not submit a talk for something that you either have never done or It's very unlikely you'll do by the time RubyConf gets around because that's kind of just kill you when it like with the whole imposter syndrome thing Like I was up really late like Freaking out yesterday, but to deal with that because I have a bunch of people and I can I can like Suede you I brought chocolates So if you if you hate this talk, you can come to me afterwards I can give you chocolate and you'll feel awesome about this talk and like actually showing up and Oh, yes. Okay, so there's two types. There's French chocolates, which will go amazing with the coffee over there And there's Icelandic chocolate and the brand I wish we had like the brand is called omnum I'm not shitting you. This is the brand Just for that go to Iceland because it's totally worth it Also, if you ask me a good question, I might throw a chop so this talk is called polishing Ruby and the subtitle kind of hinting at the idea of what I mean by polishing Ruby The idea is to basically together even if you're someone who's not confident We're gonna kind of go through kind of like my experience not being confident with Ruby And the question I want to ask every single one of you in this room is Why are you here? It feels great and technique like practice this thing, but it's actually hard to manage So the the idea is like why are you here at RubyConf sitting there listening to people talk about Ruby? It's probably because some at some level you kind of care about Ruby. I hope In what I want you like what I want to try to exercise with you is to prove that if you do care about Ruby You should maybe try to think about a finding a way to leave it better than how you found it Maybe a few years ago or maybe just now if you have any ideas Nobody's asking you to change the world We're not asking you to the the revolutionize the garbage collector like that's not your job necessarily there's someone who's really good at that but you can add to it so you can You can add to it in a meaningful way, and I don't mean like that Like don't do that. It's just like plus ones on repos and stuff like that That's not necessarily how you add to it But you can add to it by just a little bit changing it and not not changing it But adding something without meaning to like you don't want to change everything that's ever happened So just you know think the world as it is right now and just increase the the coolness of it by a little bit My name is Olivier. This is how you say that oh leave me yay, and you feel happy at the end I am not a Satanist For real I promise you this is the show Silicon Valley You don't have to watch this but everybody on Twitter is like super super excited about telling me how much I look like this guy But I am not a Satanist, and I really hope I don't get smitten. Is that how you smoten? How do you how do you conjugate this? smiten Smoten see there you go. We have a we're gonna talk about language. So I Worked for code school, and so we teach people a bunch of things like Ruby rails So if you like these things we have amazing stickers There's Katie and Joel over here that have a bunch of really awesome stickers We don't have shirts anymore sadly and recently I worked on making an API for an iOS app And I had made APIs before but not APIs that would Create a lot of havoc if they didn't work So I made it with Ruby, and I made it with rails and crazily I didn't wrote tests for it Thank you not test-driven The reason I wrote test because what if someone Especially me changes the API later, and it breaks the app, and I don't realize it until someone just says like It's not loading the right thing. So I was really really scared of this Just like I was scared that I would forget my pants this morning like this is the worst fears So I thought okay, let's write some integration tests, and then we can go have ice cream now Liberate you you can go have lunch so given a user if I ask the user API for something I should receive information about data about this user So something like this you have a user that you create with a factory or a fixture you Call the user API for that only user that exists because you just made it and then you parse that response And then with our spec if you use our spec you can do Expect data to include the name Olivier, which is my name super still hard to pronounce So our spec says that's awesome. That works. This is cool. Let's go have ice cream and Then I just had this moment when I was building this API was like can I do that in Ruby? Can I ask a hash do you include another hash for chance? Let's try so you take the same response. That's an object. That's been parsed and you ask I don't know the first thing that came to mind because of our spec was Maybe blame our spec was include. Okay, so do you include this other hash? that's You know similar and no it doesn't because that's not what This method is for so our spec is neat and it kind of like gets what I want to do but and So he has this match or called include right there and I was wondering okay So if there's a thing called include in our spec and I think I'll include in Ruby or for the hash include What's the difference there? Like what is this? Include match or doing that the include method is not doing or am I misunderstanding this whole thing? So I just looked into it So there's this matcher and inside of it It's checking when it when you're doing a match on a hash it's checking to see if you're comparing the hash with a subset And then internally so it does this thing and then it checks whether the two things that you're comparing our hash And then if you're a hash, and I'm a hash, let's dance you we're gonna actually compare things And I'll tell you if it's true or not if you are included in the other thing It's really good. And actually after that it does an actual Hash include so it's actually it does the simple thing that Ruby does With a key and a value that's great and only the only thing is that yeah It's very simple. It just does the the the check there and As long as your value for this key is the same as my value for this key It's gonna be true which is for my API I really want to make sure that These keys and values match and not just the keys and not just the values on one side and I'm lazy So I wanted to work that way and it makes sense so warning though This only works for one level you can't have a nested hash in our spec It won't work or figure out like where in the nested hash. It's gonna be back. So back to hash. How does Hash include work because it doesn't work how I somehow thought it would work It's not as neat as our spec, but it's it's still kind of cool. It makes sense So you have a hash a true be false another hash a true and you ask The first hash whether it includes why and it's gonna say false Because it's basically has key so it's not checking for anything fancy inside of your hash or whether it includes it or not It's an alias to all these things are the same actually It's include has key member key if you don't like the has thing That's actually how it's named and see Ruby, but I Find that weird, but I don't know this much about Ruby. I can't really have crazy opinions turns out we value keys over values nobody Poor values are going to feel devalued at the end of the day So they kind of like okay, so I made me grasp for this this thing because we like rules So like if a necessary feature has a high astonishment factor It may be necessary to redesign the feature, but then Can't ask the Ruby core team to redesign a feature because it brubs me the wrong way Probably a terrible idea. So is hash include astonishing if I compare it to say string include Which words the way I expect it because I'm lucky it you know if you ask it for the same string It's a substring of itself. So this is totally fine. If but if you do that on array include It's not gonna work exactly the same way either you can't ask An array if it contains itself so It's it's a little astonishing to me, but just to me probably so I tweeted about it because that's the first thing That happens when I have a thought. I just put it on Twitter If you follow me, I'm sorry So I said, okay, I don't understand why it works that way And it's a little as to key when it should check for a sub hash in my mind. It should check for a sub hash just linguistically probably not an adverb but So maybe I can do something about it So I thought about okay, so I'm gonna write down what I mean and not just in a tweet so that other people can tell Me this is completely crazy stop now and they did that was awesome So passion honestly was like yeah, no, I expect a key check Not what you think and Terrence was like no, please don't do this and everybody else So Mike fix it my my first lesson doing this like a little deep dive was my expectations and surprises are not necessarily universal like What surprises me as someone who's not coming from computer science because I'm not are different from what language implementers and people come from computer science expect and And also nobody wants to break the API. So like that's a thing like very important thing If you're ever gonna try to do something with Ruby don't do things that break API's because that's just no But then I got some some hope from Pat He was like hey, what about a new method name maybe and that was like, okay Yes, maybe I can do something. Maybe I can have this thing and maybe it makes sense and other people are gonna agree So that's the simple question. I want to ask is does this hash contain this other hash? So maybe it should be called hash contain That seems to make sense and a bunch of people agreed So this is how we work pretty much exactly the same as the original one Wouldn't that be nice? Or it could be sub hash I think a bunch of people were when we were talking we're like this is kind of like the subset method on the set Which is kind of cool. It checks for that and then while we were talking about this and I'm just talking to just a few people Just like make sure I'm not completely insane This happens this person thanks to Terence actually Before I'm even done like figuring out if the name actually makes sense. No, we made a patch like I Don't even understand how that works like I knew he was called patch monster, but I shit you're not I just wrote a gist and a blog post and he had a patch for it Yes, you had to talk to him, but that's still kind of crazy. You just mentioned it, right mentioned it in passing This is the patch. It's on github. He just put it up on github and what's awesome about this patch is that if you are like me Completely illiterate when it comes to see you can see well you can't see on this slide because it's a lot of a lot of more But this is actually not a big patch. It's like 20 lines something like that 20 30 lines and there's just very simple things going on and you realize that's the thing I'm dreaming of Can be real without that much crazy effort and that's kind of Feels awesome. So thank you. No, boo. I don't know if you hear someone the hallway Holy shit, thank you So that's So you don't need to know see to contribute to Ruby It's good to be aware of it like like I am now because of the way I've seen how he's implemented that patch And also there are many good humans like him like him like him. So that's Terence sack And and so many others that will help you even when you're fumbling and you're really Your argument's not solid yet because it's totally not solid. So what now? So this is the second part of the talk. This is the part where actionable things are discussed So I'm sorry with the boring like stuff now. It's getting in the serious stuff So the second part is bugs.rubylang.org like just like memorize that as a litany You're just you're just gonna have to go there. This is the Ruby issue tracking system It's a little verbose and not the best CSS That you'll ever see And there's a lot of wikis and they're a little messy, but they're really really really helpful One of the most helpful ones is these this little four developers one and there's this thing called how to request features so if you're if you're a pedantic crazy ambitious and OCD then you're probably one of those people who are going to think oh I can add something So whether the first thing that you have to think about is is this thing that I want to add to Ruby a meaningful Improvement that's kind of a vague thing, but here's how I broke it down before my thing To iterate over a hash you had to iterate over a hash or use the side effect of another method The merge method hash merge to achieve the expected result that I that I expected so like make sure that are you inside of you after you can ask a hash if it contains another hash and it's just going to tell you and It's expressive. It's not surprising. It makes sense Now the second criteria is is this a new request? So is this something that someone's? Actually submitted before could you please look so that you don't repeat the same thing that somebody's already asked and we turned them down And there was a good reason so I searched and I found 11 results for this weird query that I had And there was there was actually one pretty pretty similar feature of West to extend hash include in order to be able to I think check for I think past multiple arguments or something like that. It was it was Basic as you could path. Okay, two arguments a key and a value and the way it was done was interesting It wasn't actually breaking the API. She's kind of cool, which is the thing that would actually prevent people from going But it's not exactly what I wanted to do and it's not exactly the same scope or use case So I think like that's this will work out and the issue was a year old and hasn't been followed upon After people from the core team like ask a bunch of you know questions other people were like Can you clarify this and that so the third criteria is can it be done any other way? So if there's a way so I told you about hash merge and that's a way to achieve the same result And that's how I implemented my thing originally in Ruby, but just okay. How can I hack this in Ruby? Yes, it exists. It's either verbose Or if you loop over the hash or it's an expressive because why would you merge a hash to figure out? It's just doesn't make sense. It's like you have to take a detour Then there's also would it benefit many people so I thought okay I found this method this include method in our spec and this this is where the could the idea of it came around What about our spec like how many people use our spec a lot of people Like 20 21 million downloads for all versions and then like half a million for this version Which is kind of crazy and that's just the aspect expectation gem which gets included in our spec So it seems like it could benefit people because people are using it and expecting it to work at least in this library Is it a good name? Well, if you ask the question does a hash contain another hash and the method is called hash contain I think it's a good name now of course like Of course there's people who might disagree But I think so Now what does the method accept as arguments a hash? What is the return value a Boolean? Are there any risks of incompatibility? No, because it's a brand new method and I'm not actually changing anything existing I think I think that's fine. And then finally one of the criteria is right write it down So this was the implementation that I mentioned This was my super naive implementation that just did the merges as a side effect of the merge You could figure out whether it's included or not But of course no boost patch is better probably faster and Finally you have to make a concise But complete proposal which is the part that I think is the most terrifying because You've formulated these ideas maybe on Twitter or two friends or two people at conferences. You're like, you'll be great Was like that and then you actually have to do this thing So you have to go to the issue tracker and you have to fill out. Oh, I have a laser. I forgot Mine is red Yeah, you this is a very important part. There's a thing in English. You don't have to know Japanese to Submit an issue. This has been going on for a while But there's still people who don't understand this and they're still worried about that to submit their issue The only important thing of that is that in your description or in your explanation of your request You include code that makes it explicit to anybody involved what you're talking about which is exactly what I'm not doing here So don't do that And then I think the other thing that I did was yeah Make sure the title is it is clear and you're not just rambling in the title so I think I try to make it as clear as possible use this to check whether something contains a hash and That's about it. This is not a finished thing. I actually haven't done this it's in my browser right now and I think I might actually submit it at the end of this talk if if nobody like tries to tackle me in the meantime So I'm still working on it and finally the final thing finally the final thing. Yeah Follow through so you remember the thing I mentioned where someone had open an issue similar like that So a few people gave feedback, but they the author of the future request didn't really come back to say oh, okay Sure, I'll I'll change this thing this request to assess for that So following through making sure you're responding when people actually take the time especially from the court team to respond to you is very important So I will do that. I promise So I'm gonna rewind really quick to the first step Because I have opinions and you're not necessarily someone like me who just like finds a thing and I'm like But you can find an inspiration in other people's feature requests if you if you're not like if you now have a strong will to change things or if you're just trying to learn how the Things work in this issue tracker. So for instance, you can take Aaron Patterson's feature requests for I think time elapsed Yeah How he phrased it how he titled it the code that he included in there that might be meaningful to you Charles Nutter you could see how he made his own feature request So those are people that are familiar with the process and to see how they do it when they're in familiar waters May make you feel better about your feature request because you'll be like well mine has the same amount of detail. So Then there's documentation patches. So Zzak is right here Zachary Scott and There's this really great project the Ruby documentation project and in there They're actually great steps for you if that seems like a crazy jump for you to just be a Ruby user and then change Ruby and add something to it You can make it better Documented so and I love this sentence by the way. This was right. This is like waiting for me Existing documentation could use some polish Exactly in form and in form of clearer descriptions and better examples examples being the things like there's a lot of really Quick sentences in the documentations, but not a lot of examples that are so it's a great place to start if you If you if you don't know where to start if you're kind of intimidated There's a lot of really nice step-by-step guides on on the site and also Zack may face mush you if if you do it because he'll be super happy and So yeah, there's that little getting set up thing that actually is useful not just for documentation patches because I learned a lot from that to fork Ruby which is on GitHub now and you know have it locally Etc. Then there's accepted features and it's something that Zack mentioned to me yesterday on the Ruby tracker There's a custom query in the sidebar that you can click on that shows you the accepted features for the current major branch I guess and In there you could see the things that need action and there's quite a few of them. They're not assigned. So I don't know if Right. So those are need need to be assigned There's already a ton of them already assigned so and the ones that are not assigned. There's 159 so that's quite Quite enough for you to chew on and of course there are bugs So the problem with bugs is that there are many people responsible for things in the Ruby core team So I don't know if it's probably Something a little more hairy to look at maybe a good place to learn how people report bugs So these are the unassigned bugs that you can also find in the Ruby tracker it sounds as fun, but Fixing or learning or understanding bugs will probably help you kind of like get Situated and of course remember that although I spent a lot of time talking about feature requests because I was excited They're a tougher sell because you're adding things that people are going to have to maintain for you inside the Ruby core team If you don't join the Ruby core team that means somebody else is gonna have to maintain this thing that you were like I'm super excited about this This is the greatest idea ever and and then you just go and you never touch it and never fix it ever again And they have to deal with it. So empathize with them and realize that somebody has to pick up your stuff Speaking of maintainers There's a really cool list of maintainers that you can find either on the wiki of that issue tracker or on the actual source Inside of Ruby doc you can find So there's one thing that I noticed that they might be I don't know. They might be different lists I'm not sure if they're like right What's nice about this list is that you'd find who's responsible for what in the Ruby core team And also the other libraries that are not necessarily like standard Lib and stuff like that so if you if you have a features proposal say for Ostrac and You think that it should work better if you had a say in it You can go talk to Mark Andre and like find him on Twitter or find him somewhere and just talk to him Or you can find someone that actually knows about This domain and this thing or has dealt with it before so go talk to maintainers if you can Before you do your In a roundabout way, that's what I had the luck of doing through Terence Should go talk to Terence The and remember that the core team is is pretty damn busy So if you can save them work by just talking to a human a proxy of them or people who are Knowledgeable on this topic that you've seen a blog post from or something like that Running your idea by them or running your suggestion by them will save basically just distribute the load and help you get comfortable And to get comfortable. There's also a bunch of resources There's this really cool block was that came out last week by PJ Haggerty about so you decided to contribute to Ruby Which is like perfect. It's like exactly the place to go after this talk if you want to learn more there's Terence's amazing talk Ruby and you in which he talks about a lot of the similar things a lot of security things and how the process works and There's this site called Omni ref that Tim Robertson over there puts up so if you if you're it's super intimidated by see the same way that I am you are not alone and This is a great place to go because he's annotated a bunch of the the trickiest part of the Ruby library and other people have to you can discuss little things You can ask questions to people about specific parts of the end just last week. Somebody was I think reviewing the symbol symbol stuff in Ruby and figured out that there was kind of a performance issue there or something that was weird about it and Then Matt's found out about it and this was fixed. I think within what a week or something like that after that Right symbol comparison so just because someone so someone I don't know I don't know their name sadly. I feel bad looked at this with a new set of eyes and was like Why is it like this and I'm not suggesting that everybody go around like poke at everything in Ruby and says like Why is it like this? Why is it like this? But this person managed to improve the performance of Ruby just by looking at a thing with a brand new set of eyes So you're not alone and to prove that point if you've never contributed anything I made a survey yesterday, and if you haven't taken it yet, I would love you to take it And this is basically there's a few questions about your experience as a Ruby developer If you're paid if you have written a blog post and things like that, but really the core of it is this thing If you are intimidated by the idea of contributing to Ruby, why are you intimidated? So there's I don't know where to start which I hope I kind of like to reduce the little bit I don't know see which is not necessarily a problem. Even though that's one of the the biggest things People will figure out. I don't know what I'm doing, which is exactly my problem. That's why it's checked And other things like breaking other people's stuff So and the results are really cool So this was just just five minutes before the talk 128 people submitted Answers to this so what 41% of them were over five years They've been using Ruby over five years ago But that it's kind of like you know a nice little even split between three four and one year ago and more importantly The breakdown of the reason why people are terrified of contributing to Ruby is really cool. I don't know where to start Not anymore There's also I don't have time to work on this Which is a really good reason in which case when you're at a conference Maybe that's the space to kind of like talk about that you have people around there They can help you make it faster and easier for you and save time on the ramp. I Don't know see talked about that also not another big deal So really basically the big three reasons why people don't come like feel comfortable contributing back to Ruby are fixable So let's fix them and if if you haven't so like I said if I you haven't submitted to this little survey I think it's really cool to have a sense for why people are not doing something So please do that's kind of a weird URL, but hopefully you can snap it and see it and go there So to to conclude with like grandiose talks and and ideas Science needs to meet reality at some point before it becomes technology and that's where you come in you There's the people who create something who theorize about something conceptually and then there's the real thing when you're using it and Your point of view matters every single one person that uses Ruby your point of view matters and how you feel about things or You know how you're excited or not so excited about certain features actually matters and your help is needed. It's not It's not useless at all so We have a more diverse community and it's getting more diverse and the more diverse it becomes the better things can be challenged by Perspectives that are not exactly the same And that's how we make progress. So Let's make this Ruby sparkle and thank you for caring. That's it