10 ms·
Why I Don't Like Golang (2016)
- kayall 9y agoHas anyone here tried using panic/recover? I think they are pretty similar to exceptions.
- vesak 9y ago> 7. There’s no ternary (?:) operator. I didn't realise there are people who prefer this thing. Generally speaking, what should we think about languages that are theoretically weak but are quite successful? Does that imply that the theories are wrong?
- pdpi 9y agoIf you come from a functional background (or otherwise just prefer expression-based languages), the if statement-based version is just horrible. Several languages work around this by not having ?: but instead having `if` be an expression.
- dingo_bat 9y agoTernary operators are the best! Highly expressive and concise, and everybody instantly understands it. Is there a single drawback about it?
- sethammons 9y agoNested ternary
- masklinn 9y agoEven more so. Between var v T if (cond0) { v = value0 } else if (cond1) { v = value1 } else if (cond2) { v = value2 } else { v = default } and val v T = cond0 ? value0 : cond1 ? value1 : cond2 ? value2 : default I'd much rather have the latter.
- randomdata 9y agoHowever, your if statement is unidiomatic and quite unlike how you would normally write that particular logic in Go. If you really want to make a fair comparison, you might consider writing it in the way that Go is normally written, not the way that someone familiar with another C-style language might write the code if the ternary operator was taken from them.
- masklinn 9y agoPlease do go ahead and demonstrate how you would normally write that particular logic in Go. Would it perchance be this piece of finery? var v T switch { case cond0: v = value0 case cond1: v = value1 case cond2: v = value2 default: v = default }
- baby 9y agoI think GP pointed out the if () construction that doesn't make sense in Go. There are no parenthesis in Go. Shows that you pretty much never used it?
- masklinn 9y agoYes I'm sure > However, your if statement is unidiomatic and quite unlike how you would normally write that particular logic in Go. If you really want to make a fair comparison, you might consider writing it in the way that Go is normally written, not the way that someone familiar with another C-style language might write the code if the ternary operator was taken from them. meant > the parens are unnecessary and they didn't just write that because reasons, which would also be the why they commented an other half dozen times since then but just couldn't come around to showing "how you would normally write that particular logic in Go" because it would take all of 5 minutes.
- baby 9y agoMaybe because you're used to it, but your second example looks unreadable to me and I know ternaries.
- citrin_ru 9y agoTernary operators can be abused. E. g. somebody can write code with nested ternary operator and long expressions. If/else will be more readable in this case. Go is a nanny language - Go authors give to coders on Go as little foredoom as possible.
- drdaeman 9y agoAnything can be abused. There is no technological or design measure that can prevent one from writing crappy code in Go or any other language. I'm certain of this as I had personally written some. Except for esoteric languages, of course. I've yet to see someone claiming some code in Malbodge is crappy and offering a refactored version. ;) Just kidding.
- code_sloth 9y agoHave you seen what atrocities people can do with nested ternaries?
- masklinn 9y agoThe only language in which you can't see atrocities is whitespace, because you can't see the atrocities.
- bluedino 9y agoThey're easily abused: H = (C == 0 ? null : V == r ? (g - b) / C : V == g ? (b - r) / C + 2 : (r - b) / C + 4);
- deleted 9y ago[deleted]
- vesak 9y agoI've been programming in languages that have them, and almost every time I have to read code that has a ternary operator, I have to stop and think what's the condition, what's the "true" branch and what's the "false" branch. This is even worse in languages that have truthy values, since you don't even have the "== True" thing to help.
- andyfleming 9y agoThe traditional way is more readable, I agree. I think it has more to do with statefulness. let example if (someCondition) { example = 3 } else { example = 4 } In javascript, for example, like above, I'm initializing a variable (with let, allowing reassign-ability). Its value can be modified later by other code. Alternatively, I could use a ternary operator and a const to avoid potential unwanted reassignments. const example = (someCondition) ? 3 : 4 ------------ Some languages, like Kotlin, actually let you use an if-else expression in a single line... val max = if (a > b) a else b ... or even allow you to return the last line of a block to assign a value: val max = if (a > b) { print("Choose a") a } else { print("Choose b") b } *val, in Kotlin, is similar to const in javascript; it's not reassignable.
- tschellenbach 9y agoYes I don't get the authors argument. Now you need 4 lines of code instead of 1 in some cases. On the flip side it's easier to read for anyone looking at your code. The weirdest part is that the author seems to prefer Java. Which is one of the more verbose languages out there.
- vec 9y agoThe problem is that I can't declare the variable and set it's value as part of the same operation. I'm forced to declare a variable with a nonsensical or incorrect value then correct it later as part of a logically distinct statement. This introduces a window into my code where some piece of memory is known to be wrong and puts the onus on me to not use it between its declaration and it's being set. It's a small nitpick in the grand scheme of things, but it forces me to allow a class of user error (and, in some cases, concurrency issues) that other styles of programming make impossible. And also it usually adds to the line count, which is annoying.
- randomdata 9y ago> The problem is that I can't declare the variable and set it's value as part of the same operation. Care to elaborate? Consider the following: var foo = func() struct{ Bar int } { if os.Getenv("BAR") == "1" { return struct{ Bar int }{1} } return struct{ Bar int }{2} }() Is there a case where the foo variable can be assigned to something other than one of the two conditional-dependent values?
- vec 9y agoOkay, "can't" is too strong a word. But I don't know a good word for "it's technically possible but is cumbersome, is not idiomatic, and requires introducing another stack frame for no good reason".
- randomdata 9y ago> and requires introducing another stack frame for no good reason With a given implementation or is there something in the Go specification that prevents this from being compiled away? If I were to write something similar in, say, C++ with a good compiler I would expect the generated code to be equivalent to using a ternary operator.
- flavio81 9y agoI have read many "criticism of Go" articles and this one is one of the most direct-to-the point. TL;DR: topics covered: 1. capitalization rules create inconsistent behavior 2. Structs do not explicitly declare which interfaces they implement. 3. No exceptions 4. A very good one: "Here’s far too much magical behavior. For example, if I name my source file i_love_linux.go, it won’t get compiled on my Mac. If I accidentally name a function init() it’ll get run automatically. (...) It’s fine for small projects but bites you on large ones, and Go was meant to address the problem of “programming in the large”." 5. Identifier name clashes 6. It’s difficult to generate Go code automatically due to the compiler being picky on imports, etc. 7. No ternary operator. 8. (complaint about sort.interface{} that could have been solved using generics) 9. "Import versioning and vendoring is terrible. " 10. No generics. 11. "The append() function modifies the array in-place when it can, and only returns a different array if it has no place left. You couldn’t ask for worse API design. How many bugs are caused by forgetting to assign the result? A lot, because initial testing may not trigger a resize." I would personally replace (6) with "absolutely no half-decent metaprogramming abilities (nor an expressive type system that could give you a workaround here.)"
- kardianos 9y ago1. Capitalization. Author cited they didn't want to change how they named things and it conflicted with Go export rules. Okay then. > 4. A very good one: "Here’s far too much magical behavior. For example, if I name my source file i_love_linux.go, it won’t get compiled on my Mac. If I accidentally name a function init() it’ll get run automatically. (...) It’s fine for small projects but bites you on large ones, and Go was meant to address the problem of “programming in the large”." 4. is great for large projects. Once you learn the convention, it is super easy to see which files are for which platforms. It makes it to navigate large trees. 6. Look at how protobufs do it. Easy to work around. 11. Understand how Go works, run go vet.
- pdpi 9y agoThe capitalisation issue is the sort of thing you'd tell a junior developer to avoid in code review: By tying one design decision (what access levels are possible) to another (code style), they effectively made it impossible to cleanly change the design around the former, because the latter won't admit any more values.
- dingo_bat 9y ago> For example, if I name my source file i_love_linux.go, it won’t get compiled on my Mac What could be the reason for this?
- sudhirj 9y agoGo enforces the convention of using the architecture name as the last part of the filename as a way to compile code specific to that platform. For example, code that used epoll would be in _linux.go, and the windows and mac versions would be named appropriately.
- deleted 9y ago[deleted]
- cesarb 9y agoThat sounds fragile. Does that mean that, whenever golang is ported to a new platform, code which happened to have the same filename suffix as that new platform's short name will stop working everywhere else?
- randomdata 9y agoIdiomatically, underscores are reserved for files that are given special treatment, like architecture-specific code or test files. It is not strictly enforced by the compiler, so theoretically you could cause this scenario, but if you write Go the Go way, it will not be an issue.
- encoderer 9y agoGolang wouldn’t be “ported” to a new platform like, say, python. You would need to re-compile for that platform, and address any platform specific code at that point.
- aaronarduino 9y agoIt really is striking to me that it is so popular to dislike Go on HN. A lot of people seem to have to voice their dislike for it instead of just not using the language.
- bartread 9y agoI think it's because there's a relatively large contingent on HN who dislike Google in general and therefore, by extension, anything they build/support. EDIT: Why the downvoting? Sure, there are valid issues with golang, but there are also a small but vocal minority on HN who enjoy being rude to Google because they don't like Google, which is what my comment relates to. I certainly don't have any axe to grind with the author, the article, or the commenter to whom I'm responding. It was just a perspective on why, in general, golang might get more of a slating than it perhaps deserves, and I acknowledge that amongst that there will obviously be some people who have many valid reasons not to like golang. Sheesh.
- kmicklas 9y agoNah I worked at Google and even there most engineers didn't like Go.
- stouset 9y agoOr maybe it’s because we’ve tried golang repeatedly, been frustrated the entire way, and are desperately hoping that someone will help us understand what people actually see in the language. I work and live in SF. Of people I talk to in real life who’ve used golang for non-Google, non-toy projects, sentiment is at least 4-to-1 against it, and in my anecdata that ratio generally increases as people use it for longer. The one consistent praise I’ve heard that seems genuine (and that I don’t entirely disagree with) is that it’s easy for a new team member to jump on board and be productive. Which sounds great, but if this is what you’re optimizing for at (in my opinion) the expense of nearly everything else, then it seems like a self-fulfilling prophecy of high turnover.
- matt_m 9y ago
- sudhirj 9y agoWhile I think most of the points raised are subjective, the overall theme does make sense to me. Of late my toolbox has become: Ruby - for problems that are programmer bound - regular web servers / APIs, CRUD. Go - for problems that are CPU / Memory bound - fast servers, proxies, APIs with lots of long I/O waits or high RPS requirements. Java - for problems that require modelling - logistics systems, data structures, algorithm heavy or design heavy problems JS/React - for UI
- zengid 9y agoInteresting distinctions. How do you get them to work together? Http and TCP/IP?
- inlined 9y agoWhen we migrated Parse from Ruby to Go, we started with two parallel efforts: 1. I built a Go implementation of resque. This let us swap any async process. Things that needed async tended to benefit from Go's speedup. 2. We also moved some internal APIs to Go in a sidecar server to help build up/validate core library implantations before replacing whole endpoints.
- sudhirj 9y agoUsually, yes. But the model lends itself to other options as well, like different micro services in different languages, or the user facing front end in Go and the back office / management systems in Rails.
- tetha 9y agoI've recently been asked about my choice of language to implement a new backend for some software. Imo, you want two languages + JS for the frontend if you do client-site frontend. You want a simple, expressive language, like python with django, or ruby with rails or sinatra. You want to implement most of your application in this language, because these languages allow programmers to be very, very productive. Put in a dumb way - 10 to 20 lines of ruby with modern libraries go a really long way without golfing. And if you notice you need performance and low latency, switch to your second language, java or go or something like that. This should be very little code, so you can throw all the really ugly optimizations at it to make it go fast. I've pushed some java services to sub-millisecond response times, but the things you gotta do with netty and lock-free data structures aren't suitable for a general audience anymore. And I guess, on top of that you need some kinda request routing, but that's simple to do with nginx/haproxy or some kind of DNS / service discovery provided by an orchestration system.
- randomdata 9y ago> It’s difficult to generate Go code automatically. But, I must say, I do really like that Go makes the AST a first-class citizen and a core part of the standard library. While not strictly a Go thing, in the languages I usually find myself programming in you have to rely on third-party implementations of varying degrees of quality or, even more common from what I see in the wild, messy string building. Being able to focus on generating the tree and have the built-in printer generate the code in the format that Go users expect is a much nicer way to generate code.
- lazyjones 9y ago> I do really like that Go makes the AST a first-class citizen and a core part of the standard library. Seconded. But I wish they would go one step further and make its compilation / code generation a first-class citizen too, including dynamic loading of generated code.
- bunderbunder 9y agoI wonder if this is really hard to do in a way that works on arbitrary platforms. The .NET framework has had it for a while, but it got removed in .NET Core.
- nickm12 9y agoAnother article to add to https://github.com/ksimka/go-is-not-good https://github.com/ksimka/go-is-not-good
- anonfunction 9y ago> The tried and true approach of providing a compare method works great and has none of these drawbacks. https://play.golang.org/p/JNhlfYoZgCV https://play.golang.org/p/JNhlfYoZgCV
- z0r 9y agoworth noting the article was published near the end of July 2016 and these methods were only added in the following month (and packaged as part of a Go release in October). i'd argue that since it's a retrospective of a few years of use, it would be fair to include that criticism even if that release had come shortly before publication
- randomdata 9y agoThe criticism is fair given the timeframe, but it equally useful to point out for the readers coming here today how the language has evolved since that time.
- lima 9y agoNeeds a (2016)
- eropple 9y agoHas anything in it changed?
- randomdata 9y ago2. Not a change per-se, but the core team are now often seen using var _ InterfaceType = Struct{} to declare that a type conforms to an interface (which will also generate a compiler error if it fails to). This seems to convey the same intent to the reader. Neither solution, as originally noted, will catch bugs in the implementation. 3. Tooling will catch when you are not appropriately handling errors, although I'm a little bit surprised this didn't already exist in 2016. But I'll assume it didn't. It certainly does now. 6. Again, not a change, but the patterns to make this a non-issue are perhaps better understood now. The points are short on intimate details, so it is difficult to determine if the problem is a result of the author not being entirely familiar with the language the way that people are today, or if there is a particular edge case that the rest of us might not consider. 8. The sort package has addressed this concern. 9. Go has had a solution for versioning from the very start, so I'm not quite sure what the parent is referring to. It was indeed a terrible solution for many organizations, but a lot of work has been done to improve on that. For all intents and purposes this is no longer an issue.
- parenthephobia 9y ago> The sort package has addressed this concern. How? Looking at the documentation, you still have to write at least three functions for each type you want to sort.
- randomdata 9y agoAn example from the docs: sort.Slice(people, func(i, j int) bool { return people[i].Name < people[j].Name })
- tschellenbach 9y agoWhile it's not perfect, if you use Dep and VG your vendoring issues are pretty much solved: https://github.com/getstream/vg https://github.com/getstream/vg https://github.com/golang/dep https://github.com/golang/dep
- senorsmile 9y agoThanks for this. I come from a Perl/Python background, and in just starting my golang journey recently, I've really missed something like pipenv/carton. VG and Dep seem to come pretty close to that.
- tetraodonpuffer 9y agoI would add retool[1] to the list as it can be useful to vendor your tool dependencies as well 1] https://github.com/twitchtv/retool https://github.com/twitchtv/retool
- andyfleming 9y ago2 additional reasons (of my own) which I don't typically see: 1. No default function parameter values. 2. You can't require struct fields. So, you can make a new struct, and then later try to access a field, you get a runtime error (that the compiler didn't catch). The second can effectively be solved similarly to the first. If a struct could take a default value (like a class), then you wouldn't miss something like creating an empty slice.
- vec 9y ago1 is a subset of a smaller issue. Default params are just a way to declare variadic functions more easily, but the language doesn't allow variadic functions at all. In go trying to define `add(int x, int y)` and `add(float64 x, float64 y)` is a compile error, even though the compiler can tell full well which one I want to use where. 2 is so annoying. Half the sdtlib wants you to use `foo.NewStruct()` and the other half uses `&bar.Struct{}`. As far as I can tell the rule is to use a bare definition where possible and only declare a New function if the zero value isn't meaningful. But there's no way for a library author to force the use of new and/or disable bare struct literals, and there's no way for an API consumer to know which category a given library will fall into other than by rote memorization. It's practically designed to invite user error. Both of these seem emblematic of a bigger problem in the design philosophy of go. It's optimized for simplicity, but often at the expense of making idiot proof interfaces difficult or impossible to build. This seems like a fundamental misunderstanding of what makes programming difficult in the first place. My package's users (including future me) aren't going to know or care about how the internals of whatever I'm throwing together work, they just want to use the API to solve their problem with as little extra contextual knowledge as possible. Go doesn't let me write an interface where they don't have to know or care, all in service of a definition of "simplicity" that doesn't seem to actually make anything easier.
- masklinn 9y ago> 1 is a subset of a smaller issue. Default params are just a way to declare variadic functions more easily, but the language doesn't allow variadic functions at all. In go trying to define `add(int x, int y)` and `add(float64 x, float64 y)` is a compile error, even though the compiler can tell full well which one I want to use where. That's function overloading rather than variadic functions. Variadic would be `add(xs int..)` where you can pass in any number of int, and they'll be collected into a slice or whatever.
- myf01d 9y agoI tried hard to like Golang but I couldn't. The only good thing about Golang is that's it's a high level compiled language that's suitable to replace Python in many use cases especially in the web, there's no other popular language in this category. However, the lack of features and forcing specific design patterns for a c-like language is totally annoying.
- sp527 9y agoMany of the deficiencies he noted are easily mitigated by tightly integrating the Go toolchain (and in particular the metalinter) with your development environment and CD workflow. I highly recommend vim-go for Vim users. The flat namespacing is rough at times, but you get used to it. It also encourages you to be judicious in what you make global, which is imo a great thing. I haven't had a problem with capitalization. It's jarring at first, but you just get used to it. There also isn't nearly as much magic as that cherry-picked example might lead you to believe. Then again, having worked with Ruby/RoR, I've seen just how gross magical behavior can get shudders and maybe my definition of 'magical' is a bit more forgiving. I'd like to see a more comprehensive list of such grievances. It's possible that the Go ecosystem has improved considerably since the author wrote this (~1.66 years ago), so I'd love to hear his take on it in the present day. I do agree entirely about the horrific use of interfaces and lack of generics. I'll also throw in the lack of enums and poor default error convention/semantics as additional glaring issues. This is all made that much more vexing by the fact that Go is so damn close to being a really great language.
- markbnj 9y agoWonder why the article isn't attributed? Had to click back to the author's home page on the site to find out who wrote it. Anyway, I think these are all good points but the one that really bothers me is no exception handling. Yeah, it makes a language more complicated to implement, but handling return values all the way up the stack is cumbersome and error prone. The vast majority of the time when something goes south deep in the stack I just want to clean up and send a signal back up to the entry point with whatever information I have. Having the language runtime handle unwinding the call stack is a big benefit in these cases. Much simpler to read and write correctly, imo.
- s17n 9y agoImplicit interfaces are the single best part of Go. And the “too much magic” comment is so misguided - author complains it is bad for large codebases but it’s exactly the opposite. In the real world everyone uses conventions like those enforced by Go’s so called magic. Having these built into the language means you don’t have to figure them out every time you look at a different programmer / team’s code.
- stouset 9y agoI repeatedly see this point re: implicit interfaces, and yet it’s never accompanied by an explanation of its actual benefits. The one defense I’ve heard is that it allows you to define interfaces that are implemented by types you don’t control, but this completely ignores the fact that doing so implicitly isn’t necessary for such a feature, and other languages (e.g., Rust) elegantly demonstrate why that is.
- bunderbunder 9y agoI'd go one further and say that the way other languages do it does a better job of letting you define interfaces for types you don't control. Sometimes the type you want to apply your interface/trait to doesn't have a function that does what you need, but could easily be assembled from other members of the type. And sometimes it does have a function that would work, except that the name is different. There's an Uncle Bob talk I watched a while back where he suggests that oftentimes language designers will say just about anything to avoid admitting that the real reason a feature is absent or was implemented in a hacky way is for the convenience of the compiler's authors.
- rcoveson 9y ago> Implicit interfaces are the single best part of Go. Help me understand this. The concern raised by the author regarding method signatures versus method contracts seems valid, and I have a hard time envisioning where implicit interfaces would be useful. Do you just hope to get lucky? Somebody, without knowing about the interface, would have to use all the same parameters and return types, the same method name, and implement the contract in a compatible way for it to work, right?
- andrewprock 9y agoSomewhere in my drafts, I have a 101 problems with Go. I only made it to 43, but I only spent an hour or so on it. The language they were shooting for feels like "C with garbage collection". The language they were actually aiming for was probably closer to "something we can easily transpile python to". In the end, the language they got is a bit of a mess, with fairly arbitrary hyper-pedantry causing more problems than it solves. I still use it, but so far only in the small.
- vec 9y agoGo's a great language for Google. Their use case needs very high througput but can tolerate GC pauses, their code is a giant single-repo monolith with thousands of contributors where pedantry prevents conflict, and they hire a bunch of people straight out of college who haven't figured out how not to be clever yet. "C, but with unremovable training wheels" is a really good tradeoff for their specific situation. Why anyone who doesn't share Google's unique issues would want to use it, though, is beyond me.
- pasabagi 9y agoI like it because I genuinely don't have opinions about many of the things Go is opinionated about. As I see it, programming is something of a craft, people have different opinions about how to do it, and the only real way to evaluate these opinions is to have a lot of experience. Not having a great deal of experience, I like that Go essentially proscribes a lot of the stuff people normally have opinions about. It pushes you to write in a way that, for better or worse, some people think is good. I trust their understanding of the tradeoffs involved in engineering software better than mine - and I also trust that, when I outgrow them, I'll notice.
- masklinn 9y agoGo feels a bit like an alt.history version of Java 1, where the fanfic writer thought Java was not convenient enough but also not patronising enough.
- miguelmota 9y agoAll the things listed are the reasons why I personally LOVE Go. Convention over configuration.
- simula67 9y agoIs no one else annoyed about the GOPATH pedantry ?
- __david__ 9y agoI am too. I spend way too much of my time hacking around stupid GOPATH issues.
- sethammons 9y agoI've been using Go as my primary language now for a few years. I never change nor have issues with GOPATH. Now, older applications that are using godep for vendoring still, that is something I have lost far too much time against.
- sonaltr 9y agoThat's one of the first issues I've had with Go. To the point where, all my go projects are something along the following lines: projectname: |- go |-- src |--- domain.com |---- username |----- projectname |------ Actual Code goes here... |-- pkg |-- bin It's a fun time explaining this to anyone new on the team...
- sethammons 9y agoIs that what you are checking into source control? For every project I work on, the projectname directory is where .git lives. It so happens that when I 'go get', it goes into the whole structure you reference above based on my one GOPATH that I never, ever change. For those new to Go, you just show them how it works once. For those used to Go, there are no surprises.
- sonaltr 9y agoI'd check the internal folder (projectname/go/src/domain.com/username/projectname) into source control (domain.com/username/projectname). Everyone has a different way they like to setup their environment and I didn't want to push my ideas onto other users.
- jhillyerd 9y agoI think this article is a great illustration of the things a Java developer will struggle with while they are learning Go. I no longer write Java, and I now view many of these as strengths. 1. Capitalization rules vary by language, I remember struggling with camel cased naming in Java in some scenarios. I also thing the example given is bad, User.user is a poor name in any language. 2. Structs w/ implicit interfaces. I like this feature of Go, and it's never bitten me in the way the author describes. I never liked having to declare them in Java. And there is an easy way to ensure your particular type implements an interface in Go. 3. I prefer not having exceptions, and linters will tell you when you are not checking returned errs. I do wish Go would offer tools to reduce the amount of if err != nil {} blocks, particularly in IO heavy code. 4. Go's build system is very easy to understand compared to something like Makefiles or Maven. I don't consider a few conventions "magic." I have mixed feelings about init(), but I think it's much better than trying to come up with thread-safe alternatives to compile regexp, etc. 5. Naming. Writing unit tests from an outside perspective (package xyz_test) will help you pick better names, and you will run into less conflicts. In Java you see hideous combinations of Abstract, Singleton, Factory, etc. I much prefer Go's concise/pragmatic naming style. 6. I don't do much code generation, can't comment. 7. I do miss ternary sometimes, but I have seen it abused with very long statements in other languages. I would note that "else" has become a code smell in Go, it's more normal to assign a value and then change it. 8. Sorting. I like that not everything needs to be an object in Go. Having to add a few extra lines of code the rare occasion I need to make something sortable is much better than a project full of Java class/getter/setter boiler plate for what should have been a struct. 9. Yes, dependency management is a mess. No argument. Looking forward to dep becoming official. 10. I do sometimes miss generics, but I started writing Java before it had generics so I can live without them :P. I think they can lead to readability problems when overused. 11. append is a bit confusing, but hiding how it works should be considered "magic." linters will help you here.
- parenthephobia 9y agoI don't understand your point about sorting. What sort-related Java boiler plate are you referring to?
- 013a 9y agoEvery day someone publishes their snowflake opinion on why Go is terrible. Every day, hundreds of highly productive engineering teams write millions of lines of Go, powering web services and developer tools you use on a daily basis. So I'm inclined to side with the engineers actually putting the hours in instead of the talking mouth bloggers. If there comes a day when Google, or Uber, or Twitch, or Cloudflare comes out and says "Go was a mistake and we're starting to replace our old Go code with this new thing", then I'll start listening.
- aaronblohowiak 9y agoThis kind of comment makes me not want to visit HN. You can make your point without being so off-putting.
- crdoconnor 9y agoFrom python to go and back again, by mozilla: https://docs.google.com/presentation/d/1LO_WI3N-3p2Wp9PDWyv5B6EGFZ8XTOTNJ7Hd40WOUHo/mobilepresent?pli=1#slide=id.g70b0035b2_1_168 https://docs.google.com/presentation/d/1LO_WI3N-3p2Wp9PDWyv5...
- 013a 9y agoThere's also a good writeup from Asciinema [1] with a similar theme. These are valuable articles from people who have clear domain knowledge in their problem area, which accurately discuss the pros and cons of both approaches. There's a huge difference between "Go doesn't work for us, here's why, here's what works" and "I don't like Go". The latter should be a Facebook post and has no place on HN. [1] http://blog.asciinema.org/post/and-now-for-something-completely-different/ http://blog.asciinema.org/post/and-now-for-something-complet...
- gherlein 9y agoTwo years old. Could have been titled "I reject the goals of golang" - many of the things he hates were actual design objectives of the language. Some are so minor it's silly. Bottom line is if you don't like it then don't code in it.
- baby 9y ago> 1. Go uses capitalization to determine identifier visibility This complaint sounds like it's more about Go doing it differently than the language the writer is used to. > 2. Structs do not explicitly declare which interfaces they implement. It sounds like this is probably to have structs that will please several interfaces, but I can't find a good example of that in the go std lib. Anyone? > 3. It’s far too easy to forget to check errors use a linter that warns you when you do this > 4. if I name my source file i_love_linux.go That's actually a pretty cool and light way to implement something for multiple platforms I thought... > If I accidentally name a function init() Go has so few forbidden keywords that I can't really appreciate this complaint. > In Java [...]. Sometimes I find it hard to read Go So Java is easier to read than Go? Come on! > I see no good argument for omitting this [ternary] operator Less ways to write the same thing. Improve code readability. > Import versioning and vendoring is terrible I would say Go has the best standard tools. It's not perfect yes, but it's better than other languages. > No generics that's a good thing This post really feels weird when in another thread of HN's FP you have people arguing that a 35 LOC package is a good thing in js.
- avshyz 9y agoThe worst thing about go, it's its dev community. Anyone who claims otherwise probably hasn't read any of the GitHub discussions (things like this https://github.com/golang/lint/issues/65 https://github.com/golang/lint/issues/65 are pretty common; when users are being told they don't understand how amazing Go is.)
- skrebbel 9y agoI read that entire issue thread and I don't see a single instance of a user being told they don't understand how amazing Go is.