Earlier quoted context omitted.
It is certainly a fantastic solution, and I definitely appreciate the work that Sam Boyer and the `dep` contributors do. There's a lot of "gotya"s with using dep though. One that gets me a lot is the fact that I like to commit my vendor folder, just for faster CI. So if I committed my vendor folder with a copy of "k8s.io/client-go", and then in a different project I imported a package from my vendored project, it wou…
Ok, but why would you do that? Either just vendor it in the new project (copy-paste a directory) or download it to your gopath and import that. The nice thing is that you don't have to change the import when you decide to vendor.
Go: Ten years and climbing
101–110 of 193 posts
Re: Go: Ten years and climbing
#102Having dealt with enough spaghetti code over the years (just a few of industry experience, and some more years of academia), I understand what Go's strengths are. It's an opinionated language that stops users from being too clever or writing code that's too complex. That said, I've always hated the trends that have brought Golang into popularity. The engineers I've felt who could benefit from Golang the most could al…
As a big Rust proponent, I don't think it makes sense to invoke Rust here. The goal of Rust is to provide a more secure low-level foundation for software; any tools it provides to "ensure data integrity" are in service of that end, and pale in comparison to the sort of correctness that Haskell strives for on principle.
Given that Go is memory-safe (modulo a few concurrency foibles), any software that gets rewritten from C to Go is still a win in Rust's eyes. I know more than a few people in the Rust community who are big fans of both languages (e.g. burntsushi, author of Rust's regex library and ripgrep), and the Rust developers have a lot of respect for the Go authors. Go and Rust have different priorities, and that's A-OK.
Re: Go: Ten years and climbing
#103Maybe I'm spoiled, but I've had a hard time dipping my toes into Go due to the lack of batteries included frameworks (like Rails or Laravel). Can anyone recommend some resources to give it another shot?
And, I really started digging into the native http support. Go has a lot of really nice things built in and ready to go. Still working on learning what they've got, so maybe I'll end up wanting a framework again at some point. But for now, it's got everything I need for general tasks.
Re: Go: Ten years and climbing
#104Earlier quoted context omitted.
> I'm a much bigger proponent of languages such as Rust or Haskell which give the developer the _tools_ to ensure their own data integrity, but I guess that says something about me as a developer and why I don't like Golang. This is a little smarmy, don't you think? You seem to come ever-so-close to hinting something like "Go isn't fit for writing real applications." Without getting into what exactly a "real applicat…
That seems to be an intentional misreading. The criticism of Go being presented is that it's intentionally underpowered so as to make it possible for poor developers to verbosely muddle their way through to developing working real applications without actually becoming better.
Only the most cynical view of the language would see it that way. Just because they don't agree with your programming worldview doesn't mean they are idiots. The fact that people can say smarmy stuff like possible for poor developers to verbosely muddle their way through to developing working real applications without actually becoming better with a straight face just shows how closeminded and ideological people get about languages. Just because you know what a monad is or use map/reduce/filter plentifully doesn't mean you are a better dev than someone who has spent years honing their skills in an imperative language.
Nobody gets this ideological about natural languages. Nobody in the real world says "Hey, why are you speaking Spanish? It's so inefficient, you should be speaking Mandarin". Just as in natural language, programming languages can be learned and adapted by people of varying proficiencies, and when you "get" their particular way of modeling the world, they become an extension of you and a tool. We should just be happy when people become really good speakers of a language, not whether it is the right one.
Do people really believe that individuals such as Rob Pike, Ken Thompson, and Brian Kernighan are just trying to propagate Blub, the language, so that all devs are lowest common denominator morons? Have you seen how clever some of things they've built are? I dunno, maybe some of the original hackers have learned a lot about building complex systems over the last 50 years, and maybe they've got something useful to say.
Re: Go: Ten years and climbing
#105It's funny that the very first thing discussed is the name. "Go" always seemed like a bad idea, being hard to google for -- and while they were employed by Google, no less! It fits with the love-it-or-hate-it nature of the whole language.
Re: Go: Ten years and climbing
#106Having dealt with enough spaghetti code over the years (just a few of industry experience, and some more years of academia), I understand what Go's strengths are. It's an opinionated language that stops users from being too clever or writing code that's too complex. That said, I've always hated the trends that have brought Golang into popularity. The engineers I've felt who could benefit from Golang the most could al…
What about tools that statically analyze your code and allow you to be more productive? It may be possible to build more sophisticated and useful tools if the language is simple. You talk about giving the developer tools, but those tools can be augmentations on top of the basic building block that is the language. That way, anyone can build tools for their needs, without complicating the lives of others. No need to b…
This is a thing that's commonly repeated, but it's not that, well, simple. Having a simple syntax doesn't matter that much for tools once you have a reusable parser library.
More important for tools is having a simple semantics. Do all builtins behave the same way? Is nil handled consistently (e.g. does indexing a nil map do the same thing as indexing a nil slice)? Are the coercion rules simple? Is importing a package free of side effects? (The answer to all of these for Go, unfortunately, is no.)
The most important thing, however, for tooling is whether the language provides static guarantees. For instance, if the language controls access to shared mutable state, you can do a lot to detect races statically. As another example, if panics were part of the type system, then you could statically know whether functions panic and, if so, what types of panics can happen. Here, Go provides very few static guarantees: it's very difficult to soundly prove anything interesting about Go programs.
Unfortunately, you can't really have it both ways: you can have a more dynamic type system that doesn't put many constraints on on programs, or you can have interesting static tooling. Go chose the former in nearly every instance.
Re: Go: Ten years and climbing
#107For a language that's been around for 10 years Golang's adoption rate is still pretty low. Searching Indeed.co.uk's API by job title there are currently 25 Golang jobs in London compared with 29 Perl, 188 Ruby and 511 Python. For the UK as a whole it's 34 Golang, 57 Perl, 276 Ruby and 821 Python. Golang has a long way to go yet IMHO.
Which language released in the last 10 years is more popular then ? Golang is arguably niche and does not offer the huge flexibility and ecosystem of say Python, so i am pretty sure it will never come close to that, but there are a good number of usescases where it arguably is the best choice.
Re: Go: Ten years and climbing
#108I evaluated Go a few months ago for a web project, but it seemed as if there was a lot of manual work involved in mapping objects in and out of a MySQL database and in and out of JSON (basically, 50% of my day-to-day back end work). It just seemed too arduous. The second thing that bothered me was that an edge-case bug in one of my HTTP handlers paniced the app. If that had happened in production while under load, ma…
If you are doing heavy sql queries, then it might be beneficial for you to use an ORM. There are plently of those out there, so choose one you like. Just create structs for your tables and run your queries.
If you are doing light/moderate sql. Just have an interface for your db calls, wrap your responses in a struct and use json tags for json encoding/decoding.
> What is the best way to prevent a request from crashing the server and killing a bunch of unrelated requests?
I use negroni. And its recovery middleware does exactly that.
Re: Go: Ten years and climbing
#109Earlier quoted context omitted.
Out of curiosity, what is your take on clojure then ?
> Out of curiosity, what is your take on clojure then ? I have a lot of respect for Clojure, though I don't have much of a use case for it. At the time I tried it, I was annoyed its semantics for '() and nil - they're sort of a hybrid between how Common Lisp does it and how Java does it. Which makes sense - the Common Lisp approach would be a nightmare to implement on top of the JVM while maintaining interoperability…
Re: Go: Ten years and climbing
#110Earlier quoted context omitted.
Out of curiosity, what is your take on clojure then ?
> Out of curiosity, what is your take on clojure then ? I have a lot of respect for Clojure, though I don't have much of a use case for it. At the time I tried it, I was annoyed its semantics for '() and nil - they're sort of a hybrid between how Common Lisp does it and how Java does it. Which makes sense - the Common Lisp approach would be a nightmare to implement on top of the JVM while maintaining interoperability…