The conversation in this week's episode was inspired by a blog and video from Chris Ferdinandi. He talked about converting jQuery plugins and Vue components into vanilla JS, and recording himself in the process. He also tried this conversion with a React demo app. While discussing all the new things one can do with the web, we ended up discussing a fundamental question: What is the difference between a language and a framework?
You can find Ferdinandi's post and video here.
12 years ago, back when Stack Overflow was a brand new site with just a few thousand users, someone asked a basic question: What is the difference between a framework and a library?
FreeCodeCamp has its own take on this question with a pretty interesting answer. "When you use a library, you are in charge of the flow of the application. You are choosing when and where to call the library. When you use a framework, the framework is in charge of the flow. It provides some places for you to plug in your code, but it calls the code you plugged in as needed."
There was no Lifeboat badge to call out this week, so we honored a Lifejacket winner instead. Shout out to Andreas for answering the queston: Are byte arrays initialised to zero in Java?
Ben Popper The greatest jazz trio of all time, just improvising.
Paul Ford Just gettin' it done!
BP Just scattin' our way through the code.
BP Couchbase is a modern, multi-cloud to edge, SQP friendly, JSON document database for building applications with agility, performance and scale. If you're new to Couchbase and would like to learn more, the couchbase developer portal is the best place to start. It's loaded with tutorials, videos and documentation, as well as best practice tips, quickstart guides and community resources, including the Couchbase developer community forum. Ready to get started developing on couchbase? Visit couchbase.com/newtocouchbase.
BP Hello everybody, and welcome to the Stack Overflow podcast. I'm here with Paul and Sara.
PF Hey Sara! Hey Ben!
SC Hey y'all! Hey Paul. Hey Ben.
BP Hey everybody. So this week, we're gonna chat a little bit about an article that Paul dropped in our Slack. I thought it was pretty cool. It says, converting the react to do app demo to vanilla js. Paul, what did this bring to mind for you? Like what, what kind of conversation would this spark?
SC Yeah, you either use d3, or you're doing something crazy.
SC Oh so like someone's using the CMS and they're just like dragging and dropping components in are these like components of the CMS?
PF Just like almost like a little template language, like little basic math and sliders and things like that, right?
SC This is your jam, this is your favorite thing to do. Like create your own little layer something.
PF Why? Because it still, it drives me banana cakes, that I can't do computer things when I publish articles. It's like I can't, I can't put a little calculator inside of an article. Even though that might be really good. I can't put a little chart without doing a lot of song and dance. And so playing with that--
SC Well, that's why, that's Jupiter notebooks. So you're making your own little React Jupiter notebooks.
PF But Jupiter notebooks require you to really think in the world of Jupiter notebooks, I just want to I want to add two numbers and move a slider. That's all.
BP You want to lure people into that world by dragging and dropping a few of these onto--you both always, somehow, we wind up back at Jupiter notebooks. So walk people down that path.
PF Let's go meta like, when do you decide to use a framework and a framework can be Ruby on Rails, Django, ASP.NET and React, you know, can be on the front end as well. I mean, what actually, what is your definition of a framework, Sara?
SC Yeah. Especially if you're comfortable.
BP There's a pretty interesting thing here on Free Code Camp. Tell me if you think this sounds right, Sara, the way you were describing the difference between a framework and a library is pretty close to like the Stack Overflow answer that I found. But Free Code Camp has like a very sort of elegant way of putting it. I don't know if this is right, though. ''The technical difference between a framework and a library lies in a term called inversion of control. When you use the library, you are in charge of the flow of the application, you're choosing when where to call library, when you use a framework, the framework is in charge of the flow.'' So that makes it like a nice, neat little definition of how they stand in relation to one another.
SC Yeah, that's great. I think that's exactly what we're what we're saying is that, you start to fundamentally rethink how you're writing your language. And so, yes, now the framework is kind of controlling how you're designing your app instead of, instead of you.
PF I mean, it's a trade off, right? Like libraries, essentially, the we're gonna keep talking about their library doesn't ask you to change your behavior, it just gives you something that you presumably want. But a framework says if you, you're going to have to learn this, you'll have to do a tutorial. And at the end of that, you will be seeing the world in a new way. And because you see the world in a new way, you will be able to get more and better work done. And it's like anything, like hard things still remain very hard. So what frameworks do tend to do like react does and rails does and Django does is they create all those things that you used to spend days or weeks sort of scaffolding and building out per project. They're like, no, that's not your problem anymore. We're gonna do it.
BP There's a question on Stack Overflow, which is 12 years and one month old. So this This question is from like, the beginning of Stack Overflow, what is the difference in a framework and a library? And the funny thing in the answer is it says ''At the time, Wikipedia calls framework, a ''buzzword'' in air quotes.'' So apparently--
SC That's amazing. That's that's where it caught on.
BP People didn't know if it would last.
PF They kind of back you into a functional style to it's like, yeah, you're gonna use a lot of map and reduce. And, like, you know, when you look at the errors that come out of React, it's basically don't have any side effects. Those are the that's the I don't know, side effects for you keep everything as functional as possible, and you keep sort of evolving it that way. So I think that's another big part of it is it's backed people into a very specific kind of way of programming and thinking about state, which I mean, I don't know, I actually find it pretty good to stay pretty functional, when I'm working, because I don't miss I++ suddenly blowing something up, or off by one errors showing up in my world, which used to happen a lot.
SC All the time.
BP So I think at this point, we can definitely pick out a question or we could talk about Bitcoin because--
PF Oh, let's talk about Bitcoin! Sara, this is your Christmas gift.
SC Yeah, thanks!
PF You get to talk about Bitcoin on the Stack Overflow podcast. [Sara chuckles]
SC Yes, it's going up!
BP You're the resident expert.
SC Am I?
BP Why so up? Why is it so up?
SC No one knows. There's lots of there's lots of hot takes. One of them is that the stock market is not unpredictable, but it just keeps going up. And so if people are like, ''What else can I invest in?'' And this thing is kind of hanging out there. I think so one thing that happened recently is PayPal is going to start accepting and allowing you to pay for things in Bitcoin. So I think, as these larger companies and these, the workflow catches on using Bitcoin, becomes easier to spend.
PF I mean it's PayPal Hey, here you go.
SC When those things happen, you start to get more trust in the platform.
BP That makes a lot of sense. Yeah. Every time you know, the Shopify, the PayPal, they get it in there. You think ''We're just that much closer to consumer adoption!''
SC Yeah, I'm ready!
BP It's hard to price because so much of it is speculators. That's that's the one issue with Bitcoin, right, is that it's the the demand for it doesn't come out of like an increase in usage so much as an increase in attention.
PF And the United States government. The United States government is also a major hot hodler.
SC Yeah, I think that's right. But I think that's what, like places like PayPal are trying to change right? Like, they're trying to make it easier to use it.
BP Alright, y'all, it's that time of the week where we shout out a lifeboat, I don't see any new one. So this week we're gonna change it up, shout out life jacket.
BP Lifeboat, life jacket. Answer score of five or more to a question with a score of negative two. And the question of the week is: ''Are byte arrays initialized to zero in Java?'' So thank you to default locale, that was awarded 21 hours ago. Thanks so much for tuning in. I'm Ben Popper, Director of content here at Stack Overflow. And you can always find me on Twitter @BenPopper, or email us email@example.com.
SC Great, and I'm Sara Chipps, Director of Community here at Stack Overflow. You can find me on GitHub @SaraJo.
PF And I'm Paul Ford, friend of Stack Overflow, check out my company Postlight.