Go Kind Of Sucks

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 ธ.ค. 2024

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

  • @boredbytrash
    @boredbytrash 7 หลายเดือนก่อน +404

    Oh no, we arrived at „reacting to Reddit threads“ low of content creation 😂

    • @JorgetePanete
      @JorgetePanete 7 หลายเดือนก่อน +6

      " "*

    • @judef
      @judef 7 หลายเดือนก่อน +67

      @@JorgetePanete Some other languages/counties do quotation marks differently. For instance France uses « and » and Germany uses „ and ”

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

      We will be dissecting random 4chan slide threads before long.

    • @boredbytrash
      @boredbytrash 7 หลายเดือนก่อน +13

      @@judef yeah, my stupid German keyboard does this autocorrect automatically, sorry!

    • @Fe22234
      @Fe22234 7 หลายเดือนก่อน +16

      Full time and already ran out content.

  • @Rakstawr
    @Rakstawr 7 หลายเดือนก่อน +14

    Depending on how you use defer, it functions similarly to destructors. Whenever you push a defer, then another, the second goes onto a stack and unwinds at the end of a function first. I do not like to do mutex + defer raw, you need to account for deadlocking when using defer. Mutex around the smallest amount of code you can and call the unlock manually at the end. Defer will just add too much bloat if you dont want a deadlock.

    • @suede__
      @suede__ 7 หลายเดือนก่อน +3

      Definitely been caught out by defering a mutex unlock

    • @nodidog
      @nodidog 7 หลายเดือนก่อน +1

      You rarely want to defer a mutex Unlock until the very end of the function anyway, as it restricts your function to operating sequentially until Unlock is called (removing any performance gains from possible concurrency). Generally best to use Lock and Unlock to clearly mark where the critical section starts and ends.

  • @catchingavocados
    @catchingavocados 7 หลายเดือนก่อน +74

    r/golang moderators are a bunch of snowflakes, I'm surprised they didn't ban this poster permanently for saying "sucks".

    • @youtubeenjoyer1743
      @youtubeenjoyer1743 7 หลายเดือนก่อน +27

      It is the same for all reddit forums, nothing surprising here.

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

      @@youtubeenjoyer1743 true

    • @maximofernandez196
      @maximofernandez196 7 หลายเดือนก่อน +2

      @@youtubeenjoyer1743 it applies to most big subreddits, yeah. But it depends on the community, tho. r/fulbo is funny af

    • @blarghblargh
      @blarghblargh 7 หลายเดือนก่อน +1

      ​@@youtubeenjoyer1743 "same for all reddit". I've seen plenty of subreddits where antisocial behavior is the whole point.
      was there some mass scrub of that, or are you just exaggerating for effect? asking truthfully.

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

      @@blarghblargh any place with unpaid volunteer moderators accrues petty people with lust for power or some stupid agenda. Eventually you get banned for le bad word. They do it with freedom from any form of remuneration or monetary compensation.

  • @Davidlavieri
    @Davidlavieri 7 หลายเดือนก่อน +65

    Factorio mention; the factory must grow

    • @T33K3SS3LCH3N
      @T33K3SS3LCH3N 7 หลายเดือนก่อน +4

      This should really have been Java's tagline.

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

      @@T33K3SS3LCH3N 😂

  • @TrueSecretpolitics
    @TrueSecretpolitics 7 หลายเดือนก่อน +96

    we need to see prime building something with python since he hates it.

    • @ilvestaavi
      @ilvestaavi 7 หลายเดือนก่อน +8

      And Ruby as well. Ruby gets so much undeserved superficial hate.

    • @swiss_eng
      @swiss_eng 7 หลายเดือนก่อน +5

      Ruby is the peak of scripting languages

    • @Daniel_Zhu_a6f
      @Daniel_Zhu_a6f 7 หลายเดือนก่อน +6

      i'd say python is leagues better than js in therms of coding experience. all you have to do is write struct-like classes (via NamedTuple/dataclass) and not touch stupid stuff, like bidirectional generators, metaclasses, multiple inheritance, accessors, (most people don't use all that anyway). maybe it's because i haven't done much js, but i trip over it's mad type coercion rules every time. also, js syntax is just not great, but the only problem with python's syntax is indentation significance (that's definitely a big L).

    • @mikopiko
      @mikopiko 7 หลายเดือนก่อน +1

      @@swiss_eng Word

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

      @@Daniel_Zhu_a6f I recently ended up using multiple inheritance in python and I wasn't prepared for how fundamentally stupid it is. It's like impressive how poor the design is, to the point where it's hard to believe anyone actually tried using it before it went into production.

  • @karaloop9544
    @karaloop9544 7 หลายเดือนก่อน +13

    4:14 *spits coffee out laughing* Sudden Top chat message:
    "poor garbage collection performance reminds me of Dubai"
    *lol*

  • @MattBolt35
    @MattBolt35 7 หลายเดือนก่อน +8

    "Mutex in a struct seems like a design smell" - Wut.

  • @joel230182
    @joel230182 7 หลายเดือนก่อน +23

    is there a language that doesn't suck?

    • @goporororo7404
      @goporororo7404 7 หลายเดือนก่อน +1

      Ts

    • @biomorphic
      @biomorphic 7 หลายเดือนก่อน +14

      No, they do all suck, for a reason or another. But some, like Go, suck much more than others.

    • @SimGunther
      @SimGunther 7 หลายเดือนก่อน +6

      English sucks along with every other language. I prefer Sanskrit if I wanted ultra pedantic language lawyering.

    • @steamer2k319
      @steamer2k319 7 หลายเดือนก่อน +6

      Esperanto, Haskell and Holy C . Languages so pure and radiant that most mortals are found too unworthy to wield them 😄.

    • @blackbeard3449
      @blackbeard3449 7 หลายเดือนก่อน +22

      There are two types of languages: languages that suck and languages that no one use.

  • @Rakstawr
    @Rakstawr 7 หลายเดือนก่อน +12

    Io reader to channel is done via std lib Pipe. I use it in my custom TCP messaging library to have a common interface between websocket services and raw tcp, and encrypt on send between them all.

  • @grihabor
    @grihabor 7 หลายเดือนก่อน +5

    It's weird nobody mentioned crappy typesystem

  • @samhughes1747
    @samhughes1747 6 หลายเดือนก่อน +3

    21:00 I frickin' love the Go context package! It's easily top 5 favorite parts of Go!

  • @UncleWalter1
    @UncleWalter1 7 หลายเดือนก่อน +2

    It sounds a number of these issues are to do realtime stuff. In that world you're going to be a lot more worried about heap allocations, thread prioritisation, constraining memory allocations. Go is great, but if you're doing that kind of stuff, Go is not the tool. Like I wouldn't use Go for audio DSP unless it was really basic stuff just for messing around. It would click and pop city.

  • @AqoCyrale
    @AqoCyrale 7 หลายเดือนก่อน +13

    >when you use a go library, you always know it will err in a certain way
    oh how I wish this was true. even the go stdlib has places where it panics instead of returning an error, e.g. when you try to parse an int from a buffer if the buffer isn't large enough.
    this forces you to have to understand the implementations of stuff you're using and add a bunch of preemptive checks or else live in fear of random crashes.

    • @Egzvorg
      @Egzvorg 7 หลายเดือนก่อน +3

      what language doesn't have panics?

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

      do you know any more examples of this? I'm relatively new to go but from what i've seen, panics should never really escape your code so perhaps you run into a bug worth reporting? do you have any links to discussions about that buffer size issue?

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

      Don't worry, it mostly happened when dealing with primitive data type (+ channel but in go Channel IS a primitive type so 🤷​@@DMSBrian24

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

    "Panic" when the world has stopped making sense, before you convert your database into a smouldering ruin.

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

    The Primeagean: Hold on. HOLD ON!
    TH-cam: Plays ad.
    Well played, algorithm. Well played.

  • @blakeingle8922
    @blakeingle8922 7 หลายเดือนก่อน +3

    17:31 I think he's talking about the band Panic! At The Disco

  • @gusryan
    @gusryan 7 หลายเดือนก่อน +14

    Random thing I hate: named return values are instantiated at the start of the function

    • @snorman1911
      @snorman1911 7 หลายเดือนก่อน +3

      That's why I like them. If you don't want that, why use named return values?

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

      @@snorman1911 cos you want to make explicit what you're returning and you don't want to use a struct?

    • @snorman1911
      @snorman1911 7 หลายเดือนก่อน +2

      @gusryan ah I see. I'm somewhat new to Go but it seems like more than three return values should use a struct. And two of those three are error and a bool for say, record found or not.

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

      wtf, i had no idea, that's really odd

  • @mskiptr
    @mskiptr 7 หลายเดือนก่อน +1

    terminalshop doesn't resolve for me on quad9. Is it perhaps missing DNSSEC stuff or something?

  • @mintx1720
    @mintx1720 7 หลายเดือนก่อน +3

    My first go job had 'init's everywhere, guess how that went.

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

      Useful when it’s useful, and a horrific mess everywhere else.

  • @programming.jesus1234
    @programming.jesus1234 7 หลายเดือนก่อน +4

    why does this dude think you have to wrap entire structs in mutexes w/ rust, I have no idea where he has gotten this idea, you can have an individual field that has sync

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

      This is often worse if you have to access multiple fields and not all of them

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

      @@ThePrimeTimeagen Sound like a library problem, not Go.

  • @geoffh4861
    @geoffh4861 7 หลายเดือนก่อน +5

    Date/Time formatting is a goddamn clownshow in Go

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

    13:06 Ok, I have to mention C#. It allows you to manually dispose of managed or unmanaged objects in your code. Managed objects are things like the List, which is an inbuilt class built into the language which functions like the Array in Javascript, except it's typed and is a list of ONE type (you defined the type).
    Unmanaged objects are usually things like custom classes you create which hold lots of memory. These are not immediately freed up by the garbage collector when they leave scope, unless you make them inherit the IDisposable interface, which tells the GC to call the inherited Dispose() method (which you will override to manage and dereference all the memory you just allocated).
    So, yes, there ARE other languages that let you constrain how much memory you're using. You can limit how large an array or a List of objects can be in C#. You can control disposal. You can even scope the lifetime of a custom memory-managed class that inherits IDisposable by utilizing the `using` keyword (which automatically calls your custom GC code for you).
    I could see someone like Primagen figuring out how to leverage C# to do exactly whatever memory allocation voodoo he wants to happen (not sure why mem allocation is a big deal, and why people are so transfixed by Golang and Rust; maybe y'all got burned by Java and JS, idk).
    You should even be able to mess with pointers and other low-level stuff in C# using the Dispose pattern. Why you would want to apart from games, I don't know. But then again, I just rest on the default GC and don't really do any memory management unless I absolutely have to.
    The same with allocations. I basically just say "forget it, I'm going to use my filter-map-reduce skills and just avoid allocating a shit ton of classes". If I'm allocating a bunch of memory in a web application or any kind of business application, then I have failed as a developer.
    YMMV.

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

      13:50 ish. One more thing. A million objects. I can spawn a million class objects in a C# collection class I write as a wrapper and implement the IDispose interface to handle garbage collection manually if it's such a big deal.
      Or maybe have each object in the collection be disposable and have a reference to parent objects, or some random 'node' object that it's responsible for disposing. That way, if one goes, all of them go (if not already disposed; gotta have that check!). It should be possible. Maybe a variant that has loops like the 100 prisoner problem where the GC gets called on each loop of object nodes, but in sequential order, not all 1 million at once. The disposal could then be put on a thread and awaited (worst case).
      And now I have to go code this. Thanks Primagen.

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

      "Unmanaged objects are usually things like custom classes you create which hold lots of memory. These are not immediately freed up by the garbage collector when they leave scope, unless you make them inherit the IDisposable interface, which tells the GC to call the inherited Dispose() method (which you will override to manage and dereference all the memory you just allocated)."
      I don't think that you have much experience in C# or object oriented programming.
      "inherit the IDisposable interface" : you implement an interface, you don't "inherit" an interface
      "These are not immediately freed up by the garbage collector when they leave scope, unless you make them inherit the IDisposable interface," => making something implement IDisposable does not change the behaviour of the GC.
      Nothing in C# is immediately freed up by the GC.
      You NEVER know when the GC will run.

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

      @@fsharplove "Nothing in C# is immediately freed up by the GC."
      Never said or implied that. The memory queued on the GC for deletion.
      And even if I get something technically wrong here, who cares? My point was that C# has the ability to leverage the GC. A second (hidden) point or implication I was trying to make was that there is (probably) some way to do allocations similar to these trendy languages but in C#. I say this because I know I've seen some pointer code in C#, so maybe it's possible.
      Take a chill pill, fella.

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

      @@nicholaspreston9586 "These are not immediately freed up by the garbage collector when they leave scope, unless ...": Yes you implied that the GC immediately freed up some memory in some cases because of the proposition built with unless.
      I didn't mean to be rude.
      My understanding:
      Dispose is explicit : you call it to free up memory, even though you don't know when it happens. By using IDisposable the Dispose method will be called for you when you use some "scoped using".
      You need to dispose handle on file, database connectio, ect... Stuff that are not "GC managed".
      Finalize : is like of dispose but is implicit. Called (not by you) when there is no ref to your object.
      The principle of the GC is that you never know when it will run. You can know when an object is marked "as garbage" but never know when the memory it uses will be released.
      Java, C# and any other GC language works roughly the same way.

  • @yayinternets
    @yayinternets 7 หลายเดือนก่อน +1

    A lot of these complaints seem like they are from devs who havent dealt with much systems programming before.
    Like people who have mostly done TS, Ruby, Python, etc before or something.
    Just like prime said, if you are dealing with resource issues, you build a configurable and shared pool to work from rather than just dumping everything into a go routine immediately.

  • @leonscander1431
    @leonscander1431 4 หลายเดือนก่อน +1

    Removing spaces in expressions like 1 + 2*2 by gofmt perfectly makes sense.
    Imagine writing mathematical expression on paper:
    1 + 2a
    You write 2a without spaces. It is much more readable: one plus two As. The same applies to your source code.
    I learned it from Python's PEP8 standard.

  • @saiphaneeshk.h.5482
    @saiphaneeshk.h.5482 7 หลายเดือนก่อน +8

    Blazingly Fast.

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

    Also a popular pattern is a single writer on a persistent ds accessed from an "atom" with many readers. Because a write updates the path to the root of the tree (atom), a reader always sees a consistent view of the world. Rich Hickey has a demo of an ant colony sim that scales up to > 200 threads. Because it doesn't use locks, that blocked time is essentially exchanged for more gc (due to persistent ds path copying).

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

    "Poor interoperabilty with other code" - Basically the support for C binding is bad. That means that things like shared object libraries can't be done easily, and that hampers items where plugins would be sensible approaches. This means that on the items where you need plugins, you have to either guarantee someone else builds them with the same exact go release (bad for when the product updates, but the plugin doesn't), you have to "wrap" the plugin in a service and call it through network calls (bad performance, lots of extra complexity), or you have to use cgo and manually integrate in a .so/.dll loader that just gets uglier the more you work it (and compiling goes from fast to lethargically slow).

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

    Would Go's new Pinner prevent large object graphs from being walked by the already efficient mark-and-sweep collector?

  • @saritsotangkur2438
    @saritsotangkur2438 7 หลายเดือนก่อน +3

    "You have to rely on the programmer to be really really really consistent w/ the error wrapping."

  • @bitwize
    @bitwize 7 หลายเดือนก่อน +20

    "Go feels verbose"
    COBOL has entered the chat.

    • @the_mastermage
      @the_mastermage 7 หลายเดือนก่อน +3

      Who the fuck whould consider Go verbose?

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

    anyone knows if Prime will make a glove80 review video?

  • @AScribblingTurtle
    @AScribblingTurtle 7 หลายเดือนก่อน +5

    CGO is a GO's way to access/load native C/C++ Libs. And it becomes is a nightmare if you want to distribute your Build for any platform, other than the one you are programming on.

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

      That entirely depends on dependencies and platform dependencies of the library used. SQLite would be quite easy. Also, there are docker containers that makes this easier.

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

      Nonono that only a small part of the problem.
      One of my biggest problem is that go module does NOT resolve C header file dependency!
      If you're using library that uses cgo and ues c header file somewhere, you need to resolve that file yourself and go get won't do that for you 😅
      Next is error has different behavior, now it essentially fancy errno

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

      @@muhwyndham You use build and linking parameters in the go files for finding things as per usual. Things like:
      #cgo CFLAGS:
      #cgo LDFLAGS: -lm

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

      It's not an nightmare. You ever used another language?

    • @AScribblingTurtle
      @AScribblingTurtle 6 หลายเดือนก่อน +1

      It's the "C" in "CGO", that makes cross-compiling a nightmare not the "Go". 😉

  • @ryangrogan6839
    @ryangrogan6839 7 หลายเดือนก่อน +1

    For me, it's when you define a global variable and instantiate it, but use it in another file, which causes 'declared and not used'. I absolutely despise '_ = my_var'. It hurts my soul. I guess my real beef is with the fact that there is no such thing as a 'warning' in GO; There are only errors.

  • @limplash
    @limplash 7 หลายเดือนก่อน +1

    sorry mutex in struct makes very less sense, don;t really think there are alot of use cases that a Read/Write locks won;t solve in these situations

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

    The flickering cursor in your full-size chat window view gives me PTSD but excellent content

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

    13:50 I actually slightly disagree with the idea that calling a function on nil is bad. I think if this is criticism you consider valid, then you must also consider it just as valid for it to be considered bad to call a function with a nil argument. That's all receiver syntax is, a way of providing an argument to a function in a (hopefully) more readable way. I think this leads to the actual issue, that types can be nil by default. Everything is an Option, and I think it shouldn't be this way.

  • @dragenn
    @dragenn 7 หลายเดือนก่อน +1

    I still like the idea to add a state to the assertions. I'm taking that idea...

  • @advertslaxxor
    @advertslaxxor 7 หลายเดือนก่อน +4

    pre-watch:
    - Error handling if err != nil {
    - No truthy ifs: if myStr != "" {
    - Nil maps/arrays cause panics (can we really not just allocate one then)
    - error + stack trace not in standard lib (instead in some archived errors package -- we should never be importing an archived package)
    - sync.Map is not drop in replacement for map
    these are the most annoying daily/weekly ones for me

    • @nurayatbeltaev9072
      @nurayatbeltaev9072 7 หลายเดือนก่อน +2

      sync.Map is never been drop in replacement for map, it's only better in 2 cases than map+ mutex

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

      @@nurayatbeltaev9072 Which is the problem. It would be really nice to have a drop in replacement for maps that is thread safe.

  • @零云-u7e
    @零云-u7e 6 หลายเดือนก่อน

    it just comes down to custom malloc. It's the best you can do, other than pooling, is to reduce unused tail space, but it needs to get performance tested. I read how to do it in Rust, not bad. Haven't tried in Go. It's gc. I wouldn't expect much. With C#, it had these options for garbage, but manual calling costs a new managing thread basically, so if you do that, you grind.... so usually don't mess with aggressive collection. You pack your pud. Wouldn't make a game with it.

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

    this is really good, thanks man!

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

    in try/catch world you should switch to errors as values and then used exception throwing as panics

  • @kenneth_romero
    @kenneth_romero 7 หลายเดือนก่อน +1

    for the game take, i feel like Go would be good for most genres until you start doing heavy 3D rendering. Casey and Jonathan have said the usual hot part of games is just the render loop, rather than the logic. i'm sure simple 3d graphic games or just 2d Go can be real great.

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

      Won't garbage collection cause drop of frames from time to time? Or is it actually not that big of a problem considering all Java games out there?

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

      @@infastin3795 maybe in a massive game, where you are pushing for as much performance as possible. However, usually it's up to the game developer to hide those bottlenecks well. At least a recent lecture i watched from casey he even states that it's up to the developer to hide such flaws as best as you can. so maybe when you clean up the garbage you're in a cutscene and the user doesn't notice the drop in FPS. but yeah you see other games not really have that problem unless you're doing something you weren't supposed to like spawn 1000s of entities in one location. and even then, it's mostly the rendering struggling to render all entities rather than keep up with their logic.

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

      ​@@kenneth_romeronot how GC issues show up: they don't drop the FPS, they stop anything happening for anything from 10ms to 10s which the player *will* notice no matter what, and you generally don't have much or any control over when that happens, nor is there a good time for it if you do.
      That said, you *can* and many major commercial games *have* used garbage collected languages. The problem is when GC issues do happen, the solution is generally to avoid allocating, which twists your code into horrible unreadable messes.

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

      ​@SimonBuchanNz Go's GC does not take 10ms to 10s. Where do you get this info? It usually takes about 1ms, and you can avoid making heap allocations to reduce GC load.

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

      @@TheQxY that's how GC *issues* show up. As in, when it's good it's good. When it's not good, it's not something you can work around. You can get just about any GC into a pathological state, and games are quite good at doing so.

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

    10:45 No, there are other alternatives to green threads than OS threads. Having “lightweight” threads can lead to an overreliance on threads when encapsulating the task appropriately and processing it in a thread pool would lead to better and more predictable performance. Is “thread” even the right abstraction?

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

      Pretty much any task system is eventually just green threads eventually: continuation passing is just manually constructing your on-heap return stack, for example.
      If your unit of abstraction is calling procedures, then you inherently get something like a thread.

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

    21:03 There is something called channels in Go. You know, some core part of the language that you use with gorountes to communicate things. Easy to miss when you lack skills in programming.

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

    Errors as values don't feel verbose compared to try catch
    Both are verbose in their own way but at least errors as values are easy to manage and document, with try catch there is most likely to be a separare page in the docs for the exceptions and I don't know If any LSP in any language will help you with that, Some exceptions are abvious and you know upfront what you're gonna get hit with but some are just nonsensical and are a pain in the ass because they are more of an unexpected thing at runtime and that's why they really suck

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

    If I want to close a server, I usually use an atexit library for those kind of things.

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

      Or just forget(), if you don't need to gracefully shut down connections

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

    People who complain about golang or any language: comments - over 9000, projects - 0.5

  • @duke605
    @duke605 7 หลายเดือนก่อน +10

    Ya this article screams of skill issue and junior Go dev but senior rust dev

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

    8 years ago i learnt Python, around that time I was also forced to learn C, 3 years later I was forced to learn JavaScript at work now I am learning Go because of peer pressure. I am loving it, I don't know if it is worth it though.

    • @andreffrosa
      @andreffrosa 7 หลายเดือนก่อน +1

      If you are loving it, it is worth it

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

      @@andreffrosa Thanks man, I don't know when I will be able to lend a job as a Golang developer. I work in St Petersburg as a Python developer I feel under paid so I thought maybe a new language could help.

    • @vncstudio
      @vncstudio 2 หลายเดือนก่อน +1

      @@michaeldjango Everything you learn is good. 🙂

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

      @@vncstudio hey, thanks, the story continues, now i am being forced to learn Kotlin and c++ at school, shame

    • @vncstudio
      @vncstudio 2 หลายเดือนก่อน +1

      @@michaeldjango It's okay. They are both important languages from a mainstream industry perspective. Each language will offer a different perspective and you can decide what you prefer professionally.

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

    For me the most annoying thing is the LSP that is kinda dumb (compared to rust or ts). The other one is about the functions of basic data structures (like 'append') are not 'methods'.

  • @GreatWalker
    @GreatWalker 7 หลายเดือนก่อน +1

    There is no union type in Go. This makes its error handling worse than Zig and Rust.

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

    Destructors are bad, because when they fail you either ignore or panic

  • @Heater-v1.0.0
    @Heater-v1.0.0 7 หลายเดือนก่อน

    Comparing Go threads to Tokio is silly, they are different things. Go threads are a basic language feature. Tokio is a threading library written in Rust.

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

    4:20 Doesn't unreal engine have a garbage collector?

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

      Not in the Java sense of collecting language objects. There's a bunch of things which are gc-like, for assets and when switching levels, etc., but so do many programs we wouldn't consider to "have a GC"

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

      unreal engine offers a very high level gc but unreal itself couldn't have been written in a gc language

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

      @@DMSBrian24 that's true, but the question here is about games in general, not game engines in specific
      I mentioned unreal engine because your game on top of it makes use of one

  • @benitoe.4878
    @benitoe.4878 7 หลายเดือนก่อน

    Mike stand creaking is on an all time high.

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

    Nim, all in white, comes and does both exceptions and errors as values. 8-)

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

    I am mostly a JS dev on the front-end, and I had to make a project that was related to min-max and alpha-beta pruning, for a school project.
    I chose Go because it is performant but not overly complex.
    When I started writing the code, I appreciated the explicit error handling of if err != nil, and I also like receiver methods as they are decoupled from classes.
    However, my first difficulty was in importing code from other modules. I could not figure out how to import my struct with reciever methods to other modules!
    Import did not "just work" like it does in JS. I had to go into the go mod and do something weird and unintuitive to make it work.
    Stupid. Stupid as fuck.
    Anyways, this limitation severely crippled my code-reuse because they made it unnecessarily difficult to re-use modules.
    Since I was on a strict time limit, I ended up doing the unthinkable.. I literally copied code from other modules and manually adjusted them.
    My biggest complaint with Go is it makes code re-use extremely hard.
    Not only that, but I am not sure if it has any support for FP. I often foumd myself writing essentially the same function, but in slightly different ways. I could not really abstract out to a higher order function as you do in JS.
    I found that limited FP support infuriating.
    But what do I know? That is just my first experience with Go. Leave a comment if there are solutions to my frustrations. I feel Go has potential.

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

    everybody loves gofmt, Prime.

  • @juststudying1019
    @juststudying1019 7 หลายเดือนก่อน +4

    JS developer hate go error handling, because they don't handle errors.
    They compare handling error and not handling error, because when I build a system that has great error messages and try to handle all error cases, typescript becomes so ugly.

  • @fuzzy-02
    @fuzzy-02 7 หลายเดือนก่อน

    The primeagen full cycle

  • @thiagomata-coding-and-math
    @thiagomata-coding-and-math 7 หลายเดือนก่อน

    Once I try to date a Go developer. But when she said that was a error, I panicked

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

    Receiving over a nil channel blocks forever.

  • @josemata8865
    @josemata8865 7 หลายเดือนก่อน +16

    of course doing this:
    class UserNotFoundException extends RuntimeException {
    public UserNotFoundException(String message){
    super(message);
    }
    }
    again and again for each error that you have in your application + the exception handler is less verbose than:
    if err != nil{
    return err
    }

    • @ppcamps
      @ppcamps 7 หลายเดือนก่อน +14

      most people that complaint about go error handling, usually don't use try/catch/except statements at all.

    • @ivanjermakov
      @ivanjermakov 7 หลายเดือนก่อน +3

      You have no idea you're talking about. Exception definition has nothing to do with error handling. And who said that Java's error handling is superior in any way?

    • @vinterskugge907
      @vinterskugge907 7 หลายเดือนก่อน +1

      The big advantage with exceptions is that you don't need to deal with errors every time they could happen. In many situations, all that's needed is a top-level handler.

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

      How about "?" then?

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

      @@squishy-tomato that's why Rust's version is superior because you can wrap your return type in Result and add ? in code that can error, so it's not verbose at all. The problem with exceptions is that you just don't know when a function will throw an exception unless they tell you in their documentation, whereas with errors as values, you always know.

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

    “You do have to rely on the programmer to be very very very consistent in its error wrapping” - oh really? I thought Go was designed to be super reliable so it doesn’t have to assume programmers always remember to do stuff? Isn’t the error returned by value the only way? Mr “I hate exceptions, but I do like to always have a nice stacktrace”

  • @natea.2926
    @natea.2926 7 หลายเดือนก่อน

    Prime, I really enjoy your content and I know you’re a smart guy, but how are you months into your Go journey and still don’t even know what CGo is?

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

    I have to learn Go for my new job - (C,C#,JS,Python) coder.

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

    Damn, GC problems because of complex reference graph. And they say Java is bad, when it's GC chews through complex reference graphs in every application with no problem.

  • @Tony-dp1rl
    @Tony-dp1rl 7 หลายเดือนก่อน

    Go sits in that awkward place where it doesn't solve any problems that developers have, so why take the time to invest.

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

    If you don’t like errors in go. Then ignore them.

  • @RickYorgason
    @RickYorgason 7 หลายเดือนก่อน +3

    Exceptions were fine if you only used them for exceptional errors (ie, you shouldn't have been using exceptions in cases where it's okay for a function to fail), but Rust's ? operator works well for both exceptional and non-exceptional errors *chef's kiss*.

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

    Sucking was the main design principle, so of course it sucks. By design.

    • @零云-u7e
      @零云-u7e 6 หลายเดือนก่อน

      but I like data race

  • @alexpyattaev
    @alexpyattaev 7 หลายเดือนก่อน +2

    Go coroutines are less efficient than tokio tasks, since go can switch the tasks without an await point, which means it will have lower throughput.

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

      Python world: make it break

    • @aftalavera
      @aftalavera 6 หลายเดือนก่อน +1

      If you are using Rust you are in a safe place, stay there!

  • @j.moggridge
    @j.moggridge 6 หลายเดือนก่อน

    lol the thumbnail pic haha

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

    As a JS programmer I will learn Go, remember my words😂

  • @emeraldbonsai
    @emeraldbonsai 7 หลายเดือนก่อน +1

    most of go langs issues sound like skill issues

  • @christ.4977
    @christ.4977 7 หลายเดือนก่อน +8

    There are those that recognize Go's superiority and then there are those that are wrong. It's okay to be wrong. Joking aside, it all comes down to trade-offs of the language and people's preferences or experience.

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

      Just use 5 different languages and then Python to glue it all together. That is the true Way

  • @xrehpicx
    @xrehpicx 7 หลายเดือนก่อน +3

    I love watching all these reaction videos but if they r taking away from ur main channel videos that I subscribed to ur brand for idk if I wanna spend time just watching u react to things that I should be just going reading and building my own opinions

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

      Stream is the place to go for technical chat and building

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

    I don't like defer. It is just like a try-catch/finally. It dynamically modifies the execution flow since it does not execute where you call it and has a hidden cost because it implicitly creates a dynamic stack.

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

    Sounds like the author needs to break up the flow. Even cpp will blow up if you try to write an operating system in one file lol panick is waaay better than setting breakpoints using expressions imho

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

    kind of sucks, kind of doesn't

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

    I have verbosity issues.

  • @jell_pl
    @jell_pl 7 หลายเดือนก่อน +1

    btw.
    effective_go IS considered as defecto standard.
    if you are asking about formatting code - even imports matter a lot to different people or different tools -
    - does he heavily depend on stdlib?
    -- fine, he makes many aliases/templates
    -- hmmm... some human should take a look.
    - does he havely depend on other libs in this project?
    -- ough, new functionality.
    -- ough, important - new logic.
    and so on...

  • @dpgwalter
    @dpgwalter 7 หลายเดือนก่อน +1

    I just want Go to have Zig's `try val := something()` as syntax around `val, err := something(); if err != nil { return empty_obj, err }`, where val either becomes the intended value or it returns the error and an empty value of the correct type. You won't be able to use this to log errors and stuff (so not super useful in a server environment), but it would make functions communicating errors feel a lot less cumbersome.

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

    Just put your entire python program ina try except and then set the error value and boom its as verbose as go

  • @conundrum2u
    @conundrum2u 7 หลายเดือนก่อน +11

    the spaz moment when struggling with git, undoing changes, trying to get back to a good known state, is probably the most honest and relatable part. fuck go, it was behind the 8-ball when it landed

  • @shauas4224
    @shauas4224 7 หลายเดือนก่อน +1

    Adon mad guy in yt pissed me off for entire video
    Just PLS SHUT IT NOONE CARES

  • @massy-3961
    @massy-3961 7 หลายเดือนก่อน +3

    defer makes cleanup explicit while drop() hides it

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

      By that logic you should be mallocing and freeing for every single variable used, stack based memory just hides it

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

      Assuming you mean the free function drop, it just moves where the Drop cleanup happens.
      If you're talking about the Drop trait, ehhh... in practice there's a paired "clean up this thing I made" you don't want to forget 99% of the time. I would like something like defer that 1% of the time, sure, but I wouldn't trade Drop for it.
      The real answer is: why not both? ;)

    • @massy-3961
      @massy-3961 7 หลายเดือนก่อน

      @@SimonBuchanNz yes correct, hiding isn’t necessarily a bad thing, in fact it’s good in language like Rust. But for Golang semantics, which is readability and explicitness, defer is a good compromise.

    • @massy-3961
      @massy-3961 7 หลายเดือนก่อน

      @TurtleKwitty initializing a variable is explicitly memory allocating it, and there is no cleanup for the variable as it’s a garbage collected language. No need to get your panties in a bunch dude.

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

      @@massy-3961 your pointer gets thrown out at the end of the function scope, you should explicitly free your claim to it not hide it

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

    18:40 Is this user not naming things properly? Hard time to write code that makes sense? If you have not idea what the mutex in a struct is for, you need to name it better.

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

    GLEAM LANG

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

    Also, you need tooling and an ecosystem. IMO it’s better and easier to use something like Go or Rust, despite annoyances, vs something like [redacted] that might be fun but has a super-limited ecosystem.

  • @Lemmy4555
    @Lemmy4555 7 หลายเดือนก่อน +21

    panic = throw, recover = catch

    • @Davidlavieri
      @Davidlavieri 7 หลายเดือนก่อน +5

      no

    • @switchblade6226
      @switchblade6226 7 หลายเดือนก่อน +6

      ​@@Davidlavierithats literally how panics work, they use the same stack unwinding mechanism that exceptions do. its just a single "panic exception" type

    • @SimonBuchanNz
      @SimonBuchanNz 7 หลายเดือนก่อน +4

      "Rust doesn't have exceptions"
      std::panic: am I invisible to you?

    • @shurizzle
      @shurizzle 7 หลายเดือนก่อน +1

      @@SimonBuchanNz Rust does have unwinding because of RAII but it is not meant to be used as a try-catch, you can't even reason on panicking values because they are opaque + you can compile with panic = "abort". I guess it's the same in Golang because of defers.

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

      @@shurizzle well, you *can*, as catch_unwind() gives you a Box if it panics, which you can downcast. But yes, don't actually do this for program logic!

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

    Why is this guy focusing on these things instead of using it to build something useful?
    Also, poor interoperability with other code? It's dead simple to get C code in Go.

  • @agustingomez7172
    @agustingomez7172 7 หลายเดือนก่อน +2

    i love go its really difficult to hate it when you try and understand every line you read its so easy to read programs in go and the validation and structs are good to

  • @PekaDur56
    @PekaDur56 7 หลายเดือนก่อน +5

    42 seconds is wild

  • @MrSofazocker
    @MrSofazocker 7 หลายเดือนก่อน +1

    errors as values is nice if you care about the errors.
    otherwise it's not.
    If you don't care, you don't care.. just try catch the entry of the app, catch the error you like to know about, discard the rest, and everything still executes or bubbles up the error for some1 else to care about...

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

    That was a poor argument re-edit post

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

    Hey @ThePrimeTime, Changing the scaling factor from 1x1 to solve your mouse flickering in linux: “xrandr --output eDP-1 --scale 0.9999x0.9999”

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

    wtf is a bugbear

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

    Haskell

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

    everything