Should you use Go over TypeScript for your Backend? The Perspective of Someone who uses Both.

Поделиться
HTML-код
  • Опубликовано: 31 май 2024
  • TypeScript or Go. Its a hard question to answer when trying to pick a backend language and the honest answer is: they are both good?
    Today I breakdown my thoughts on which language I would use and where. At the end of the day it comes down to your app and how you want to architect things.
    twitter: / benjamin41902
    insiderviz: www.insiderviz.com
    #golang #typescript #programming
  • НаукаНаука

Комментарии • 93

  • @randall.chamberlain
    @randall.chamberlain Год назад +12

    Mate, as a Software Architect of several years, I find your insights and analysis rock solid and spot on. Good job. Consider a Solutions Architecture job, we need more.

    • @c0ldfury
      @c0ldfury 9 месяцев назад

      Software architects are just programmers that can't code. It's a worthless job, like scrum masters.

    • @p19shelt
      @p19shelt 8 месяцев назад

      Go vs kotlin?

  • @codruterdei
    @codruterdei Год назад +9

    Cool vid, I like how you go into detail about the decision making factors and you're not presuming higher knowledge from your audience while also keeping your video short enough.

  • @merotuts9819
    @merotuts9819 Год назад +34

    Your Frontend and Backend architecture in same freaking language, what else would you want ? Regarding computation and scalability, there are tons of options that can handle those worries. For me, not having to switch between two different programming language paradigms is the key.

    • @bmdavis419
      @bmdavis419  Год назад +11

      TRPC is the one thing that makes letting go of TS for all my backends by far the hardest. The power of having everything in one Next app is absurd and it makes development so easy I find it hard to give up. I think Go is still often better, but it is for sure slower to develop.

    • @4otko999
      @4otko999 Год назад +5

      What stops me from doing that is that js is a dsl for browsers, but backend doesn't run in a browser. Js people are often amazed that node can manage 400 concurrent connections, but a server in C can manage 400'000. Go is probably not that far off from the C.

    • @RootsterAnon
      @RootsterAnon Год назад

      Hey, Link listen... I see you are some basic beach, and please don't share your basic beach opinions since we can read them on Js/Ts landing page hero component. Just get lost. You have no idea what the flip you talk about.

    • @jonzuka9746
      @jonzuka9746 Год назад

      I think the programming language you use is not as important as the patterns you use. Some patterns are hard to implement with Typescript because it has too much abstraction around JavaScript.

    • @Voidstroyer
      @Voidstroyer Год назад +5

      Then you are better off using Elixir and the phoenix framework. Performance is not as good as go (but almost is) and it scales both horizontally and vertically without you having to configure anything. With Phoenix liveview you get the benefit of using the same programming language in the backend and the frontend. And not to mention that you can have millions of concurrent connections on just 1 server (scalability is great). Only 2 drawbacks, 1: Functional programming language (which isn't a drawback actually but might feel like it if you are used to OOP), 2: No strict typing which typescript and go do offer (but Elixir doesn't have the problems that those languages solve with strict typing so it is also not really a drawback).

  • @RevCorner
    @RevCorner Год назад +2

    Your videos are really helpful, always look forward to them. Thank you

  • @BlaBlaBlaInDaHouse
    @BlaBlaBlaInDaHouse Год назад

    Great video! Your comparison really makes it clear for me

  • @ashuvssut
    @ashuvssut Год назад +2

    There was a nice conclusion out there @11:58. After that, in knew that I need more of his knowledge and i pressed Sub and wrote this comment. I appreciate your video. Very informative.
    Also, that example website is just what I needed to see

  • @Slink1
    @Slink1 Год назад +1

    Love the video! 😍
    So insightful.

  • @ayomidewilfred1864
    @ayomidewilfred1864 8 месяцев назад +1

    I find your insights so useful.

  • @asherrfacee
    @asherrfacee Год назад

    This was great advice and well thought out.

  • @oluwatobitobias
    @oluwatobitobias Год назад +2

    Good video... always love your contents 👍🏿

  • @jonathanduran2921
    @jonathanduran2921 Год назад +3

    I would love a course that focuses on the differences between typescript/go while creating a clone of your finance app (or something similar).

  • @industry_std
    @industry_std Год назад +3

    I've struggled with this when building side projects (for a portfolio) because using Typescript is usually more ergonomic and just easier, especially when using Vercel, than dealing with another deployment.
    btw I think you can also deploy a backend in Go using AWS functions in Vercel if you place it in an 'API' folder. Never tried it with Go, though.

  • @naranyala_dev
    @naranyala_dev Год назад +1

    thank you, more other comparisons about the tools you use every day

  • @oluwatobitobias
    @oluwatobitobias Год назад +15

    Buh let me add this... in a comparison video, please do more to tilt to a side, it so common online to see "i leave the decision to you", most people compare to get a vote up or down... and you actually do more than most... so great work again 👍🏿

    • @malcomconfac3907
      @malcomconfac3907 Год назад +1

      I agree.

    • @mysterio7385
      @mysterio7385 Год назад +5

      no, that's the opposite of what should be done. There isn't a silver bullet, like "pick this language whenever you can". It always depends on circumstances and the context of your application.

  • @brightglitch958
    @brightglitch958 Год назад +1

    Niceeeee just found you, keep it up, I'm subbed

  • @jonathanduran2921
    @jonathanduran2921 Год назад

    What kind of projects are you building to get a deep understanding of the quirks of both languages? I find that my personal projects help me understand how to do something in Typescript/Go but nothing deeper.

  • @Mathes881
    @Mathes881 10 месяцев назад

    Why do we need k8s to scale vertically with ts, but we dont need it for go?

  • @Kats0unam1
    @Kats0unam1 11 месяцев назад

    Ben, have you tried nestjs ? I was thinking about building a REST API with Go but I think Nest can cover everything I need.

    • @bmdavis419
      @bmdavis419  11 месяцев назад

      An early version of insiderviz used Nest, its great, very angular like, not my favorite but it works well

  • @AlexBezhan
    @AlexBezhan Год назад +1

    How do you combine TS and Go on the backend? Do you proxy requests from browser via Node and then to Go? Or browser goes straight to Go port on the server?

    • @bmdavis419
      @bmdavis419  Год назад +1

      I would just communicate between them using either a queue in Redis/RabbitMQ or via HTTP

  • @1998goodboy
    @1998goodboy Год назад

    Ive been wanting for ever to try and find some next js substitute for golang
    With maybe only delegating js/ts for any frontend pages that need it
    This way i could just definitively get away from node and npm

  • @boot-strapper
    @boot-strapper 10 месяцев назад

    you can use reflection to generate ts types from your go backend...

  • @Kats0unam1
    @Kats0unam1 Год назад +3

    I might be wrong but i dont see Solid Start or Svelte Kit entering the enterprise world. A separate backend is always more flexible and scalable. Im doing my current side project with Next and TRPC but I would totally pick Go on my backend over TS anyday. Performance or not.
    You think Solid or Svelte will enter the frontend scene in the job market in the next 2 years or React will stay king ?

    • @bmdavis419
      @bmdavis419  Год назад +3

      Its hard to say, I honestly don't have enough experience to make an informed call. On paper and in simple stuff both are incredible, but idk what its gonna be like at scale. React is battle tested and has absurd library support that they are gonna be hard pressed to match.

  • @nevaknowmanamesame5089
    @nevaknowmanamesame5089 Год назад +1

    Subscribed!

  • @ghosthaunting15
    @ghosthaunting15 Год назад +4

    Hope web assembly frameworks will be production ready in coming years

  • @abhi3700orig
    @abhi3700orig Год назад +3

    I will go for Rust.
    Recently, Discord went for rust in one of the modules & they found multi-fold improvement in performance.

    • @linearz
      @linearz Год назад +6

      My projects usually have very small user base, the speed of python or ruby is more than enough 😅.

    • @cat47
      @cat47 11 месяцев назад +4

      rust is a great language, but you don't really NEED it for performance reasons until you have maybe millions of users

    • @shimadabr
      @shimadabr 11 месяцев назад +1

      But Discord had to ditch Go because of the garbage collector, their systems demand crazy throughput and responsiveness and the GC was creating noticeable spikes on them. For applications at their scale and needs, Rust is better, but for the most part I think GO is better (easier to use, to train, to hire, also has good packages)

    • @abhi3700orig
      @abhi3700orig 11 месяцев назад

      @@cat47 I think that depends on the dev's mindset in terms of developer friendliness. I am on a daily basis using Rust almost everywhere possible replacing languages like C++, Python, NodeJS.
      Btw, in blockchain the industry has gladly accepted rust & inserting almost everywhere - Writing contracts, Zero-knowledge circuits, runtime modules....this leading to considering Rust even for their backend systems as well.

  • @JohannesSandjaja
    @JohannesSandjaja Год назад +1

    im still a bit confused on the part u said that typescript does not scale vertically and go easy to vertically scale, can u explain more on that part?

    • @bmdavis419
      @bmdavis419  Год назад +2

      This is the part I wish I could redo, basically I mean if you have one cpu it can run FAR more requests running go than ts. Thus with ts you need more cpus to get the same result as go

    • @JohannesSandjaja
      @JohannesSandjaja Год назад

      since i've never done benchmarking or any analysis before, is there any article for me to better understand this? wanted to know more on how these things work under the hood

  • @efehanturhan6763
    @efehanturhan6763 Год назад +3

    hey ben, what do you think about python?

    • @bmdavis419
      @bmdavis419  Год назад +1

      It is a very good language, would not be my choice for backend development, but for data science, AI, and scraping? 10/10

    • @johnb5739
      @johnb5739 Год назад

      @@bmdavis419 why u wouldnt use python for backend?

  • @bishalneupane
    @bishalneupane Год назад +1

    Awesome!
    Why Don't you make a video on like day in life video ?
    😂 Genuinely interested

    • @bmdavis419
      @bmdavis419  Год назад +1

      Maybe after this 50 day period is done I might, not sure though b/c its kinda boring lol.
      1. Wake up, clean up
      2. Work my 9-5
      3. Make a video
      4. Go to the gym
      5. Work on insiderviz
      6. Repeat

  • @footballfanatics007
    @footballfanatics007 Год назад

    Crazy bro

  • @IanMathaiya
    @IanMathaiya Год назад +1

    What's better for a e-commerce website, Go or TyeScript?

  • @ahuman32478
    @ahuman32478 Год назад

    When you say Typescript backend, are you talking about NodeJs?

    • @bmdavis419
      @bmdavis419  Год назад

      Yep, NodeJS runtime, written in TS, compiled to JS

  • @smilejjjj87
    @smilejjjj87 Год назад +1

    Such videos sometimes want me to start my own channel where I need to disprove some words said in video. As a junior dev don't listen to someone who doesn't have experience in development...

    • @EduardsRuzga
      @EduardsRuzga Год назад

      Can you at least name things you disagree with?

    • @Tobi-cb8vjtobi
      @Tobi-cb8vjtobi Год назад

      Basicly the video creator didn't get the point of go. Go is made for high performance network microservices. As the creator is basicly talking about vertical scaling, you normally use a horizontal scaling strategy.
      Example:
      You have a Server, 1 CPU and 1 GB RAM, but during the lunch break your website or application has way more load. So you add a new CPU for 200 Dollars, lets say a 4 core and again upgrade the RAM to 4 GB.
      Ok... so you scale now great during lunch breaks, but what is with the other time when you don't need it? And what you do if also the 4 Cores are running out?? Buy again a new one? What happens when your mainboard doesnt support more than 4 cores? Now you need a new Mainboard too?? And here comes the horizontal scaling.
      Just add another server and start another instance of you app (Loadbalancer infront of all instances). When you don't need to scale anymore, just shut down the second server and you don't pay it anymore. This is how you scale thesedays. This also has the benefit that you application will be online if one server fails. For vertical scaling, your app is down.
      So this is just a summary about my own opinion. I dont want to front someone, do what you want but for me as a Go dev this completly makes no sense.
      If you are building standard REST services or websites, go what makes the most fun! Later on with a database attached, security rules, additional middlewares and so on you will not feel a performance difference. The only difference you will see is resource cost. And thats why many companies are currently migrating to Go and Rust. Just imagine a Nodejs app takes 30% more RAM (which is realistic), you host like 5k Applications. Lets say every application uses 100 mb ram -> 500 GB RAM. Now add 30% on top of it and you have way higher server cost. If you calculate that with a t2.medium machine of aws (4 GB Ram, 38$ per month) you would need 125 Server => 4750 $ monthly cost. Add 30% more RAM -> 650 GB RAM -> 162,5 server needed, so 37 Servers more, which means 37 * 38$ => saving 1406 $ in server cost per month just by changing the language. This is how cloud computing works...

    • @EduardsRuzga
      @EduardsRuzga Год назад

      ​@@Tobi-cb8vjtobi Servers are only one element in equation which choice of language effects.
      Its actually developers who cost way more then servers and its cheaper to have more servers then more developers.
      Depends though, I mean at scale of Google and Facebook you would care way more about it.
      At scale of a startup that is last thing you should care about.
      We are also speaking only about servers here. What about client? Web? Desktop? Mobile?
      What language do you use there? Is it same developer using all of those languages? Is there cost in productivity of that developer using multiple stacks?
      Or are there multiple teams server/web/desktop/mobile each using own stack and syncing their work? Is there cost on getting them all on same page about what and how should be done?
      I am not arguing with your point, I am genuinely curious how to solve all this. In companies I worked there was more pain related to zoo of technology and teams that prefer one over the other then performance or server costs. As if its all religions where people disagree on faith and principle and waste each other time.
      Do you have experience with that?
      I BTW look forward to future where Rust may become one language to rule them all with WebAssembly containers on server, web, desktop and mobile.
      But for now for me its full stack TypeScript.
      And only because I am closer to Startup scale projects, small teams, speed of iteration over quality/performance etc.

    • @Tobi-cb8vjtobi
      @Tobi-cb8vjtobi Год назад +2

      @@EduardsRuzga I agree too 100%, developers cost way more. In my company we have developer standards and they say: you are only allowed to use Go + Vue3. So we don't have any messy tech stack anymore with 20 languages. And personally i meant scale like google/facebook... :)
      For startups i would go for the language which the team knows the best. Its important to get a prototype for startups. So your choice with Typescript is probably better there =) Good choice

  • @greendsnow
    @greendsnow 11 месяцев назад +1

    I would never touch tRPC. It's an overhead.

  • @AndoroidP
    @AndoroidP Год назад +1

    I use Rust for my backend

  • @itsobinna
    @itsobinna Год назад

    ayy you know wtf your talkin about. thats dope.

  • @felipefelix92
    @felipefelix92 Год назад +3

    Cant you just use meta frameworks w/ trpc as a glorified grpc client for go services and still have the benefits of a pure ts trpc server?

    • @bmdavis419
      @bmdavis419  Год назад +2

      TRPC =/= GRPC I'll make a video about this at some point but at a high level trpc is a way for a TS server to talk to a TS client and grpc is a way for internal micro services written in any language to communicate.

    • @felipefelix92
      @felipefelix92 Год назад

      @@bmdavis419 I understand they are two different things. What I mean is, whats stopping you from using trpc (with a T) as a grpc client and passing the data down to the client (react page)?

  • @ankeshkapil3129
    @ankeshkapil3129 Год назад

    Java

  • @Gol_D_Roger_The_Pirate_King
    @Gol_D_Roger_The_Pirate_King Год назад

    You should use RUST over GO for your Backend?

  • @catwhisperer911
    @catwhisperer911 Год назад +1

    Typescript is transpiled to JavaScript yet you reference it as if it is a runtime language. Seriously misleading.

    • @p19shelt
      @p19shelt 8 месяцев назад

      Everyones that tho.

  • @cowabunga2597
    @cowabunga2597 Год назад

    Wait typescript is easy to write??. Man I have been shitting my pants writing Types for react.

  • @ilijanl
    @ilijanl Год назад +8

    Stopped watching the video on the first slide. Go and typescript scale the same vertically and horizontally system/machine wise. Go has only lower footprint and requires less resources to run compared to NodeJS and can run on multiple cpu cores, however you don't need any k8s or serverless to run nodejs in parallel on multiple core cpus....

    • @philheathslegalteam
      @philheathslegalteam Год назад +1

      Agreed. This dev is giving newbies the wrong idea in that regard

    • @bojanmatic024
      @bojanmatic024 Год назад +1

      He might have a point here tho - nowadays CPUs scale by adding more cores and if you want to get the most out of your CPU you need to use those cores. NodeJS being single-threaded in nature makes that hard without going into multi-process architectures but that's really going into horizontal scaling territory now.

    • @faithfulojebiyi
      @faithfulojebiyi Год назад

      Go spawns a goroutine by default to take advantage of multithreading. Just start your NodeJS app in Cluster mode to replicate same in nodejs

    • @faithfulojebiyi
      @faithfulojebiyi Год назад

      I agree with you @IlijaNL

  • @x99270
    @x99270 Год назад

    what about php?

    • @pramudyaindra
      @pramudyaindra Год назад +2

      it’s 2023 bro, not 2001 anymore

    • @learnthecode8175
      @learnthecode8175 Год назад

      Laravel and Symfony are good frameworks and stable

    • @bmdavis419
      @bmdavis419  Год назад

      Not my thing at all lol. It was the first backend language I ever used in high school, but at this point I would not go back

    • @pramudyaindra
      @pramudyaindra Год назад

      writting php code feels like walking on the blind spot of journey

    • @x99270
      @x99270 Год назад

      @@pramudyaindra I get what you are trying to say but it depends on many other factors but not what year it is.

  • @RenXZen
    @RenXZen Год назад +4

    Love the content! but the neutrality in 90% of these kind of videos is getting old

    • @bmdavis419
      @bmdavis419  Год назад +2

      RN I am focused on more general stuff/languages where the truth is "both have strengths and weaknesses", but as time goes on I am gonna get more and more specific and trust me there will be many places where I do NOT have a neutral opinion. Just wait till "Vercel VS Netlify" or "Prisma VS TypeORM", trust me, a side will be taken

    • @RenXZen
      @RenXZen Год назад +2

      @@bmdavis419 Thanks for replying. I have to admit that as a huge go nerd i was expecting something and maybe that's what everyone finds somewhat frustrating on these videos. But at the end of the day, you're completely right, the right tool has to be chosen according to the job, and that's what you explained. There's nothing to disagree with your video, it's impeccable. As programmers we have to leave our love for a language or technology aside in favor of logic or budget :')

    • @yegorzakharov8514
      @yegorzakharov8514 Год назад

      @@bmdavis419 and prisma OR typeORM VS EdgeDB and no ORM!

  • @bashscript2805
    @bashscript2805 Год назад +3

    Hi Ben, when you will make a video about investing?

    • @bmdavis419
      @bmdavis419  Год назад +1

      Honestly not sure, its something I am learning a ton about offline, but I am hesitant to make one b/c I don't feel nearly as qualified as I do with programming. With programming I know I know it so I'm not worried about giving bad info and if I do make a mistake its pretty low stakes.
      But investing? That involves peoples actual money and bad information can do real damage. I know tons of people do "THIS STOCK IS GOING TO THE MOON" type garbage but its dishonest at best and I am not gonna do that. So I would want to do more fundamental concepts which I do not yet have a truly deep understanding of. So honestly, probably later this year after I have more experience and more time to read/learn.

    • @bashscript2805
      @bashscript2805 Год назад +1

      @@bmdavis419 Can you share resources where you learn investing?

    • @bmdavis419
      @bmdavis419  Год назад

      @@bashscript2805 I read a lot of books, as far as YT channels go this is one of my favorites: ruclips.net/user/TheSwedishInvestor