|
Voted Worst Mom posted:It doesn't matter what gofmt does because it does it consistently and that's the point. There are some bugs but that's not one of them. Yeah, caring about how gofmt is formatting your poo poo indicates you don't understand how great gofmt is. I have been writing a bit of golang recently, and I find it decently enjoyable. For the most part I can appreciate the language for what it is and isn't, it fills a like-C-but-not niche pretty well. I will bandwagon missing generics though, having to use (literally) the exact same code in 3 spots because I'm doing the same thing to 3 maps with a different value type is shameful (though map[string]interface{} is an even worse solution).
|
# ? Apr 20, 2015 02:29 |
|
|
# ? May 4, 2024 12:50 |
|
You think that's bad, try working on a project that needs things like matrices. The `go generate` command has made things a bit easier, but it's extremely silly to have to write your own template generation code to implement the exact same algorithms for float/big/complex/whatever. (The code can deviate at points; especially for things like constants, but the points where the code diverges are much more sparse than cases where it's identical).
|
# ? Apr 20, 2015 03:15 |
|
polpotpotpotpotpot posted:Yeah, caring about how gofmt is formatting your poo poo indicates you don't understand how great gofmt is. That's not a very strong argument. If gofmt formatted each of your files into a single line, would you still feel that way? It's possible to simultaneously feel that a tool like gofmt is a great idea, and also that the formatting decisions it makes are problematic at times.
|
# ? Apr 20, 2015 03:23 |
|
Deus Rex posted:That's not a very strong argument. If gofmt formatted each of your files into a single line, would you still feel that way? Sure, my point is simply that it Just Works and is Pretty Good and why the hell does anybody feel like bikeshedding the smooshing of x*x. Tangential hilarity, re: someone asking for map/filter: https://groups.google.com/forum/#!msg/golang-nuts/RKymTuSCHS0/MylwD97xYqUJ posted:The modern programmer thinks a newline is a thousand times harder to https://groups.google.com/d/msg/golang-nuts/RKymTuSCHS0/BXbkvn3ckOkJ posted:I would say the Go designers are frightened of newlines. In particular the one in front of the hanging brace.
|
# ? Apr 20, 2015 03:41 |
|
This is the best reason I have so far for why Go should not have generics: http://forums.somethingawful.com/showthread.php?threadid=3693703&pagenumber=2#post444927286
|
# ? May 5, 2015 07:23 |
|
sarehu posted:This is the best reason I have so far for why Go should not have generics: http://forums.somethingawful.com/showthread.php?threadid=3693703&pagenumber=2#post444927286 What does that have to do with generics?
|
# ? May 5, 2015 07:47 |
|
Deus Rex posted:What does that have to do with generics? You can't write your functional programming libraries without them.
|
# ? May 5, 2015 08:00 |
|
Clojure implements efficient persistent data structures as part of the language so clearly they should have used Clojure.
|
# ? Aug 20, 2015 23:18 |
|
I just started learning Go this last week and like it quite a bit. I'm hoping it can fill the wasteland void that we currently use Ruby for in a lot of places. There's a whole lot of conversations I have that go something like "Oh yeah, I wrote a script for that, just git clone the repo it's in and use it......well yeah, you have to do bundle install first to get the required gems...no bundler is a thing you have to install....got it? Great. Hmmm, it's still not working? What version of Ruby are you running? Ah, just point RVM at a new version....oh, you installed a system Ruby? gently caress. Well, try this Python thing instead, yeah, that won't work on RHEL 5.6 because Python is too old." I think any hit my productivity takes to learn my way around go will be made up for in that I won't be troubleshooting installs of Ruby/Python on other developer systems all goddamn day. Whelp, that's my story! I just wanted to say that as someone who is coming from a Python/C background, Go feels super duper natural and I like it a lot!
|
# ? Aug 27, 2015 22:08 |
|
I'm reading some about how interfaces work here: http://www.golangbootcamp.com/book/interfaces and had a question about this. To save everyone from clicking on the link, it provides some example code like this: code:
e: sorry if this is a dumb question, it's just that everyone says "Start doing things the go way to learn better!" and I'm not exactly sure what the go way is in this case. Winkle-Daddy fucked around with this message at 22:18 on Aug 28, 2015 |
# ? Aug 28, 2015 22:11 |
|
Winkle-Daddy posted:My question is, can the Name() function take parameters through an interface? What would be the suggested method for passing arguments be? The only way I could think to do it in this example would be to extend the User struct to include any options I want set, then set them when I dereference into the variable "u" which (should) make it accessible to the function the interface calls. That feels kind of dirty though, would that be considered the "go way" of doing things? I'm not sure what you mean here but you can just pass arguments like a normal function. code:
|
# ? Aug 28, 2015 22:24 |
|
Hmm, okay, but here:code:
|
# ? Aug 28, 2015 22:36 |
|
Winkle-Daddy posted:Hmm, okay, but here: well, "Greet" doesn't really support this, but greet isn't part of the interface. All the interface declaration states is that if "x" is a Namer you will be able to do x.Name() and get a string. If the interface states that x.Name takes some arguments it's up to the caller to pass those arguments.
|
# ? Aug 28, 2015 22:44 |
|
Oh duh. Okay. Thank you!
|
# ? Aug 28, 2015 22:47 |
|
I tend to use interfaces a ton when doing stuff like event passing/update methods. For example, I have some "widget" like structs I use with termbox-go The interface for them is code:
With the component example: code:
NickPlowswell fucked around with this message at 10:50 on Sep 8, 2015 |
# ? Sep 8, 2015 10:42 |
|
http://www.gopl.io/ This book is releasing in 4 days. Anyone excited?
|
# ? Oct 27, 2015 00:53 |
|
First Time Caller posted:http://www.gopl.io/ Brian Kernigan co wrote it? Well thats got my attention!
|
# ? Oct 27, 2015 03:26 |
|
I am new to Go and have a dumb question. I have a template in which I would like to render something resembling a calendar. As part of it, I'd like to generate 31 identical divs. I don't really understand how to use the range operator to do this - the internet seems to be replete with examples of how to use range to iterate over slices and whatnot, but nothing about how to do what amounts to a basic for loop. Help?
|
# ? Jan 18, 2016 16:32 |
|
https://tour.golang.org/flowcontrol/1 The entire go tour is pretty rad. Highly recommended. e: vvvvv oh, sorry, right. I misread your post and got the wrong idea. I haven't used templates. Karate Bastard fucked around with this message at 19:51 on Jan 18, 2016 |
# ? Jan 18, 2016 17:48 |
|
Edit: nevermind, I'm just going to do this in JS.
Sub Par fucked around with this message at 21:11 on Jan 18, 2016 |
# ? Jan 18, 2016 18:18 |
|
Sub Par posted:Edit: nevermind, I'm just going to do this in JS. Go everyone!
|
# ? Jan 19, 2016 03:41 |
|
Sub Par posted:I am new to Go and have a dumb question. I have a template in which I would like to render something resembling a calendar. As part of it, I'd like to generate 31 identical divs. I don't really understand how to use the range operator to do this - the internet seems to be replete with examples of how to use range to iterate over slices and whatnot, but nothing about how to do what amounts to a basic for loop. Help? go template docs posted:{{range pipeline}} T1 {{end}} This is idiomatic to Go: code:
|
# ? Jan 22, 2016 21:19 |
|
Go is confusing to me. I just got a coupon code for a Udemy course about it, and it seems super great from the outset, and a lot of companies are using it. But... only 5 pages here, and most of it is complaining about the language. Did it just never get any traction? Is it dying out?
|
# ? Mar 8, 2016 22:42 |
|
COOL CORN posted:Go is confusing to me. I just got a coupon code for a Udemy course about it, and it seems super great from the outset, and a lot of companies are using it. But... only 5 pages here, and most of it is complaining about the language. Did it just never get any traction? Is it dying out? It is very good at certain things. Go is conceptually simple and lightweight. Unfortunately, its devotion to "simplicity" is somewhat slavish which causes some huge problems for certain types of code. It can also cause performance issues because, despite being a compiled language, almost everything generic has to use vtables at best and aggressive type conversion and/or reflection at worst unless you want to roll your own template generation code. Its interoperability with C is also... idiosyncratic.
|
# ? Mar 8, 2016 23:08 |
|
COOL CORN posted:Go is confusing to me. I just got a coupon code for a Udemy course about it, and it seems super great from the outset, and a lot of companies are using it. But... only 5 pages here, and most of it is complaining about the language. Did it just never get any traction? Is it dying out? I don't think it's dying out, in fact, I get the impression that it's quite popular with new start-ups. My opinion is that you can't write "beautiful" code in go (which is of course very subjective), but that doesn't really mean that it's a bad language.
|
# ? Mar 8, 2016 23:09 |
|
Go is really good for infrastructure stuff. We write and use a ton of tooling in Go both stuff we've written (logging, config mgmt, virtualenv fuckery, load balancing) and OSS like etcd, terraform, etc. Anybody that's spent much time with our Go code really starts to loathe the hundreds of thousands of lines of python we have. As our team has grown we get bit more and more by bullshit that comes out of bigger teams mixed with weak types, no compilation, etc. Not to mention we end up CPU bound in a ton of places. Go rulez basically.
|
# ? Mar 9, 2016 00:41 |
|
COOL CORN posted:Go is confusing to me. I just got a coupon code for a Udemy course about it, and it seems super great from the outset, and a lot of companies are using it. But... only 5 pages here, and most of it is complaining about the language. Did it just never get any traction? Is it dying out? Just not much activity in this thread to be honest. The reddit group has been growing in quality (particularly since the devs started doing AMAs) and it is on YC a lot. Go is really good at some stuff - especially deployment!!! - pretty good at most stuff, and meh at some stuff. If you're looking for language feature xxx in it, you'll be one of the people hating on it. I absolutely love how readable random github repos in go are. I love the tooling. I'm at the point where it is my go to language, unless the task is an extremely poor fit.
|
# ? Mar 9, 2016 04:19 |
|
Docker, rkt, Kubernetes, InfluxDB, Prometheus, etcd, pretty much everything by Hashicorp now. It's really gaining traction where it counts — in large scale projects built to be used by a poo poo load of people. Personally, I think it's fun to read and write, and it gets to the point. I echo Bozart in that it's my go-to language now. It works pretty well for API's fronting SPA's and for small tasks.
|
# ? Mar 11, 2016 04:59 |
|
Just got an offer for a Go dev job. It's been my language of choice for the past two years on all my personal projects so I'm really excited at the prospect of using it in a more advanced production context.
|
# ? Mar 11, 2016 08:22 |
|
Go is basically just really good until it's not. It's amazing to me how easy it is to keep it in your head and read someone else's code, but once you hit a HERE BE DRAGONS area, have fun. One HERE BE DRAGONS area is interoperability with any C library that expects all calls to be on the main thread (like anything involving windowing systems on OS X). You can do it by locking the OS thread in the init function, but you can't really do that as a modular library, it pretty much worms its way into the structure of any program with it as a subdependency.
|
# ? Mar 14, 2016 01:29 |
|
I've learned a lot more about Go and like it quite a bit. But I ran into a weird thing that I'm having a hard time googling the 'correct' way to do it. Hopefully someone can help out. I have a struct that I want to use for reading/writing config files. My struct is like this:code:
code:
code:
code:
|
# ? Apr 7, 2016 16:29 |
|
You're just using the wrong syntax for the composite literal, if I'm understanding the question: https://play.golang.org/p/uebkyYxuCN
|
# ? Apr 7, 2016 17:26 |
|
Does anyone use Go for game development? I'm curious what the most popular use cases of Go are at the moment - I guess mostly web-based?
|
# ? Apr 7, 2016 17:29 |
|
Lonely Wolf posted:You're just using the wrong syntax for the composite literal, if I'm understanding the question: Oh! That makes perfect sense looking at it now. Heh. Thanks! This is what happens when you're coming from Python, I guess... COOL CORN posted:Does anyone use Go for game development? I'm curious what the most popular use cases of Go are at the moment - I guess mostly web-based? We have found that go is best used as part of your service oriented architecture stack. It's really easy to get individual go binaries deployed and controlled through systemd that do everything from host simple web services to doing more advanced manipulation. It's not very good for game dev, and UI libs aren't well supported like at all due to how big your binary becomes due to the static linking involved. Someone who has actually tried could probably elaborate more, but I see it as 90% replacing your bash magic glue in your tech stack. Winkle-Daddy fucked around with this message at 17:39 on Apr 7, 2016 |
# ? Apr 7, 2016 17:34 |
|
COOL CORN posted:Does anyone use Go for game development? I'm curious what the most popular use cases of Go are at the moment - I guess mostly web-based? https://github.com/veandco/go-sdl2 These bindings work very well, but the biggest thing for me was just the lack of debugging tools. printf debugging doesn't cut it for game dev, and there wasn't anything promising that worked and didn't murder performance either. This was 6 months ago, I think I've seen a project or two that I didn't find originally that might be good once it matures, but I eventually went with a Lua based platform for my tinkering (love2d.org) I did have some basic level loading, tile scrolling working in a plain ol redistributable .exe, so it's possible, and may someday even be a good way to go, but just keep in mind you're essentially writing everything yourself since there's not much of a community for game dev in Go.
|
# ? Apr 7, 2016 22:47 |
|
spongeh posted:https://github.com/veandco/go-sdl2 These bindings work very well, but the biggest thing for me was just the lack of debugging tools. printf debugging doesn't cut it for game dev, and there wasn't anything promising that worked and didn't murder performance either. This was 6 months ago, I think I've seen a project or two that I didn't find originally that might be good once it matures, but I eventually went with a Lua based platform for my tinkering (love2d.org) Have you tried Delve for Go debugging? Just started using it with VS Code. Don't have much to say other than it's a thing but dunno if it's any good.
|
# ? Apr 8, 2016 03:31 |
|
There is also an atom plugin.
|
# ? Apr 8, 2016 03:33 |
|
I think Delve wasn't available for Windows at the time. That's good that it seems to be now, but no I hadn't used it at the time.
|
# ? Apr 8, 2016 03:59 |
|
Delve is bad now but maybe it will be less bad in the near future.
|
# ? Apr 15, 2016 14:04 |
|
|
# ? May 4, 2024 12:50 |
|
Suspicious Dish posted:They still seem to believe that dynamic linking is the devil, so it's hard to write a solid Go library. Admittedly for most contexts in which I would use golang, dynamic linking IS the devil. Go is a great language to pick for operations code where you would have used python or perl 10 years ago. Back then you would just have had to eat the pain of dependency management for a non-mainstack language (or do something in c and eat the pain of THAT). Now you just ship a static link binary and call it a day. Ganson fucked around with this message at 23:38 on Apr 17, 2016 |
# ? Apr 17, 2016 23:20 |