DrupalCon Prague 2013

Gestionando las dependencias

Jakob Mattsson  · 

Presentación

Vídeo

Transcripción

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

okay I guess we should get started and I hate microphones I can't move around and like wave my arms with them but I'll have to make do anyway so this is a session called manage those dependencies and as you could guess already my name is Jacob and

my twitter handle happens to be exactly my name so if you want to say something during during the talk give some feedback or maybe you just want to access the slides afterwards then i'm going to write those things on on twitter and I've been encoding

a lot for a long time many different companies many different languages and so on but I don't want to stand here and like recite my resume so you can just look me up yourselves if you want to what I do want to say is that I'm from Sweden and is anyone

else in here from Sweden they're actually two awesome then you can talk now because when I go places and say that I'm from Sweden people most often at least have some some kind of idea of what Sweden is like and most people think something like this

everyone works around and like a coat and like this brutish men and and always complaining about the fact that winter is coming but but I tell you Sweden is nothing like that because Ned Stark have no idea what winter is like you have no idea what winter is

like this is what winter is like so anyway I'm not here to talk about the weather but to talk about dependency management once again and before I start I just want to say this so yeah use your brain like don't take everything as truth but yeah you

use the bits and pieces that you find useful and question everything and also I am NOT here to talk about building like home pages for your kitten I'm here to talk about actual apps building building real apps that are complex and somewhat huge at least

and let's start with some so quizzing I actually found this quote a while back that said it was talking about the particular piece of technology and it said that it's a piece of the stack that's been notably missing for years and after using it

for a while now I'm not sure how I lived without it and when I googled around for this a bit I realized that people have had been saying this about source control like I started out coding without source control for I think maybe three years or so when

I was in high school and I often copied my folders to like back up things in case I would screw something up until next day or whatever so this could definitely be said about source control but it has also been said about something else in this case and you

can probably guess but let's rewind the tape and and look about what's happened in in a couple of different environments so I personally at least discovered unix in about ninety nine before that I was purely a windows guy and the thing I found coolest

about unix of all the things was the fact that you never like downloaded these executable files to install stuff and had to choose which directory and we're in your Start menu you wanted things to be installed you had a command a simple one-liner that

installed something for you and you could put this as part of a script that would like install the whole setup for an install a machine to the exact specifications that you want it and that that was really cool in my opinion mm as time went by I discovered

the Mac as well and realized that Oh their software for the mac that can actually do this as well even if it's not as out of the box as as pure unix and suddenly it started appearing in programming languages as well I first encountered it in Ruby where

you have Ruby gems well you do exactly the same thing you install the the piece of software that you want to use alongside your own code and it's not limited to two software in order to building software anymore but even actual actual end users follow

this pattern now sin since the App Store where you just you go to someplace and you download and you install and it's done can't really script it but it's pretty much the same thing and lately I've been doing a lot of know Jas where you have

exactly the same thing again with NPM so of course you know what i'm getting at already the theme at least so this quote once again was taken from one of the microsoft evangelists talking about the Microsoft stack and in particular the tool called nugget

which does exactly this for the.net framework so so even Microsoft is catching on but what I want to ask here today and since this is the front end track is what's the JS approach to this i am not talking no j us i'm talking about client-side browser

stuff how do we manage dependencies in general and that as usual with all kinds of technologies and all processes and so on there's a ton of different ways but the most common one and the one I think you've all used from time to time maybe still is

to find the library that you want to use like jQuery everyone wants to use jQuery so you look it up on the web you download the source you put it in a folder somewhere structured in your project and then you let the global pollution begin because you want

another library and you want another library so this pollution that's just the beginning you start like piling these things on top of each other like all these different things that you want to use you find somewhere and and this picture is even not that

descriptive I feel it's more like this usually and it becomes a maintenance nightmare and I suppose most of you have actually felt this if you work with front-end development then catch the wires yeah don't touch the dependencies we downloaded because

this thing only works with this version and this theme only works with that and it's a house of cards and it that's not the whole story because it also brings a whole bunch of stupid habits going about this in this way so for example we start to we

want two minima Phi are our sources right and concat files before we deploy and that's kind of a problem because if there's not a semicolon in the end of a file that you're concatenating with another you can run into problems so people start adding

semicolons to the beginning of their files which is like what what are you doing why do we need to do stupid hacks like that and we start to do like premature minima fication every everything we download can be downloaded as a minima fide version or an eminent

version and if we download the non minima fight we have to do it ourselves and if we download that minima fight one we have to we have a hard time debugging our code so maybe we download both of them and even start increasing the mess even more because we

want two minima Phi on the end anyway not like before we've finished and there's also no choice but to check in dependencies that's like a discussion of its own whether or not you should actually do that but in this case you have to because you

have downloaded them from an arbitrary source and and you have to put them alongside your code and since we're already copy and pasting libraries like jQuery this and this full version + r square this and that version and so on why not copy and paste some

small pieces of code that we have in our different projects because those are like libraries right so we kind of encourage copy and paste coding bye bye that just downloading source and putting it in in our projects so if you ask me the whole thing is like

this is my feeling about it it's just and you can ask like why why is it this way why why are we developing this way by why are we as web developers doing this in a different way than other people and I think the problem of course originates with the fact

[ ... ]

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