text stringlengths 0 1.17k |
|---|
[1039.68 --> 1044.32] then you pass whatever command you want after it and it will bootstrap the environment and then run |
[1044.32 --> 1049.00] the command that way you have all your environment variables present to you and you they're all declared |
[1049.00 --> 1053.06] inside of a file so it's really really cool for running servers it's great for development |
[1053.06 --> 1057.96] uh for web development for command line development for any of those things |
[1057.96 --> 1065.64] nice so you do that one for work where'd martini uh come from was this just a natural extension of |
[1065.64 --> 1070.54] of building command line applications and now you said okay now i want to build my web applications and go |
[1070.54 --> 1080.36] yep so martini uh came out of i i do uh web work for uh my day job and i wanted to i was building some |
[1080.36 --> 1084.86] angular front ends and we were looking at a new project and we're looking at doing you know more |
[1084.86 --> 1091.78] distributed architecture we we were usually a rails shop and in these new projects we're writing node.js |
[1091.78 --> 1097.38] we wanted to write go we want to write some more you know ruby and rails and we just want basically want to |
[1097.38 --> 1104.44] find the best tool for the job for each uh particular section of our application so that made me excited |
[1104.44 --> 1109.48] because i was playing with go for command line stuff already and so i started playing with go for the web |
[1109.48 --> 1113.96] and i played with a bunch of other frameworks and i built a couple projects in different frameworks just |
[1113.96 --> 1121.10] to get a get a feel for them and i was having a hard time finding uh just a sense of reusability |
[1121.10 --> 1128.32] among those web frameworks i know like ruby has rack and they unify on on rack in general all the web |
[1128.32 --> 1133.44] frameworks in ruby and and node.js kind of they have quite a few frameworks that unify on connect |
[1133.44 --> 1141.12] and so i wanted to create some sort of middleware stack um that one gophers would like um that wouldn't |
[1141.12 --> 1147.36] be too far flung from the original go net http library and two stuff that people would actually build |
[1147.36 --> 1153.20] value on a big um big proponent on on building value when you're writing code you should be writing |
[1153.20 --> 1160.08] something that's valuable um and so i started martini as kind of a container for that uh martini |
[1160.08 --> 1166.88] itself doesn't do like extremely useful things it's it's mainly just architecture and a lot of sugar |
[1166.88 --> 1173.52] to be able to create a lot of valuable components that are reusable across multiple types of web applications |
[1173.52 --> 1181.78] cool just pausing a second on the name and i i believe i i i read you say this on the mailing list |
[1181.78 --> 1186.94] but i don't recall the name martini and then you know the the tagline is classy web development in go |
[1186.94 --> 1193.78] uh it just calls to mind that that kind of epic spilled martini error page of sinatra is sinatra like |
[1193.78 --> 1199.38] the primary inspiration for martini yeah sinatra is definitely one of them express from node.js is |
[1199.38 --> 1207.14] is another those are both fantastic uh frameworks they they focus on simplicity and modularity and |
[1207.14 --> 1214.80] and elegance and martini sounded really cool i mean it's a martini is obviously a mixed drink um you know |
[1214.80 --> 1221.70] in this time there's like so many you can call any cocktail martini nowadays it's not just gin and |
[1221.70 --> 1226.62] vermouth so like it's true when i think of a web app i think you know there's different requirements for |
[1226.62 --> 1232.62] for any kind of web app or service and and i can't just make a set of like middleware or a set of |
[1232.62 --> 1236.54] components that everybody's going to use they're all going to create their own and that's when i |
[1236.54 --> 1241.28] thought of like okay it's like a cocktail it's like a martini like sure i don't like appletinis but the |
[1241.28 --> 1245.36] person next to me really likes appletinis and i don't believe an appletini is a real martini but |
[1245.36 --> 1251.76] that doesn't matter the guy still likes his appletini and i feel the same way about the web um you can |
[1251.76 --> 1258.30] have whatever opinions you want but martini tries to be a good container for uh creating kind of your |
[1258.30 --> 1267.60] own cocktail your web cocktail of sorts cool so martini provides um just the core martini we'll talk |
[1267.60 --> 1274.02] about martini contrib which i believe is like you know provides way more stuff but the martini proper |
[1274.02 --> 1281.50] library um basically it's a middleware stack that has a routing layer in it and some sort of dependency |
[1281.50 --> 1286.32] injection is that is that the gist of it or is there more that i'm missing though that's pretty |
[1286.32 --> 1292.30] much the gist of it okay so then the contrib libraries were all the other because i mean beyond |
[1292.30 --> 1301.30] that most web apps are going to need you know session handling csr csrf protection uh you know |
[1301.30 --> 1307.10] the whole host of things that that kind of people become used to um is that what stuff lives in contrib |
[1307.10 --> 1314.34] yeah yeah so uh to go back to martini for a sec i was building uh i was mainly building martini for |
[1314.34 --> 1320.84] for two different kinds of web apps uh for my application it was uh rest-based you know services |
[1320.84 --> 1325.70] that they're just serving jason so and they're talking to other services not even talking to a |
[1325.70 --> 1332.16] browser so there there's even no use for like cookie-based sessions or anything like that so that's |
[1332.16 --> 1339.40] that that might be the answer to why some middlewares are in martini contrib rather than martini itself |
[1339.40 --> 1345.16] and um i kind of just wanted to elaborate more on the dependency injection some people really shy away |
[1345.16 --> 1351.06] when i use the word dependency injection uh because they're like oh my gosh java ioc containers oh no |
[1351.06 --> 1360.12] yeah uh this is gonna be terrible i was thinking just that yeah okay so um i i i actually have a love |
[1360.12 --> 1364.82] for dependency injection when it's used well and it's actually my uh it starts to become whenever |
[1364.82 --> 1368.32] i'm picking up a new language i i tend to be like okay i'm gonna write like a dependency injection |
[1368.32 --> 1373.32] system to see how i can make modular code with this language so if you look at my github i have like |
[1373.32 --> 1379.60] one in c sharp one in action script one in javascript um i i've written not on github but i've written |
[1379.60 --> 1387.48] one for objective c and uh obviously go and ruby so i i've kind of played a lot with how like how to |
[1387.48 --> 1394.06] manage dependencies within applications and i try to find the best fit for one um in this case and a |
[1394.06 --> 1399.10] lot of people absolutely love it because it it really extends the modularity of martini the way |
[1399.10 --> 1405.54] the dependency injection works is you just you map something by a type and go go strongly typed it's |
[1405.54 --> 1413.66] statically typed so you can you have types everywhere right and you you map something that's a type |
[1413.66 --> 1418.08] let's say it's like a database you have this database connection and you map it to martini |
[1418.08 --> 1424.30] either on a global or a request level and every one of your martini handlers which is really just a |
[1424.30 --> 1429.96] function they can ask for that dependency in their argument list so it's very close to if you're used |
[1429.96 --> 1437.04] to using angular um for for front end stuff their dependency injection works uh kind of the same way |
[1437.04 --> 1442.24] on functions where you just ask for it and it gives it to you yep uh it's so brain dead it's very |
[1442.24 --> 1447.36] intuitive it's super easy to test because now you have functions that don't actually reach outside |
[1447.36 --> 1454.28] of itself it all just goes in through its argument list so that's kind of how the dependency injection |
[1454.28 --> 1460.62] works and why i try to encourage people to not shy away from from that word as much um and it's hard |
[1460.62 --> 1466.14] to try to say like it's something else because it really still is dependency injection um just not in |
[1466.14 --> 1470.68] the way that most people would think let's pause the show for just a minute give a shout out to our |
[1470.68 --> 1475.68] sponsor top towel for those of you out there who are freelancing or maybe you'd like to freelance |
[1475.68 --> 1479.98] or even kind of try out a freelance like project where you're maintaining your full-time position |
[1479.98 --> 1486.28] you have to check out top towel top towel is a new rapidly growing network of some of the most elite |
[1486.28 --> 1492.84] engineers in the world they're distributed all across the globe their primary focus is connecting |
[1492.84 --> 1499.36] their ecosystem of top engineers and top companies you work on special projects with companies like |
[1499.36 --> 1507.06] airbnb idio zendesk and many others you can work remotely on a beach or anywhere in the world |
[1507.06 --> 1515.02] uh to get started head to top towel.com slash developer and click join top towel that's a nice |
[1515.02 --> 1523.22] big old green button you cannot miss it that's t-o-p-t-a-l.com slash developer i think angular |
[1523.22 --> 1529.28] um is kind of warming up more people to the idea and the and the benefits that dependency injection |
[1529.28 --> 1537.00] provides so i think martini fits in fits in nicely there um you know there's a whole host of of |
[1537.00 --> 1543.98] options in the go community for web development in fact we had even a roundup post late last year |
[1543.98 --> 1550.88] um a guest post that laid out a whole bunch of options where does martini fit into that ecosystem |
[1550.88 --> 1557.04] um were you aware of a lot of the options when you started building it and um what do you think |
[1557.04 --> 1562.28] its advantages are um martini has a couple advantages and it also has some disadvantages |
[1562.28 --> 1567.98] from a pure benchmarking standpoint martini is not the fastest framework uh and it and it's not |
[1567.98 --> 1574.04] supposed to be that wasn't my goal in writing it uh there's part of me that believes that go is fast |
[1574.04 --> 1578.74] enough for most applications and if somebody is just looking at hello world benchmarks that they're not |
[1578.74 --> 1584.36] they're not doing their job as far as uh analyzing a framework but that's another topic for another |
[1584.36 --> 1593.40] day um what martini brings in is because of how the dependency injection works and how uh dynamic it is |
[1593.40 --> 1601.36] in that nature it is backwards compatible with all go net http handlers which is a really really cool |
[1601.36 --> 1606.58] feature because things like gorilla http and other handlers that people have published kind of that |
[1606.58 --> 1614.12] work around um the go net http interface they can just throw those in martini and they just work |
[1614.12 --> 1619.60] um and and that's that's kind of that wasn't necessarily an intended thing that was like i was |
[1619.60 --> 1624.42] writing martini one day and it popped up in my mind it's like this needs to be like a bullet point on |
[1624.42 --> 1630.20] them on the martini feature list because it's actually really cool yeah and uh so that's one of the |
[1630.20 --> 1636.20] features and the other feature is just that kind of tags along with that is reusability um you know the |
[1636.20 --> 1643.38] middleware stack the routing stack the fact that you uh there's this kind of you you ubiquity between |
[1643.38 --> 1647.78] handler functions whether or not it's middleware or whether or not it's handling a route like |
[1647.78 --> 1654.26] it doesn't matter it's all the same uh it's just kind of the elegance of that and it's it's really just |
[1654.26 --> 1659.14] building blocks people find out like the core features of martini and they come up with some really |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.