Garden City Ruby 2014

Las partes malas de Ruby on Rails

Gautam Rege  · 

Presentación

[slideshare id=29681735&doc=presentation-slideshare-140104023803-phpapp01]

Vídeo

Transcripción

Extracto de la transcripción automática del vídeo realizada por YouTube.

all right good morning people after the bright talk this morning by a J it's time to get dark and dirty okay so i am from george software and started in 2007 these are my twitter handles and i am also an author i have a couple of books which are out well

it doesn't look so dark anymore does it so what is my pop going to be apart don't worry it's not going to be anything scary I love Ruby but as with every marriage and I hope there is no Ruby in the crowd okay as with every marriage you also need

to know the other side you know the side you were you didn't know when you are just going around but it's the same thing with Ruby you have to know what you're looking at and my talk is going to be about the weirdness and the gotcha moments in

short in my talk if you find aha moment it's working oh we have a varied audience today so to ensure sanity I have tagged my slides my slides are tagged with my good friend bumblebee to keep it neutral that these are the beginners so you must pay attention

and the experts try to give the beginners a chance to give the answer and the experts now take your inspiration from Optimus Prime and the beginners can choose to tune out but whatever you learn the better so let's get started with the infamous infinity

now we all know what infinity is right and since we are all programmers obviously we should know the answer to this one what's the answer no there's no surprise here no surprise is that now division by zero we know this what about what about this oops

this actually works so we know that you know everything in Ruby is an object so that looks like a that looks like a class so let's see what the hell that is anyway if you type this or what do you think I get so what's going on here so infinity is a

constant defined in the float class but do you see a their name you don't see there i can use this constant for range comparisons i can use it with equality operators and stuff like that imagine three equal to equal to infinity but it works oh well so

this is the way I get people warmed up let's do something with more of an adrenaline rush base conversions it's a lot of fun so what do you think is the output of this particular thing now I don't want all the math geeks going into your calculators

but the essence is converting a number to a string in the octal format so again no surprises should be fine but let us push the tempo now what that actually works so the next time you are reading about a new here name like get a fix why to statistics now obliques

astrix it need not be a name it could be a number well now what push the limits oops so now if you look at it logically the radix supports is supported only 36 because you have 26 alphabets and 10 digits so we can go only up to radix of 36 so if there are

some innovators out here who want to actually get a new alphabet into the English dictionary we could probably have a radix of 37 okay let's move on to the star not the rock star but the star operator and to start with let's see what it has to do with

the splat expander boy we see more and more for Ruby code right now so what do you think is name an occupation here as we can see we have a struct which takes which has to some things name and occupation and I create an object of a struct now what do we see

nothing France is to you still seems too good right so this plat expanders actually taken my argument and given me the right name and the right occupation but we don't do things like this to a B usually via rails programmers we work in rails so we usually

have stuff like this we use keyword arguments y'all of Yellow River few arguments using to initiate a class like this and stuff what is the output now the Optimus Prime so the experts what is name and occupation here it's changed that because the struct

always has an array of arguments it does not differentiate between this this will not work on a class well let's get to something more funny what about seeing this how many fell have used this before we know how to convert convert an array into a hash

however I use this notation before alrighty i have two people in the audience excellent what happens now what does this do it actually converts to a hash and out of curiosity what if i have 7th element in the a error now like do i do not know what you do what

should I do with the last one well let us try some more stunts who all think that the output of this is going to be three six and nine who all think otherwise what's the output awesome and now where were these he wasn't it now what string concat thats

how it actually works and let's take it to the next level how many of y'all know are french stabby stabby proc here's a sample so this is a steep rock that we have which takes note we are still working with star so if I make an invocation through

the block like this what is the output mumbling mumbling mumbling it's five and I say I knew that right is that so basically the short form for the first second last last and the rest of the stuff is in the middle pretty helpful pretty helpful thing to

[ ... ]

Nota: se han omitido las otras 2.455 palabras de la transcripción completa para cumplir con las normas de «uso razonable» de YouTube.