Latest / DevQuestions with Tim Corey / 085 Why Do Languages Copy Each Other?
Transcript
- 0:00SPEAKER_00: Welcome to the Dev Questions Podcast with Tim Corey.
- 0:03SPEAKER_00: Join us each episode as we tackle the questions you are asking about a career in software development, understanding the industry, and new technology.
- 0:12SPEAKER_00: If you're just starting out or you want to grow stronger as a developer, this is the place to get your questions answered.
- 0:19SPEAKER_00: Now, here's your host, expert developer and online educator, Tim Corey.
- 0:25SPEAKER_01: Why do languages copy each other?
- 0:27SPEAKER_01: This is a question that comes up around whenever a new feature comes up.
- 0:32SPEAKER_01: So whenever around the time when new features roll out for let's say.NET, since that's what I deal with primarily, where people say, hey, C sharp just copied that feature from this other language.
- 0:44SPEAKER_01: So let's talk about this in today's episode of Dev Questions.
- 0:48SPEAKER_01: Now that question usually is one of two things.
- 0:52SPEAKER_01: Either it's it's a curiosity, hey, I saw C sharp copy this.
- 0:56SPEAKER_01: Why did they do that?
- 0:57SPEAKER_01: Or it's a more combative or um uh superiority type question of hey, C sharp is copying its other language.
- 1:06SPEAKER_01: That must mean the other language is better, right?
- 1:09SPEAKER_01: And so let's talk about why what that really means.
- 1:13SPEAKER_01: So, first of all, I want you to take a step back and think about what is a programming language?
- 1:20SPEAKER_01: What's the purpose of a programming language?
- 1:23SPEAKER_01: Now think that one through, and it might not be exactly what you're thinking.
- 1:28SPEAKER_01: A programming language at its core, it's designed to allow us to express logic at the end of the day.
- 1:38SPEAKER_01: What we have is a bunch of ones and zeros, and that's what we're working with and manipulating and changing.
- 1:44SPEAKER_01: But we don't want to work in binary, don't want to look work in assembly.
- 1:48SPEAKER_01: We want to work in a higher level language where we can express in close to our native language what the code should be doing.
- 2:00SPEAKER_01: And so we create programming programming languages that allow us to take our logic and translate it into something the computer can then execute.
- 2:12SPEAKER_01: So we're just translating logic into something that the computer can read.
- 2:18SPEAKER_01: Well, uh does it really matter which language we use?
- 2:22SPEAKER_01: In some ways, no.
- 2:24SPEAKER_01: I mean, different languages have different strengths, but they're all doing that same thing of taking the logic and expressing it in a way the computer can compile and run.
- 2:34SPEAKER_01: So we're all doing the same job.
- 2:37SPEAKER_01: An if statement is going to be an if statement no matter what language you do in it.
- 2:42SPEAKER_01: Now, different languages may name it differently, they may use different syntax around it, but it's still going to be the structure, the logic of an if statement.
- 2:54SPEAKER_01: If this is true, do this.
- 2:56SPEAKER_01: Otherwise, do something else.
- 2:58SPEAKER_01: That's a basic if statement, regardless of what language you use.
- 3:03SPEAKER_01: So that's what languages are designed for.
- 3:07SPEAKER_01: So therefore, we're going to have overlap because we all want to accomplish the same task.
- 3:14SPEAKER_01: Let's take it from a different angle.
- 3:16SPEAKER_01: Think about language, not programming language, but actual language.
- 3:21SPEAKER_01: First of all, if you think about it, what is when I say dog, what does that evoke in your mind?
- 3:29SPEAKER_01: It you're probably thinking about a canine, a four-legged animal that is man's best friend.
- 3:35SPEAKER_01: Well, every language has to express the ide the concept of dog.
- 3:42SPEAKER_01: And yes, they may use different words for it, they do use different words for it sometimes, but at the same time, they're all expressing the same concept, it's just in their own way.
- 3:55SPEAKER_01: Now, Spanish, French, Italian, these are all languages that are pretty close, not the same, but close in the fact they have a lot of overlap in how they use words, or maybe the the actual spelling of the words the same, but the pronunciation is a little different.
- 4:12SPEAKER_01: But these are all very close languages.
- 4:15SPEAKER_01: Whereas English is kind of a mix, it's a mutt language where we've we've taken things from German and French and Italian and Spanish and a whole bunch of different uh languages and kind of melded it into uh English.
- 4:30SPEAKER_01: Okay, and so we've got we've pulled from a lot of different areas, but at the same time, we're all expressing the same concepts, we're all trying to identify the same thing.
- 4:40SPEAKER_01: So when I ask the question, you know, what color is the sky?
- 4:46SPEAKER_01: I could ask that in English, just like I just did, or I could ask that in a different language, and it may uh you know be rearranged a little bit, it may be in a different way a little bit, but at the same time, I'm expressing the same question in a different language.
- 5:02SPEAKER_01: So that's the same thing we're doing with programming programming languages, where we're expressing the same uh concepts, the same patterns, the same things we want to do.
- 5:12SPEAKER_01: It's just that we are using potentially different syntax.
- 5:19SPEAKER_01: So when it comes to languages, we do borrow from other languages, but that's not because we're just wanting to copy.
- 5:29SPEAKER_01: It's not because people got lazy and said, Hey, I just want to copy.
- 5:33SPEAKER_01: If a group of people already has a concept in mind, using that same identifier for that concept is a shortcut, it makes it easier for that group of people.
- 5:46SPEAKER_01: So we're expressing similar actions using familiar concepts.
- 5:52SPEAKER_01: And so the other part of it too, though, is that the designers of the languages are influenced by other languages, for instance, the uh the main person behind the C sharp language is also the main person behind TypeScript.
- 6:09SPEAKER_01: So imagine the the way those two work together.
- 6:13SPEAKER_01: I mean, why would you deviate terribly from another language if you already have this foundation?
- 6:20SPEAKER_01: So it's gonna be a lot of influence there.
- 6:23SPEAKER_01: Now, yes, there are differences in TypeScript to C sharp.
- 6:26SPEAKER_01: They're not the same language, but at the same time, there are some influences there because the creator of one created the other as well.
- 6:35SPEAKER_01: So there's going to be that influence, there's gonna be the idea of familiar concepts.
- 6:40SPEAKER_01: That's one of the things that C sharp was designed for, is the idea that you could transition over from another language that was similar, whether it be Java or C or C, and you would be familiar with the structure, that you would be more or less comfortable with the boilerplate stuff.
- 7:00SPEAKER_01: I mean, curry braces and semicolons, and maybe even a little bit of the declarations and variables and that kind of thing, they're pretty similar.
- 7:08SPEAKER_01: So, in fact, modern C and modern C sharp, they match up really closely.
- 7:15SPEAKER_01: So there's a lot of overlap there, and that's okay.
- 7:18SPEAKER_01: And that's comes down to the question then you know, is it better to have be the original for a topic?
- 7:27SPEAKER_01: So um, is it better to be the first one that created this I this concept or idea, and then everyone else just copies that?
- 7:36SPEAKER_01: It doesn't matter, it really doesn't.
- 7:39SPEAKER_01: Because if you come up with this great idea where you can express logic in a new way, which by the way, good luck with that because there's been a lot of a lot of expressions of logic over the years, over the decades, that were just copying over and over.
- 7:56SPEAKER_01: I mean, my goodness, when I was writing basic, actual, you know, basic 10, 20, 30 um lines of code, I was using if statements.
- 8:05SPEAKER_01: So does that mean that basic is better than C sharp because it came first?
- 8:10SPEAKER_01: Well, guess what?
- 8:11SPEAKER_01: Basic didn't come first with the if statement.
- 8:13SPEAKER_01: So you gotta go back to machine language and even like hardware itself to look at if statements and that kind of logic.
- 8:22SPEAKER_01: So, you know, it doesn't really matter.
- 8:25SPEAKER_01: What matters is does the language allow you to express the logic you need to?
- 8:32SPEAKER_01: That's the important thing.
- 8:34SPEAKER_01: And if it doesn't, and then it adds that feature, it's not about the fact that it copied somebody else, it's about the fact they've now expanded the language to allow you to use more of the uh features you need in order to express your logic cleanly.
- 8:51SPEAKER_01: So, does copying ideas or names really matter?
- 8:56SPEAKER_01: No, it doesn't matter, and in fact, in some ways, we kind of want them to copy some of the concepts, at least, if not the actual wording, because it makes it easier to move from language to language.
- 9:10SPEAKER_01: So the bottom line here is you're going to see similar concepts across languages, they might even use the same names.
- 9:18SPEAKER_01: It isn't remarkable, it's basically inevitable.
- 9:22SPEAKER_01: If a language is evolving over time and growing, and people keep continue to have interest in it, it's going to add more and more features until it has basically feature parity with other stable, mature languages.
- 9:38SPEAKER_01: And so you're gonna see a lot of the same concepts, a lot of the same ways of doing things.
- 9:43SPEAKER_01: That's not to say that every language is the same.
- 9:46SPEAKER_01: Functional versus object-oriented, for example, is a huge difference in how things are expressed, except for the fact that they tend to bring one feature set into the other where it's makes sense.
- 9:59SPEAKER_01: So you're gonna see a little bit of blending.
- 10:01SPEAKER_01: But even so, yes, they may be different, but the logic they express and how you express the logic at the root level is pretty close.
- 10:10SPEAKER_01: So you're gonna see a lot of similar concepts, even if the way they actually execute might be different.
- 10:17SPEAKER_01: Okay.
- 10:18SPEAKER_01: So, yes, it's inevitable, you're gonna see languages use features, invent features, create features for their language that you'll find in other languages already.
- 10:29SPEAKER_01: That's okay.
- 10:30SPEAKER_01: In fact, it's a good thing.
- 10:31SPEAKER_01: All right.
- 10:32SPEAKER_01: So thanks for listening to this week's episode of Dev Questions.
- 10:35SPEAKER_01: If you have a question that you want answered, first check the archive.
- 10:39SPEAKER_01: We've got a bunch of episodes already that we've answered a lot of questions.
- 10:43SPEAKER_01: Check to see if yours is there.
- 10:45SPEAKER_01: And if not, then go on to I am Tim Corey and go to the podcast section where you can ask your question and hopefully get it answered in a future episode of DevQuestions.
- 10:56SPEAKER_01: Thanks for listening, and as always, I am Tim Corey.
- 10:59SPEAKER_00: Thank you for joining us for this episode of DevQuestions.
- 11:02SPEAKER_00: Tim is committed to making it easier for you to become a developer.
- 11:05SPEAKER_00: If you would like to help make more content like this possible, please like, subscribe, rate, and share dev questions.
- 11:13SPEAKER_00: You can also send your questions to questions at iamtimcorey.com.
- 11:18SPEAKER_00: Until next time, remember, you are too smart and your time too valuable to waste it making all the mistakes Tim did.
- 11:25SPEAKER_00: When you're ready to learn to think and code like a professional developer, head over to imtimcorey.com and enroll in a course.