Check out a free preview of the full Polyglot Programming: TypeScript, Go, & Rust course
The "Projector Testing Q&A" Lesson is part of the full, Polyglot Programming: TypeScript, Go, & Rust course featured in this preview video. Here's what you'd learn in this lesson:
ThePrimeagen asks students some questions regarding what they think of Go and Rust.
Transcript from the "Projector Testing Q&A" Lesson
[00:00:00]
>> So I believe now we're going on to the best part of this, which is going to be question time, blah, blah, blah, blah, blah, on to victory. That's right, cuz we're into the final stage. All right, I actually, it looks like I pre-planned some questions and which I forgot about.
[00:00:14]
So let's do them. All right, if you've only done TypeScript, what do you think about GoLang? All right just was think about it for a moment. What are some things you liked about it? What are some things you hated about it? What are some things you wish TypeScript had, that it doesn't?
[00:00:32]
Or do you think there's nothing? You think there's nothing that's needed.
>> TypeScript's totally happy to let you just pass wrong values around. Go was right on top of, I mean, especially the LSP was right on top of letting me know that I've mistyped something, or the thing was referencing the wrong thing, or whatever.
[00:00:51]
>> Yeah, I find the LSP to be the best in class LSP. If you're using it, it just constantly puts you in the right position. Even using API's, it will prefill in the arguments with a huge amount of the default values you need. It's extremely impressive. It just makes it super easy.
[00:01:07]
That's one thing I love about it, too, is just I find that any one of any skill level can use Go mostly effective, right? You're gonna write a service, it's gonna perform better than your TypeScript version. You're probably gonna be correct more often. It's very easy, right? It's a very easy language.
[00:01:23]
And so I kinda wish that TypeScript had that. Cuz the problem I see about TypeScript is allows you to, or JavaScript, really, is it allows you to indefinitely abstract, and always, right? You can do extends, you can do all sorts of you know OOP stuff. But on top of that you can keep on abstracting in all sorts of kind of fun ways.
[00:01:40]
Which just allows code to get further and further complicated, is what I find. And I just find that a lot of distractions just kinda like leaking, right? What about error handling? [INAUDIBLE], let's recall all the Go error handling that we've done. How do you feel about it? Do you wish it was a little bit less verbose, a little less in your face?
[00:01:59]
Yeah, we got a question from the back.
>> Yeah, there was a comment, it's a bit abstract, but Go feels like it has fewer tricks and is more straightforward than TypeScript. Where, in TypeScript, you can kinda shoot yourself in the foot, I guess.
>> Yeah, another thing just kinda going on that, like converting a number, right?
[00:02:19]
You know that it wasn't successful. Instead, you have to be reactive. You have to be proactive in TypeScript and reactive in Go. So, Go lets you have to react to it, whereas TypeScript you have to go and check, is this thing a gnat or not? All right, so it's kinda has that reactive, proactive type thing.
[00:02:36]
I think I prefer the reactive because it's always in your face. I'm gonna always write a service that's a bit more robust cuz I found all the errors along the way. Good feels, all right, I think error handling is great. What about Rust? How do you feel about Rust if you're primarily familiar with TypeScript?
[00:02:55]
It's probably kind of a hard transition, maybe it feels a little arcane. Yeah, nothing, any positives?
>> It seems more complicated, the language, but to write it's much more legible than Go? It feels like there's just less typing going on, and then it's pretty concise.
>> Yeah, the in-betweens aren't filled with a bunch of does not equal, nil, checks, and all that, yeah.
[00:03:23]
I agree with that. It's definitely harder, in some sense that you always are thinking about your types. Are you consuming your types? Remember, I still have a pre-planned explosion about to happen. And so, we're gonna run into a problem where we didn't pre-plan our types far enough ahead and things aren't gonna work out.
[00:03:41]
And so, Go or Rust can be very complicated in that matter. We're gonna have to really rethink about what we're doing, all right?
>> All right, on the chat someone says, I love the error messages in Rust.
>> Yeah.
>> But it probably wouldn't be worth it if there weren't a performance just difference, in my opinion.
[00:04:01]
>> Yeah there's a, I mean, it depends of course on the operation, if you're heavily Internet trafficked, right? If you're setting out large quantities of data, obviously you're likely gonna run into a system overhead problem where the performance of your program is not gonna be that important. But for the most part, I mean, Rust is gonna perform significantly faster than JavaScript.
[00:04:24]
And then larger amounts of stuff that it's solely focused on just the language doing calculations, the larger Rust wins. And so it's pretty nice. And if you write it properly using Tokyo or whatever runtime you want to use for asynchronicity, you can just give it another core and it runs.
[00:04:44]
Whereas with TypeScript, you can't just give it another core. You have to go and create another process. If there's state that needs to be shared you've added a whole complication that just can't be undone.
>> And so it's pretty interesting. What do people primarily use Rust for? That's a question from Twitch chat.
[00:05:03]
As far as I can tell you rewrite everything in Rust, RIIR, that's the classic. What you really want to do is you find a great tool and then you rewrite it, GREP, RG, find FT, right? Always rewrite, but Rust really is just, I mean, I think it's real spot is gonna be in CLI applications.
[00:05:21]
And embedded I think is gonna be a big win. Because if you're using hydraulics, you really wanna make sure you got the thing right so you don't actually crush your hand, right? You're gonna want, so I think Rust is gonna play a good part in embedded. I'm curious about the web world.
[00:05:35]
I am not 100% convinced Rust is gonna be the web world language. But I think it has a good chance, especially with things like macros and being able to create HTML inside your Rust. So you can create a JSX-like experience, and have a really high performance, very awesome server-side rendering.
[00:05:52]
And so there you go. Also now you're using Wasm, if Wasm gains more steam, you're starting to really see some wins there. But there's a lot of bets on making that all happen. That's my personal, it's my personal take. I also find it just more enjoyable to program the trade system, being able to just make things work really seamlessly into a lot of their standard library, it's very fantastic.
[00:06:18]
All right, yeah, and this is awesome. Just like, if you come from every now and then I have to print out stuff in C++. You just wanna print out a struct and it's just like, man, this sucks. But it's just so glorious that this is just available and it just works, right?
[00:06:35]
That just makes me really, really happy.
Learn Straight from the Experts Who Shape the Modern Web
- In-depth Courses
- Industry Leading Experts
- Learning Paths
- Live Interactive Workshops