How GO Was Created - Less Is More | Prime Reacts

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ก.ย. 2024
  • Recorded live on twitch, GET IN
    / theprimeagen
    Article: commandcenter....
    Written by: Rob Pike
    MY MAIN YT CHANNEL: Has well edited engineering videos
    / theprimeagen
    Discord
    / discord
    Have something for me to read or react to?: / theprimeagenreact

ความคิดเห็น • 357

  • @artifishul
    @artifishul ปีที่แล้ว +349

    After all of ThePrimeagen content I've watched, turns out this is my favorite format. I always want to make more time to read content like this anyway. Getting it in this format with your commentary is gold

    • @spikespaz
      @spikespaz ปีที่แล้ว +10

      He has (and voices) the obvious thoughts so I don't have to

    • @SpaceShot
      @SpaceShot ปีที่แล้ว +10

      He has the ability to speak to you on the same level as the author or article without apologies. If some of the concepts elude you (sometimes I'm not at the complete level of understanding on the particular topic) he says "hang on we're going full throttle anyways".
      At no time do I feel it is rude or obnoxious. I don't feel like it steals from the author. It's like hanging out in the next cubicle with him and that's a great feeling.

    • @aftalavera
      @aftalavera ปีที่แล้ว +2

      Brilliant!

    • @licokr
      @licokr 5 หลายเดือนก่อน

      Same here 💯

  • @jfdirienzo
    @jfdirienzo ปีที่แล้ว +109

    Go has a special place in my heart. I spent some time to get on the Rust train but in the end, when I need to get something done quickly, with a fairly decent performance... Go is the language I pick everytime, it's so easy and fun to write.

    • @cmelgarejo
      @cmelgarejo ปีที่แล้ว +7

      I agree with this, same for me

  • @lunafoxfire
    @lunafoxfire ปีที่แล้ว +22

    Go is like 30 amazing ideas to create the perfect language, and then like 2 bad ideas that make me absolutely hate using it, lol.

    • @hamm8934
      @hamm8934 ปีที่แล้ว +4

      Which features? I hate capital letters for exports

    • @minciNashu
      @minciNashu ปีที่แล้ว +5

      ​​@@hamm8934mplicit interfaces just rub me wrong, also codegen required to fill in gaps

    • @spell105
      @spell105 10 หลายเดือนก่อน +2

      @@minciNashu Implicit interfaces are awesome.

    • @electricant55
      @electricant55 3 หลายเดือนก่อน

      ​​@@hamm8934error handling

    • @tongpoo8985
      @tongpoo8985 หลายเดือนก่อน

      What features are those?

  • @pixoul2237
    @pixoul2237 ปีที่แล้ว +40

    "Perfection isn't achieved when there's nothing left to add, but when there's nothing left to remove."

  • @schneefackel7053
    @schneefackel7053 ปีที่แล้ว +25

    Rob "who would ever use map() and filter() instead of _for_ loops" Pike retired a few months before Go got generics. Coincidence?

    • @jepemz873
      @jepemz873 ปีที่แล้ว +5

      Exactly. Generics were necessary for built in collections but for a long time off limits to everyone else. Golang is ridiculously verbose for these use cases.

    • @isodoubIet
      @isodoubIet ปีที่แล้ว +3

      That last paragraph is truly baffling. What does he think abstractions are for if not to reduce programmer effort?

  • @KevinLyda
    @KevinLyda ปีที่แล้ว +1

    Just as an aside, the original pager on Unix was pg. But then someone wrote "more" - named because of its UI where it prints "More" at the bottom of the screen. But you couldn't go backwards on pipes. So someone wrote "less" that could do that - named because less is more.

  • @seanknowles9985
    @seanknowles9985 ปีที่แล้ว +4

    Would love a course and deep dive on Javascript workers/threads/async etc... When and how to use worker threads, use cases with efficient practical algos that we'd use in the wild to make javascript performant in certain situations. There's definitely a market for a course like this.

    • @raianmr2843
      @raianmr2843 ปีที่แล้ว +1

      man ive been looking for something like this since forever

    • @seanknowles9985
      @seanknowles9985 ปีที่แล้ว +1

      @@raianmr2843 Same!

  • @lashlarue7924
    @lashlarue7924 7 หลายเดือนก่อน

    The article and the Take basically nailed it. If you're a Python dev and you just want to increase your speed a bit without having to completely worry about too many leg cannons, why would you bother to learn C++? It's the same reason some other large platforms (which shall remain nameless) don't get adopted - you have to devote your entire existence to learning that tool. I don't even need a better tool than Python at this point for what I do; the need simply doesn't exist in my world and it never will.
    But if you devoted your entire existence to learning how to write clever code that manages memory directly, why would you ever want to give that up? Of course you wouldn't!
    Time will tell.

  • @srijanraghavula
    @srijanraghavula 4 หลายเดือนก่อน

    chat never fails to be in either completely sync with prime or completely out of sync with prime. He's tryna read something seriously and chat just makes fun and vice versa. Such a good channel btw.

  • @kevinb1594
    @kevinb1594 ปีที่แล้ว +15

    I would love to hear a detailed rant on the over expressiveness of Typescript. I'm a JS/GO dev and I know the benefits of a type system but I absolutely HATE typescript and have a hard time explaining why. I thought it was originally because I hated typed languages but I love GO. It is specifically TS.

    • @taragnor
      @taragnor ปีที่แล้ว +4

      Well TS is clunky, because it has to abide by the rules of Javascript. So that really holds it back.

    • @oscarljimenez5717
      @oscarljimenez5717 ปีที่แล้ว +2

      TS is nice if you use it right, but that's the problem, you can use it bad in too many ways :). Also if you think TS from a C++/Go/Rust perspective, you miss the point of the language.

    • @beastofthenumber6764
      @beastofthenumber6764 ปีที่แล้ว

      ts type system is more like java thats why

    • @oscarljimenez5717
      @oscarljimenez5717 ปีที่แล้ว +2

      @@beastofthenumber6764 not is not, is nothing like Java, maybe if you only use interfaces?. If you use interfaces for TS, you're using it wrong again. And you go back to my previous comment, too many ways of using it wrong.

    • @beastofthenumber6764
      @beastofthenumber6764 ปีที่แล้ว

      @@oscarljimenez5717 i agree they can be used better, but the "wrong" way is the intended or at least the more promoted way. Even in java you can construct classes in ways that are better but almost nobody does.

  • @cmelgarejo
    @cmelgarejo ปีที่แล้ว +1

    I can see ThePrimeagen loving go a bit more down the road

  • @StrengthOfADragon13
    @StrengthOfADragon13 6 หลายเดือนก่อน

    I worked at a company that used Go while I was getting my undergrad. Having graduated and spent almost as much time in industry as I did getting my degree I think I need to revisit Go. Java was my undergrad, and it's much of what I do at my current job, but I'm starting to see it's many issues (not sure how many of the issues in my current project stem from the fact that I'm the most experienced dev on my team though)

  • @EMWMIKE
    @EMWMIKE ปีที่แล้ว

    "Less is more" is the slogan for a Swedish toilet paper/paper holder company. Used in companies and public places. It is stamped on their equipment :)

  • @porttikivi
    @porttikivi 11 หลายเดือนก่อน

    Three computer science articles, ever, stand on top for me: Ken's "Reflections on Trusting Trust", Hoare's "Emperor's Old Clothes" and this "Less is exponentially more".

  • @Robert-ht5kd
    @Robert-ht5kd ปีที่แล้ว +70

    Good luck Michael on convincing JS programmers to use such a complictaed language like Rust in their work :)

    • @Debianz
      @Debianz ปีที่แล้ว +4

      True, most JavaScript programmers don't have the intelligence to learn anything harder.

    • @KadenCartwright
      @KadenCartwright ปีที่แล้ว +26

      @@DebianzI hope this comment made you feel better about yourself

    • @Debianz
      @Debianz ปีที่แล้ว +4

      @@KadenCartwright Welp boys, we have our first JavaScript programmer. I'm sorry that your programming career is limited to the lack of brain matter in your head. I learned Python at the age of 11 and JavaScript at the age of 13. The language has it's uses, but people who make a career out of just JavaScript (other than frontend people, they don't have a choice) clearly have the intelligence of a 13 year old.

    • @EluLawlielt
      @EluLawlielt ปีที่แล้ว

      @@Debianz You know you really don't need to validate your existence by putting down others for choices they most likely didn't make? I know and have used many languages both in side projects and production code, you learn to take something valuable from all of them. Would you say someone like Rich Harris has the intelligence of a 13 year old? Or a myriad of devs working on hundreds, if not thousands, of apps that service millions of people using JS are also comparable to 13 year old? Do you think software like Slack, Discord, Chrome to some degree, the app where you're reading this very comment are products of a bunch of dumdums? A senior level, or even mid level, JS programmer would be perfectly capable of coding in most languages given some time - problem solving skills are not tied to the language after all.

    • @redyau_
      @redyau_ ปีที่แล้ว +29

      ​@@DebianzWho are you writing this to? Do you think this toxic vibe is what is cool?

  • @flyinginthedark6188
    @flyinginthedark6188 ปีที่แล้ว +27

    I don't agree, adding atomics to C++ (and the memory model in general) is the best decision ever made by C++ committee. This solved so much broken code and allowed us to write code that is portable on x86_64 and arm platforms.

    • @EmiNNsoNify
      @EmiNNsoNify ปีที่แล้ว

      Quick question - what was the big problem with porting before atomics? Asking because the Linux kernel is written in C and is by far the most ported project ever.

    • @vadzimdambrouski5211
      @vadzimdambrouski5211 ปีที่แล้ว +6

      ​@@EmiNNsoNifyConcurrency primitives in the Linux kernel are not portable by definition. If you try to use them in some other project it won't work because they rely on specific compiler flags and/or make assumptions about the kernel environment which may not be the same for other projects.
      Also before introduction of the memory model a lot of gcc optimization passes broke and miscompiled the concurrent code. Because without a memory model it's not possible to answer if a specific optimization (which could be perfectly fine for a single threaded code) is not valid when executed concurrently from another thread.

    • @EmiNNsoNify
      @EmiNNsoNify ปีที่แล้ว +1

      @vadzimdambrouski5211 @bbourbaki Okay, fair points! My point was more on the "Linux kernel is massive project which is in C and you don't see them yearning for atomics." Should have been more explicit.

    • @DmytroDukov
      @DmytroDukov ปีที่แล้ว +2

      yep, there's a reason why Rust took it practically as-is. I also disagree with that take on atomics (although they are certainly not the easiest part to grok)

  • @pieterrossouw8596
    @pieterrossouw8596 6 หลายเดือนก่อน

    Came from a Java and C# enterprise world, used some Python for side stuff. Now I really feel like Go can give me the performance and type safety I miss from Java and C# but with some of the simplicity Python made me appreciate

  • @benlevy1896
    @benlevy1896 ปีที่แล้ว +2

    I don't know that procedural programming is strictly more natural than functional, though some things are naturally sequential in nature and therefore procedural fits better for those. I think it really is an exposure thing, the classic example being to ask students how to make a peanut butter and jelly sandwich.

    • @ThePrimeTimeagen
      @ThePrimeTimeagen  ปีที่แล้ว +3

      this is a great thing to watch, but its not a great argument.
      recursive thinking is definitely not a natural format, procedural is something we do with a _LOT_ of brain filling in the gaps

    • @LambdaCalculator
      @LambdaCalculator ปีที่แล้ว +3

      ​@@ThePrimeTimeagenThis is an apples-to-oranges comparison. Strict FP may require recursion, but most functional code out there doesn't explicitly use it (preferring higher level abstractions like map/fold/reduce/etc instead). To make it a fair comparison, you'd have to compare strict functional code with strict procedural code, which would look more like assembly and preclude much of the common usage of functions found even in a language like C. And obviously, even the strictest functional code still has elements of procedural style in the way function calls are arranged and executed sequentially (though Haskell does complicate that a bit more with it's laziness).
      Point being: the whole Functional vs Procedural thing is just a poor dichotomy all around. You can't really produce good code with just one or the other, because they never existed in mutually exclusive vacuums to begin with. Good code is eventually going to rely on both styles where appropriate.
      However, functional style building blocks do become more useful the higher up you go on the abstraction ladder. And I don't mean pointless java-style "abstractions", but rather layers in a properly segmented cake-like architecture, more like the abstraction that occurs when going from ASM -> C -> Python (ie. stratified design). Procedural methods become more limiting the further up you go in abstraction because they were designed to work with lower-level primitive values. Thus when you try to make higher level abstractions work procedurally, you're forced to expose a lot more internal implementation details to enable working with them, which means leaky abstractions, more cognitive overhead for the developer, and prevents the formation of properly stratified layers.
      You might think to yourself "That's absurd. I code procedurally all the time and can still separate everything well with good API boundaries". But if you look at the situation closer, you'll notice that the entire concept of an API boundary is actually more functional than procedural, because you're asking the API to do something for you as opposed to telling it how to do it (ie. a function call as opposed to a GOTO). Which goes back to my original point about there not being any actual hard-and-fast separation between the two.

  • @homelessrobot
    @homelessrobot ปีที่แล้ว

    and on the technical debt of types? Yes. The closer a type system gets to turing completeness, the more expressive it is necessarily. But if your type system is subject to the halting problem, there are now some perflectly valid types you can express that no compiler can compute.

  • @AsbestosSoup
    @AsbestosSoup ปีที่แล้ว +1

    There's always the argument of whether the goal justifies the means, but so far Go seems to tackle both with its great performance. Rust can do the same, if you grind enough to get used to it

  • @freeworld777
    @freeworld777 ปีที่แล้ว +1

    Desiderata: Original Text
    This is the original text from the book where Desiderata was first published.
    Go placidly amid the noise and the haste, and remember what peace there may be in silence. As far as possible, without surrender, be on good terms with all persons.
    Speak your truth quietly and clearly; and listen to others, even to the dull and the ignorant; they too have their story.
    Avoid loud and aggressive persons; they are vexatious to the spirit. If you compare yourself with others, you may become vain or bitter, for always there will be greater and lesser persons than yourself.
    Enjoy your achievements as well as your plans. Keep interested in your own career, however humble; it is a real possession in the changing fortunes of time.
    Exercise caution in your business affairs, for the world is full of trickery. But let this not blind you to what virtue there is; many persons strive for high ideals, and everywhere life is full of heroism.
    Be yourself. Especially do not feign affection. Neither be cynical about love; for in the face of all aridity and disenchantment, it is as perennial as the grass.
    Take kindly the counsel of the years, gracefully surrendering the things of youth.
    Nurture strength of spirit to shield you in sudden misfortune. But do not distress yourself with dark imaginings. Many fears are born of fatigue and loneliness.
    Beyond a wholesome discipline, be gentle with yourself. You are a child of the universe no less than the trees and the stars; you have a right to be here.
    And whether or not it is clear to you, no doubt the universe is unfolding as it should. Therefore be at peace with God, whatever you conceive Him to be. And whatever your labors and aspirations, in the noisy confusion of life, keep peace in your soul. With all its sham, drudgery and broken dreams, it is still a beautiful world. Be cheerful. Strive to be happy.
    by Max Ehrmann ©1927

  • @glauco_rocha
    @glauco_rocha ปีที่แล้ว +3

    Just so you guys know a little piece of ultra nerdy trivia: desiderata (from the italian, meaning "those who are desired") appears in another article that Rob Pike wrote about how UTF-8 was created by him and Ken Thompson.

  • @Jarek.
    @Jarek. 8 หลายเดือนก่อน +1

    As somebody said... *Go is built for grug brained programmers* (like me). Or saying differently: *Go is for old, grumpy man* who grew up in 80-90 on their old Atari, Commodore or ZX spectrum.

  • @homelessrobot
    @homelessrobot ปีที่แล้ว

    Yeah. Ruby was the rust of my generation. back when people in the indie-lang space thought there was a right way to do OOP. I imagine we will eventually arrive at a similar situation for rust things where we are like "Yeah that was an embarassingly long and windy dead end."

  • @emjizone
    @emjizone ปีที่แล้ว

    19:56 My more generic feeling about this is: *No classification changes what things are.*
    And my politics would be: *Qualify rather than classify.*
    If it quacks like a duck, walks like a duck, and flies like a duck, maybe it's *still not* a duck, but maybe *we don't care* because all we need to know is *it can do it.*
    All we actually need is to assert that the thing *comply* with a bunch of criteria.
    Now, before you invent more types than in _Rust_ , remember the number $n$ of types you can make with $c$ independent criteria is $n=2^c$. This is already *too much* to pre-define in a programming language syntax.
    And also, keep in mind that, inside the binary machine, the only actual type is *positive integer* .
    *Any other type is simulated* by tagging some positive integer with purely *arbitrary* meaning.

  • @kc3vv
    @kc3vv ปีที่แล้ว +1

    Isn't Go's concurrency model similar to Erlang's?

    • @kawo666
      @kawo666 ปีที่แล้ว

      CSP vs Actor’ish

  • @BreytnerNascimento
    @BreytnerNascimento ปีที่แล้ว +2

    Functional with a bit of classes here and there will win in the end.

    • @maxnew453
      @maxnew453 ปีที่แล้ว +1

      You mean something along the lines of Scala ?

  • @LusidDreaming
    @LusidDreaming ปีที่แล้ว

    Implicit casting 32 to 64 is all fun and games, until you're working with an in house serializer and suddenly can't figure out why the client is getting errors trying to deserialize

  • @maf_aka
    @maf_aka ปีที่แล้ว +3

    how is implicit interface in Go a good thing? AFAIK it's the only language that does this and it's confusing for me.

    • @danielsharp2402
      @danielsharp2402 ปีที่แล้ว

      Actually typescript does thing like this. They call it structural typing.

  • @harshitarora693
    @harshitarora693 ปีที่แล้ว +3

    I just started learning a language after like 1 year of doing nothing(I'm actually in Cyber Security so I was busy just reading codes and I got sudden interest in go lang when randomly reading code in some vulnerable machine) and now watching this lol

  • @tywky
    @tywky ปีที่แล้ว

    This article describes me. Python as native language and switches to Go for concurrency fun.

  • @RicardoSuarezdelValle
    @RicardoSuarezdelValle 4 หลายเดือนก่อน

    Am I crazy or cant there just be a lang that does it all? interpreted, compiled, types, no types, etc and just have the programmers that use it choose how to use it

  • @Megalcristo2
    @Megalcristo2 ปีที่แล้ว +1

    Wait, you understand Rust borrowing system, but you don't understand rvalue references? The borrow checker is exactly the same as rvalue reference but with the compiler making sure you are doing it right

    • @elcugo
      @elcugo ปีที่แล้ว

      I think the problem is the name, borrow checker just checks borrow, but a rvalue reference? What the heck is a rvalue and why are you referencing it?

    • @infastin3795
      @infastin3795 ปีที่แล้ว

      ​​@@elcugo"rtfm lol"

    • @isodoubIet
      @isodoubIet ปีที่แล้ว

      @@elcugo rvalue references make perfect sense apart from the fact that value categories are distinct from types and you can have an lvalue of type rvalue reference and vice versa. That is the single most confusing aspect of the whole thing. Conceptually though, it's actually pretty simple, it's an rvalue because it's the sort of thing that goes on the right hand side of an assignment, which is 'just' a way to detect when references point to temporaries.

    • @elcugo
      @elcugo ปีที่แล้ว

      @@isodoubIet I know what rvalue references are, but the explanation just gave sounds like technobable to anyone that isn't already entrenched into C++. Thinking about a better name I came out with "ownership transferring references" which isn't a great name especially since it isn't accurate because moves may or may not happen.

    • @isodoubIet
      @isodoubIet ปีที่แล้ว

      @@elcugo The problem with other more descriptive names is they lose accuracy. Maybe that particular ship sailed with std::move but an rvalue, to me, doesn't imply ownership will be transferred. It just means I shouldn't rely on the object living past the semicolon.
      I will never understand the lvalue - glvalue vs prvalue - rvalue dichotomy though. Seems pretty silly and inconsistent.

  • @divelix2666
    @divelix2666 ปีที่แล้ว

    who is the author of this article?

  • @Apoque
    @Apoque ปีที่แล้ว

    Since your saver broke I bet it's time for you to take that Henson Shaving sponsorship.

  • @paivacn08
    @paivacn08 ปีที่แล้ว +1

    I know templates are terrible designed in C++, but the idea behind metaprogramming is good per se for me. Maybe generic as Java and Rust are just enough.

    • @BosonCollider
      @BosonCollider ปีที่แล้ว +1

      This. The point of a type system with generics is that static type systems may not give you more expressiveness than a dynamically typed language, but if you don't include generics they can definitely reduce expressiveness a lot. It isn't so much about taxonomy as just making many functions impossible to write.

  • @schneefackel7053
    @schneefackel7053 ปีที่แล้ว +9

    As appropriate as Go may be for some tasks, I'm pretty sure it was the last time a language with no immutability, no generics, and pedestrian error handling gets successfully forced into this industry.

    • @hamm8934
      @hamm8934 ปีที่แล้ว +1

      It’s had generics for a while

    • @spell105
      @spell105 10 หลายเดือนก่อน

      Pedestrian error handling is just better. Exceptions are a disaster on the level of nullability... if not worse.

    • @schneefackel7053
      @schneefackel7053 10 หลายเดือนก่อน

      @@spell105 I was thinking more like Rust's `?` operator or Zig's `try` keyword, not exceptions.

  • @aftalavera
    @aftalavera ปีที่แล้ว

    Do we realize that when working for a big company, we are just smaller pawns? Do we?🤔

  • @emjizone
    @emjizone ปีที่แล้ว

    8:48 @ThePrimeTimeagen
    Desiderata: an expression of the *desired* . The things you want to *rest* on.
    learn some latin.

  • @danielsharp2402
    @danielsharp2402 ปีที่แล้ว

    Go is a dumbed down language, ofc people who have programmed C++ wouldnt jump ship. Their only selling point is easy and faster than dynamic.

  • @AsbestosSoup
    @AsbestosSoup ปีที่แล้ว

    I thought C++ was meant to modernize C and fix its tediousness, not make me reconsider if I'm studying the right major and make me want to code everything in Lisp. Rust-- has striven too far

  • @isodoubIet
    @isodoubIet ปีที่แล้ว

    user defined literals really are awesome though. Yes I copiumed myself pretty hard into loving C++ but there's just something beautiful about writing code like
    std::this_thread::sleep_for(100ms);

  • @NathanHedglin
    @NathanHedglin ปีที่แล้ว

    Either you GO or you Rust waiting for the compiler

  • @kippers12isOG
    @kippers12isOG ปีที่แล้ว +1

    No const is lame

  • @nordgaren2358
    @nordgaren2358 ปีที่แล้ว

    Oh god. You're calling me out about Rust. Stop.

  • @bozhidaratanasov7800
    @bozhidaratanasov7800 ปีที่แล้ว +1

    What does he mean by "I ... failed to find a way to bring the ideas to C++"? The original Go compiler is written to C, so he DID find a way. Liar.

    • @lunafoxfire
      @lunafoxfire ปีที่แล้ว

      i cant tell if you are very confused or making a joke

    • @bozhidaratanasov7800
      @bozhidaratanasov7800 ปีที่แล้ว

      @@lunafoxfire Why not both?

  • @yaksher
    @yaksher ปีที่แล้ว

    "Memory is always zeroed" is dumb I think, tbh. Either go all the way, like Rust or even Julia, which just say "memory must always be explicitly initialized, unless you want to jump through hoops to use undefined memory" (easier in Julia than in Rust; Julia has an "undef" value you can initialize with to skip initialization) or just stick with C's approach. Rust also has, y'know, the concept of "default" values for types, which you can use for this too. 0 is not a universal default and you're not actually fixing any bugs by making 0 initialization. I'd say "adding shorthand for 0'd memory is reasonable" but funny that... C has this? Like, for stack values `x = {0}` will create a zeroed struct or array (or just an empty initializer), because partial initialization initializes everything else to 0 (which is a little dumb for the same reason, but it is what it is lol, C has many such problems) and `calloc` exists for memory. The problem, in the end, is not "using memory which isn't 0", it's "using memory which isn't initialized to be correct" and just because 0 is often a valid value/reasonable default doesn't mean it always is and you're just encouraging bad practices.
    A lot of the other choices I find pretty dumb too-case sensitive visibility is frankly horrifying, for example.
    Having post-increment/decrement at all without them being expressions seems pointless; like, in C they're used very frequently as expressions to substitute for lack of some other features like iterators or whatever (stuff like `while ((c = *s++)) {...}` to traverse a string). If you don't allow them to be expressions, it honestly seems like extraneous syntax over just using `+= 1`. There's a reason none of Rust, Python, and Julia have it.
    "No constructors or destructors" seems really annoying for some stuff, though I suppose that since the language is garbage collected, relying on destructors for stuff like closing files works worse than it does in Rust since you usually want to close the file as soon as you're done with it (which would have to be explicit anyway) rather than "I dunno, at some point." Still, I'm a fan of resources being directly associated with the object and requiring that destruction code be done explicitly for everything except memory seems really weird to me. Like, sure, it's better to explicitly close the file immediately, but why allow resource leaks when you could not do that. Go does concurrent garbage collection, so requiring the garbage collector to run potentially expensive destructor/cleanup operations isn't going to cause major performance hitches.
    "Legal to take address of local variable" uhhh... it's legal in every language I'm aware of which has a "take the address" operator? Hell, it's an extremely common C paradigm. Unless they mean it's legal to return it, in which case... that's just implicit heap allocation, which is fine I guess because it's a garbage collected language anyway, but also true in more or less every garbage collected language I'm aware of.
    "No 'this' in methods" yeah instead they made special syntax for specifying it and let it have an arbitrary name, which is both less convenient and less consistent than a self argument like in Rust or Python. I'll grant that it's better than what Java and C++ do, but I think I like what Rust and Python do with the self-argument much better.
    Empty interfaces as a replacement for void * seems terrible too, tbh. C not having any kind of generics is like... arguably its biggest weakness as a language, tbh. The use of `void *` is both bug prone and costs performance. A strong system for generics is incredibly useful and powerful.
    "No exceptions" except you have panics which can be recovered from, but sure, I guess lmao.

    • @kippers12isOG
      @kippers12isOG ปีที่แล้ว

      Memory not being zeroed can save some perf, sure, but I unzeroed memory _can_ in specific circumstances being a security issue, although I actually agree with your point.
      If you never have addresses of local variables escape, static analysis becomes soooooo much more effective.
      Pythons self argument is only "self" by convention. It can be any name you want too.
      I think the point about panics is a bit off. If I wrote a program without exceptions in C++, but I registered signal handlers, by that logic, it would still have exceptions? I disagree. Exceptions handle common errors and are in much less of a special state. Panics are usually fatal, but making some of them non-fatal is not equivalent imo, even if the flavour is similar.

    • @kippers12isOG
      @kippers12isOG ปีที่แล้ว

      (Please forgive my typos)

    • @yaksher
      @yaksher ปีที่แล้ว

      @@kippers12isOG Not zeroing memory can be a security vulnerability, yes, but like... so are a lot of things. This is not a major thing, and I suspect Go does zeroing things out on initialization, rather than on free, so you're not fully avoiding that issue anyway.
      And generally, in C and whatever, local variable addresses become invalid because they're placed on the stack for efficiency. Not putting them on the stack is losing that efficiency.
      Huh, I didn't realize "self" was a convention in Python but I suppose that actually makes sense; you have decorators for static methods.
      Ehhh, I would say that if you write C++ code which doesn't use exceptions but registers signal handlers and then calls into those signal handlers intentionally when it hits an error and then does some incredibly cursed shit to resume execution further up the call stack and not on the instruction which created the signal, and whatever, then yes, that C++ code is using exceptions, except even worse. If you register a signal handler to handle SIGINT because you want to do additional confirmation on exit or whatever, then no, you're not doing exceptions, because it's not filling the role of exceptions. That said, I will admit that it seems it's not a common Go paradigm to use panic and defer recover for non-fatal errors and you do use error returns for the most part, so I'll admit that while it's supported, it's not really meant for that and not really used, and even Rust lets you recover from panic in some conditions.

  • @laughingvampire7555
    @laughingvampire7555 7 หลายเดือนก่อน

    if all you know about types is C++ or Java then you know nothing about types.
    In Java is about Taxonomy but in Rust & Haskell isn’t.
    Having this opinion about types is like a Socialist thinking Capitalism is just about exploiting, is the experience of the ignorant who only was exposed to bad models.
    comparing types in Java to types in Haskell is like comparing a moped to a pickup truck or an SUV

  • @elchape
    @elchape ปีที่แล้ว

    reasonML sucks

  • @sebastianhama5624
    @sebastianhama5624 ปีที่แล้ว +1

    rust is just C++ for weenies who care about "memory safety"

    • @rusi6219
      @rusi6219 5 หลายเดือนก่อน

      So manchildren who've never learned where to switch on compiler flags.

  • @estring69
    @estring69 ปีที่แล้ว +1

    So funny. Yeah. I am not a programmer, but use Python. I am looking at GO to have some of my often used templates for configuration files to be compiled and executable. This so other people who don't have a Python environment can use the templates to generate the configuration files.

    • @estring69
      @estring69 ปีที่แล้ว

      So yes. go takes yaml config to struct to text template print or file output easily. And compile to exe

  • @Ellefsen97
    @Ellefsen97 ปีที่แล้ว +85

    I only understand around 20% of the articles Primeagen reads, but I still find it fascinating

    • @ThePrimeTimeagen
      @ThePrimeTimeagen  ปีที่แล้ว +42

      :)

    • @alexandersemionov5790
      @alexandersemionov5790 ปีที่แล้ว +9

      Remembering what you don't know will make you learn it better down the road

    • @lashlarue7924
      @lashlarue7924 7 หลายเดือนก่อน

      @@alexandersemionov5790 I honestly believe this.

  • @TechdubberStudios
    @TechdubberStudios ปีที่แล้ว +52

    Your content is getting better and better. I loved this particular video and the Rich Harris ones so far.

  • @nixoncode
    @nixoncode ปีที่แล้ว +92

    I think Golang is the next best language for your team if you're moving from a dynamic language, if you use py, ruby, js or any other dynamic language in the backend. try golang, we started using it to run our backend daemons with redis and MySQL, trust me. since we moved from long running processes in PHP, and legacy Java to go... the rest of the team has been calm and anyone is able to troubleshoot problems, over the past year. I feel like we've been so productive with go, even with our new developers, straight from Uni are able to understand production code and be able to contribute significantly to the team.
    i love go, and am the project manager. so get on with it team

  • @MrAlanCristhian
    @MrAlanCristhian ปีที่แล้ว +16

    I think that the python software foundation is in the "more feature" train right now.

  • @wcrb15
    @wcrb15 ปีที่แล้ว +30

    Every time I read/listen to stuff about Go I gain more respect for it. It's very quickly becoming my favorite language to write in.

  • @daltonyon
    @daltonyon ปีที่แล้ว +7

    Everyday i love more Go lang, there is a lot of good stuffs. I want know MORE MORE MORE

  • @mkvalor
    @mkvalor ปีที่แล้ว +4

    Go was touted as a "systems" language back then. Very few agreed because... gc.

  • @natrixnatrix
    @natrixnatrix ปีที่แล้ว +2

    I almost got into Go but got turned off by the stupidity of the date formating.

  • @massy-3961
    @massy-3961 ปีที่แล้ว +4

    Theprimeagen is slowly converting to a gopher

  • @TheBuzzSaw
    @TheBuzzSaw ปีที่แล้ว +3

    The argument against generics is a strange one. My love of generics in other languages has little (nothing?) to do with inheritance or subclassing. I want my data structures to be strongly typed; that's all. I want to be able to create a ConcurrentRingBuffer or whatever. Go didn't let me do that.
    I also just don't understand this arrogance. (Yes, it's arrogance.) The language creators kept the power of generics for themselves. Go has generic arrays, maps, and channels. If generics are so terrible, why not return to the Java 1.0 days where arrays and maps just use Object for everything? OBVIOUSLY, strong typing is a good thing.

    • @spell105
      @spell105 10 หลายเดือนก่อน

      I'd rather a language creator is arrogant and sticks to a vision and design philosophy, than for a language to throw in every feature ever. You wanted strongly typed generics? C++ is right there for you.

    • @jonaskoelker
      @jonaskoelker 2 หลายเดือนก่อน

      > The argument against generics is a strange one.
      It's because it isn't one. I didn't notice a single thing to do with generics in that section of the article. It was 100% an argument against inheritance, which was not what was asked about.
      The word 'strawman' springs to mind-or, more charitably, 'misunderstanding'.
      Of course, if I go with the charitable interpretation I conclude that Go is designed by people who don't know the difference between inheritance and generics.

  • @Rohinthas
    @Rohinthas ปีที่แล้ว +15

    This type of video is your peak-youtube-content to me. I am too adhd to get through full articles on my own and *actually* consider their implications, I need some way to actively engage with them and I dont have people around who are into this stuff. When you read the articles and think about them out loud my brain starts to engage as well and I actually pull up passages to re-read and think about them myself. Thanks buddy, you make learning fun for me!

    • @babc142
      @babc142 ปีที่แล้ว

      Snap, well put

  • @andythedishwasher1117
    @andythedishwasher1117 ปีที่แล้ว +16

    Typescript is basically like trying to polish a turd, failing miserably, and then covering up the turd with a convincing image of a clean floor for someone to step in later.

  • @mike200017
    @mike200017 5 หลายเดือนก่อน +1

    I think the answer is simpler than that. While trying to sell a new language to C++ programmers, the moment you pronounce the words "garbage collector" or "no RAII", you've pretty much lost 90% of them already.

  • @michaelslattery3050
    @michaelslattery3050 ปีที่แล้ว +1

    It's too bad Nim hasn't gotten more adoption by Python refugees.

  • @esra_erimez
    @esra_erimez ปีที่แล้ว +8

    My dad was a developer when C++ first came out. It was a transpiler at the time, it converted C++ to C then you compiled that. He remembers thinking it was a good idea at the time. But, it never evolved into what it could have been. It lacked standards such as an object model, libraries, etc. Java would come along and fix issues like these but at the cost of having to use a JVM with an interpreted language. C++ has too many traps and pitfalls and makes you have to program defensively.

    • @isodoubIet
      @isodoubIet ปีที่แล้ว +2

      skill issue honestly

    • @totof2893
      @totof2893 ปีที่แล้ว

      You need to test modern C++. The language has really changed. Most error prone stuff have disappear. It still requires some discipline with beginner, but when you are used to it, memory issue become very rare.
      With the invention of RAII, managing ressources (not juste memory, but connection, file, etc...) is easier than Java/Python.
      With the notion of rvalue, you have the notion of move instead of copy which avoid putting pointer/reference everywhere like Java and Python do by default.
      Now every life cycle is related to the stack and thus automatically freed by compiler at correct time.
      Lambda makes easier to write functor and functional code.
      Constexpr enables adding logics and interface at compile time instead of doing virtual polymorphism.
      And all the nice addition like std::variant (a easy to use sum type), std::tuple, std::optional to better represent data instead of horrible void* or Java everything is an Object.
      Still Rust refined those ideas and does even better.
      For example, due to backward compatibility, C++ is copy by default. While Rust is move by default, which enables to hide the l-value/r-value concept most of the time.
      Rust is const by default, C++ needs to have const everywhere.
      And Rust has lifecycle check which is very useful to avoid multi-thread issue and dangling reference. Even if modern C++ has less and less memory issue, it can still happen when beginner code like Java in C++. Rust completely avoid that by throwing a compilation error.
      And the memory model of Rust is far better than C++ unchecked exception or Java checked exception because it is directly using the return value. It becomes very easy to combine with functional code.

    • @vikramkrishnan6414
      @vikramkrishnan6414 ปีที่แล้ว

      With smart pointers and STL a lot of these problems don't exist

    • @lashlarue7924
      @lashlarue7924 7 หลายเดือนก่อน

      @@isodoubIet No, that's a biased take. The point of any language should be to increase productivity - not to raise artificial competitive barriers to entry that increase YOUR relative pay grade because it shuts out other humans from being productive due to a high learning curve. THAT is the truth.

    • @isodoubIet
      @isodoubIet 7 หลายเดือนก่อน

      @@lashlarue7924 Who said anything about "artificial competitive barriers"? C++ is a language that lets you be extraordinarily productive. Complaining about "pitfalls" that are mostly very easy to learn and avoid is a skill issue, sorry to say.

  • @neilcarrier1620
    @neilcarrier1620 ปีที่แล้ว +3

    "Features will continue until productivity improves."

  • @rogergalindo7318
    @rogergalindo7318 ปีที่แล้ว +3

    is his argument really against haskell/rust? he seems to talk mostly about type hierarchies, in the sense of classes/superclasses/subclasses… maybe it could be said that of typeclasses and traits, but, not really… types, at least in haskell, don’t have any “hierarchy” in the sense that he seems to talk about.

    • @rogergalindo7318
      @rogergalindo7318 ปีที่แล้ว +2

      if anything, go is more similar (in spirit) to haskell and rust, since he talks about what makes it different is the compositional nature of interface methods

  • @ardnys35
    @ardnys35 ปีที่แล้ว +2

    i want to change to that direction. like Rust is very interesting with all the features, it's like finding yourself in a baggage claim conveyors in airport but all sorts of japanese vending machines come from the belt instead of luggage. it's all interesting and nice to learn but also confusing and complicated.
    especially with my lack of expertise. perhaps it's more effective to learn it after more programming experience.
    i went back to C to smell the machine a bit more and solidify the basics. honestly go sounds more and more compelling, especially if it's that easy to learn. it's probably better to work on the languages i know for now but maybe like next year i'll slowly learn Go

  • @LambdaCalculator
    @LambdaCalculator ปีที่แล้ว +2

    Reminds me of the "Worse is Better" lore in the Lisp world. You should really consider reading some of Richard Gabriel's essays if you liked this one.

  • @mashebemunalula8901
    @mashebemunalula8901 8 หลายเดือนก่อน +1

    This has me interested in c++

  • @orustammanapov
    @orustammanapov ปีที่แล้ว +3

    I'm yet to meet anyone in real life, who likes "letter case sets visibility"☺

    • @omeryehezkely3096
      @omeryehezkely3096 ปีที่แล้ว +1

      Hi!

    • @orustammanapov
      @orustammanapov ปีที่แล้ว +1

      @@omeryehezkely3096 Hi!

    • @WayneRadinsky
      @WayneRadinsky ปีที่แล้ว +1

      Hi!

    • @orustammanapov
      @orustammanapov ปีที่แล้ว +1

      @@WayneRadinsky Hi! ☺

    • @isodoubIet
      @isodoubIet ปีที่แล้ว +1

      I love how this guy lists that as a positive. Like, holy smokes what a misfeature

  • @captainfordo1
    @captainfordo1 ปีที่แล้ว +2

    Go is C for the web.

  • @alexandredaubricourt5741
    @alexandredaubricourt5741 ปีที่แล้ว +4

    Go is extremely unsafe. You can access nil pointer everywhere, nobody is going to warn you, you can partially initializw your structs and forget some fields. Just horrible.

  • @aftalavera
    @aftalavera ปีที่แล้ว +1

    That shit that you feel in Go; like something is missing, it’s on purpose thats the withdrawal effect. By the way OCAML is the new shiny object!

  • @trapexit
    @trapexit ปีที่แล้ว +3

    My problem with GoLang has always been the insular design of it. After it got some traction there were a lot of (poor) comparisons of GoLang and Erlang from, IMO, people rather ignorant of one or the other language. After a while I recall some of the Erlang communities' criticisms of Go's designs got back to core architects. The issue, from the Erlang folks, was ... why goroutines? Over the past 40 years there had been a lot of research into concurrency models and a fancier coroutine mechanism built into the language was better than nothing but Erlang and other languages / libraries had really powerful concurrency models that seemed to be entirely ignored in GoLang's design. And as I recall the response was kinda like: "we didn't look into the topic. :shrug:" I don't like that at all. In an age when concurrency is more important to make easier than any time in history and you spent time to design a language with concurrency built in... kinda important to do your homework. no?
    Erlang isn't perfect but when it comes to concurrency and general simplicity I absolutely adore it. You can understand the whole language without much effort. Worrying about contention rather than how to create the concurrency in the first place is truly game changing and I've never built distributed services more easily. Add in a fast built in serialization/marshaling library and simple technique for handling out of VM IPC... it is just a pleasure working with. I wish other languages took more of the Erlang communities' ideas. And I wish GoLang would have had actors instead of coroutines. You have languages like Pony that tried to go in an actor like direction but didn't get much traction.

    • @trapexit
      @trapexit ปีที่แล้ว

      Just saw @17:20 "Go's concurrency model might be the best ever."
      Can't agree even a little. It's not bad but actor systems, and proper scaffolding (like Erlang's supervisor module), are so much better for wide scale concurrency.

    • @spell105
      @spell105 10 หลายเดือนก่อน

      @@trapexit OK but no one cares about Erlang, sorry. It took a whole different language (Elixir) for people to care.

    • @trapexit
      @trapexit 10 หลายเดือนก่อน

      @@spell105 "No one cares..." Checks major apps used across the OSS world written in Erlang as are critical apps in multiple fields ... Yes, no one cares.
      Elixir is not all that much more than a syntax change. The fundamentals of Elixir are the same as Erlang. They run on the same VM. They have the same actor model because the VM is purpose built for concurrency. For Erlang. Elixir never would have existed had it not been for BEAM VM and the fundamental designs built into necessary to accomplish what it sets out to accomplish. It is why other platforms can't do the kind of concurrency models Erlang has. Why the Java Erlang implementation failed.
      If you want to be able to create fundamentally different patterns you have to often do fundamentally different things. And even when they fail to catch on they can provide a lot of value to others. So feel free to ignore alternative technologies but you aren't gaining anything from the ignorance.

  • @IvanRandomDude
    @IvanRandomDude ปีที่แล้ว +13

    I wish go had opinionated feature-rich web framework. Instead here I am, working on a project where I have to freaking write auth system wtf. Coming from aspnet core this is pain....

    • @mcspud
      @mcspud ปีที่แล้ว +8

      Bruh, don't be that guy.

    • @QckSGaming
      @QckSGaming ปีที่แล้ว +5

      You are not forced to write your own, there's a billion choices out there, and most are generally composed from standard interfaces so..

    • @IvanRandomDude
      @IvanRandomDude ปีที่แล้ว +5

      @@QckSGaming suggest some

    • @flarebear5346
      @flarebear5346 ปีที่แล้ว

      ​@@IvanRandomDudeif you can't even Google idk what to tell you.

    • @jugurtha292
      @jugurtha292 ปีที่แล้ว

      Pocketbass

  • @fennecbesixdouze1794
    @fennecbesixdouze1794 ปีที่แล้ว +1

    "Go has this python esque feeling to it" lmao, you could literally only be referring to the no-semicolons.
    Go absolutely doesn't feel like python at all.

    • @spell105
      @spell105 10 หลายเดือนก่อน

      I was about to say, Go feels and writes nothing like Python. Mostly for the better.

  • @achrefnasri8847
    @achrefnasri8847 ปีที่แล้ว +31

    go for me as a javascript /python programer is like my savior i dont give a damn about memory management (we deal with backend services here not developping an operating system )as long as i can ship my code faster with less bugs and more readable for my team i'm happy in short go for us GETS THE JOB DONE .

    • @flarebear5346
      @flarebear5346 ปีที่แล้ว +11

      Go is the balance we needed between performance and simplicity

    • @mgord9518
      @mgord9518 ปีที่แล้ว +10

      Memory management is pretty important when talking about performance
      And just because a language has a GC doesn't mean that you can completely forget about memory management

    • @achrefnasri8847
      @achrefnasri8847 ปีที่แล้ว +1

      I agree with you but I already came from garbage collected languages (js and python) performance is not my focus but faster code and ship time is

    • @hamm8934
      @hamm8934 ปีที่แล้ว +3

      Ah so you throw hardware at the problem ;)
      You absolutely need to handle memory in GC languages, I.e. through object pooling, especially in something like a web server with concurrency, I.e. one of go’s primary applications.

    • @achrefnasri8847
      @achrefnasri8847 ปีที่แล้ว +4

      @@hamm8934 if i want to go through that may well just code with Rust and frankly in the end of the day the gain is insignificant besides i want a finished working web app not a school project that may or may not be finished the next year

  • @_____case
    @_____case ปีที่แล้ว +3

    "Even if Node came with a singlular tool. Compilation, build, everything."
    That is what Deno is.

    • @ThePrimeTimeagen
      @ThePrimeTimeagen  ปีที่แล้ว +1

      i said node, and claiming another thing all togethre doesn't some how make node in one tool
      you require a reordering of the javascript ecosystem to be deno.

    • @_____case
      @_____case ปีที่แล้ว

      @@ThePrimeTimeagen Their Node compatibility is getting better each release, so maybe that won't be true forever.

    • @georgeokello8620
      @georgeokello8620 ปีที่แล้ว +1

      @@_____caseNodeJS will never correct the fundamental issue of JavaScript’s type system. That’s a language design problem and language design problems can only be solved my making a better language design not by micro-optimizations with intermediary tools.

  • @zhamed9587
    @zhamed9587 ปีที่แล้ว +5

    some golang "features":
    * no immutability qualifiers (const/final/readonly)
    * verbose and error prone error handling
    * terrible time package
    * no stack traces in errors
    * zero types are error prone
    * no default interface function implementation
    * generics are very weak
    * structural typing is a hack, and an annoyance in large code bases
    and many more

  • @nescafezos4265
    @nescafezos4265 หลายเดือนก่อน

    I never looked closely before into go and it's syntax. and after watching video I wondered how it is possible that it has no generics but is strongly typed lang. I checked and found that it has in fact "map[keyType]valueType" that is look to me as built-in generic. and makes me think it has no way to define custom generics but has built-in ones

  • @UGPepe
    @UGPepe ปีที่แล้ว

    13:29 why would that be surprising? what did you expect to happen and why? I bet you can't figure out better semantics without introducing a separate int type

  • @milankovacs4259
    @milankovacs4259 ปีที่แล้ว +1

    Can someone explain the joke at 3:18

    • @connormc711
      @connormc711 22 วันที่ผ่านมา +1

      Understanding something is not always breaking down into smaller and smaller parts. While you are reducing the subject you are increasing losing context. To really understand the world more you would find patterns and similarities and not fracture your understanding of the world

  • @mangalegends
    @mangalegends ปีที่แล้ว +1

    Everytime i hear about something the primeagen is doing at his job, i get a little envious at how interesting it sounds lol. I haven't done anything nearly that fun at my job...

  • @GoWithAndy-cp8tz
    @GoWithAndy-cp8tz 6 หลายเดือนก่อน

    desiderata is a kind of poem how to live in a good way, how to don't waste your lifetime and wisely make good things which supports others;) BTW letter case sets visibility is not good because in case you have to change certain function to be visible or not, you have to rename all places where particular function was invoked. It is unnecessary,time consuming and ant work.Cheers!
    BTW/IMHO Go is awesome anyway.

  • @silveradopunked8329
    @silveradopunked8329 หลายเดือนก่อน

    That "Ken" is Ken Thompson. The guy who wrote UNIX, B (which is the predecessor to C) and grep.

  • @nyahhbinghi
    @nyahhbinghi 7 หลายเดือนก่อน

    Receiver methods are nice. Since referencing `this` is awkward in subroutines. Go is mostly trash though.

  • @aftalavera
    @aftalavera ปีที่แล้ว

    Go has nothing to do with python. If any, Nim is a better python. Go is just nada it’s like another google wants to control you shit. Rust, that’s just woke!

  • @Qumeric
    @Qumeric ปีที่แล้ว

    Go is the epitome of midwit languages. I mean it's fine, it works, concurrency is great but it's just so unbearably mid

  • @hiphiphorhayy
    @hiphiphorhayy ปีที่แล้ว +1

    I've been looking for a back end language to learn now that I'm sure I don't want to do full stack development. I'm starting with JS because there's more resources out there but I'm planning to jump to Go once I got an idea of what I'm doing

  • @dd-v
    @dd-v ปีที่แล้ว +1

    After a LONG time trying to learn go I was moved into a position at worked where I NEED to learn Go and I'm so excited. This video arrived just in time for me

  • @onsearchfocus
    @onsearchfocus 8 หลายเดือนก่อน

    @ThePrimeTime What's with the selecting all but the first and last character in (almost) every text?

  • @rili136
    @rili136 ปีที่แล้ว +1

    can you make a video about qwik? thanks in advance

  • @MindBlowerWTF
    @MindBlowerWTF ปีที่แล้ว

    What do you mean? C++ is perfect language, why would they swap?
    he worked at Google btw

  • @kokoinmars
    @kokoinmars ปีที่แล้ว

    Uh... Elixir has a much better concurrency model than go.

  • @TomStine
    @TomStine ปีที่แล้ว +7

    I really loved that talk. Thanks, Prime, for reading that. I'm learning Go, and that helped put a few things in context. Go is so so soooo much better than TS (current work code base).

  • @averageintelligence6822
    @averageintelligence6822 ปีที่แล้ว

    I just realized ThePrimeTime is DrDisrespect

  • @funkdefied1
    @funkdefied1 ปีที่แล้ว +1

    “Wisdom remains unchanged but ideas can change quite a lot”

  • @manofqwerty
    @manofqwerty ปีที่แล้ว

    Was Go amed so because it is the first word in the Desiderata text?