News for hackers. Stuff that matters.
Re:Green vs. Brown Programming Languages by brundolf on Thursday April 22, 2021 @11:33AM (#26903905)
My intention wasn't to trash-talk, and I admitted my bias up front. I'm just speculating, and I think that speculation is legitimate and relevant to the subject at hand.

It's my belief that whatever difficulty there is around onboarding people into Rust (setting aside the question of exactly how much of a problem that actually is or isn't) is "constant", where the difficulty of onboarding people into a legacy codebase is, shall we say, "polynomial" over time. Rust adds some constant overhead in exchange for reducing that polynomial growth, and my belief is that at some point the larger polynomials outpace it, ending up with more total difficulty for newcomers to a given legacy codebase. Of course time will tell.

Re:Green vs. Brown Programming Languages by throwaway894345 on Thursday April 22, 2021 @12:31PM (#26904694)
> constant vs polynomial

This is an interesting way to look at it, but I actually think this perspective favors Go considering that there is less variety across Go projects than other ecosystems, including Rust. Of course no programming language can hold constant the business domain, but there are things like which “error handling framework”, “for loops vs iterators”, “sync vs async”, “prefer owned vs borrowed by default”, etc that apply to Rust and not to Go. And of course, Rust lets you build some gnarly abstractions which simply don’t exist in Go.

Go gives you less choice, and thus projects are more similar, and thus I suspect legacy Go code adds will be easier to maintain.

Of course this property may not endure once Go acquires generics.

It should be said that I’m a big fan of both languages, and I am especially enthusiastic about Rust in that it fits my compulsion to have code that is both very abstract and very performant.

Re:Green vs. Brown Programming Languages by adkadskhj on Thursday April 22, 2021 @05:19PM (#26908341)
> Go gives you less choice, and thus projects are more similar, and thus I suspect legacy Go code adds will be easier to maintain.

Side note, Go gives you less tools - but not often less choice. Eg if you need to iterate and map, you still need to iterate and map. Go didn't change your application needs simply because it inhibited your ability to execute. Instead, you do what you need despite Go. Which often amounts to repeated functions, loops of loops, functions in loops to use defers, etcetc - you reinvent wheels. Go didn't reduce the application complexity, it just gave you less tools to solve it.

While some argue less tools is easier. I argue less tools often results in poor, messy abstractions. Those are traits that fight maintenance more than ease it, in my mind.

By the end of my Go tour, i was tired and wanted off the simplicity ride. The language was a burden, to me.

Re:Green vs. Brown Programming Languages by amscanne on Thursday April 22, 2021 @09:48PM (#26910207)
Ultimately you’re expressing an anti-simplicity sentiment, which is well aligned with the parent post. Clever abstractions may appear to reduce the “burden”, but they are often fashionable and add cognitive overhead. Go does indeed often force you to do things the “dumb” way (see your own examples) but the thesis is that this is easier to understand and maintain over time.
Re:Green vs. Brown Programming Languages by wtetzner on Saturday April 24, 2021 @12:52PM (#26926325)
> Ultimately you’re expressing an anti-simplicity sentiment

I disagree. First, making a language simple doesn’t make programs simpler, and often does the opposite.

I’m also not sure I buy the idea that Go is actually simple. It lacks a lot of features, but that’s not the same as being simple. I mean, it supports runtime reflection, which seems more complicated than features like traits or generics. And code using reflection is never simple.

Re:Green vs. Brown Programming Languages by BiteCode_dev on Friday April 23, 2021 @02:49AM (#26911738)
I'm sure somebody said something like that when all those kids started to the clever abstractions that were functions instead of doing things manually in assembly.

Simplicity!

Re:Green vs. Brown Programming Languages by throwaway894345 on Friday April 23, 2021 @09:32AM (#26914570)
This is just vapid snark. Of course some abstraction is helpful, but there's also a point at which abstraction impedes understanding. Ergo, we're debating where the "sweet spot" is. Note also that we can say "Go is the sweet spot for most applications" while also acknowledging that it makes certain kinds of programming difficult (e.g., writing a compiler). It's okay to recognize tradeoffs; there's no need to oversimplify or otherwise engage dogmatically.
Re:Green vs. Brown Programming Languages by carlhjerpe on Friday April 23, 2021 @07:06AM (#26913422)
Some developers don't want to use the ternary operator because it's "too complex".

I believe there's a middle ground to be found where further abstractions add complexity rather than reduce it. Where that middle ground is, I don't know.

Re:Green vs. Brown Programming Languages by wtetzner on Saturday April 24, 2021 @12:54PM (#26926344)
That’s a strange definition of complexity. I can see people avoiding the ternary operator because the syntax is hard to read, but it’s no more complex than `if`.
Re:Green vs. Brown Programming Languages by pjmlp on Friday April 23, 2021 @01:01AM (#26911124)
Exactly, people advocate that there are those shipping stuff in Go, naturally there is the case.

Anyone that had to work with Assembly in production was happy to have any kind of high level language to start with.

Re:Green vs. Brown Programming Languages by brundolf on Thursday April 22, 2021 @12:43PM (#26904842)
> error handling framework

Not sure what's meant by this; Rust has a standardized Result type, with dedicated syntax for early-returning errors and type checks that make sure you handle them (or at least explicitly ignore them). Go, on the other hand, has a shaky error story and from what I've heard it's a constant problem due to enforcement-by-convention.

> prefer owned vs borrowed by default

Not really sure what this means either... the owner of a value generally falls out naturally from how you're trying to use it. It's not really an either/or option. It needs to live where it will be around long enough for everything that's done with it, and everything other than the owner should get a reference to it. Maybe you're talking about passing by reference vs implementing Copy? If so, that's mostly a performance concern.

> Of course this property may not endure once Go acquires generics

Yeah- one of the few things I like about Go is that it doesn't have generics (yet). I've seen generics make TypeScript codebases impenetrable, and I think there's a decent case to be made for not having them at all.

Re:Green vs. Brown Programming Languages by throwaway894345 on Thursday April 22, 2021 @01:09PM (#26905157)
> Not sure what's meant by this; Rust has a standardized Result type, with dedicated syntax for early-returning errors and type checks that make sure you handle them (or at least explicitly ignore them). Go, on the other hand, has a shaky error story and from what I've heard it's a constant problem due to enforcement-by-convention.

You may not like Go's convention (indeed, I don't love it although I think it works fine in practice), but the only error handling mechanism in Go is `if err != nil { ... }`. On the other hand Rust has many. This is not incompatible with your observation of "a standardized Result type". Here is a survey of the error handling landscape circa 2019: https://blog.yoshuawuyts.com/error-handling-survey/

> Not really sure what this means either... the owner of a value generally falls out naturally from how you're trying to use it. It's not really an either/or option

Or you have code which clones gratuitously out of convenience, often because some API unnecessarily asks for ownership of its arguments. Cloning is often just easier than battling the borrow checker, so in the real world with its deadlines, we tend to see a lot of clones because it's more convenient and performance is rarely a concern.

> I've seen generics make TypeScript codebases impenetrable, and I think there's a decent case to be made for not having them at all.

In fairness to TypeScript, I suspect much of this 'impenetrability' is because type annotations were added to existing JavaScript. I suspect the gratuitously complex types were already present in the original JavaScript, but the type annotations brought the pain to the surface. Similarly, I suspect TypeScript has a massive amount of developers who have only ever developed in JavaScript, many of whom are trying to shoehorn their bad JS habits into a statically typed language. You see this in other statically typed languages as well, but never on a scale that leaves a mark on the overall ecosystem.

That said, I think everyone should learn pre-generics Go if only to experience the value of an ecosystem that doesn't value egregious abstraction (again, I say this as someone who personally values egregious abstraction). And no, I don't think Java 1.0 counts (wherein people tried to shoehorn everything into implementation inheritance rather than generics).

Re:Green vs. Brown Programming Languages by adkadskhj on Thursday April 22, 2021 @05:20PM (#26908364)
> You may not like Go's convention (indeed, I don't love it although I think it works fine in practice), but the only error handling mechanism in Go is `if err != nil { ... }`. On the other hand Rust has many. This is not incompatible with your observation of "a standardized Result type". Here is a survey of the error handling landscape circa 2019: https://blog.yoshuawuyts.com/error-handling-survey/

By this definition, Go has many too. Go has lots of libraries to wrap error types, combine errors, preserve error data, etcetc.

Errors are one of the more similar things between Rust and Go, honestly.

Re:Green vs. Brown Programming Languages by throwaway894345 on Thursday April 22, 2021 @06:07PM (#26908757)
That’s a fair point. I forgot about the various errors packages in Go. I’ve been writing more Rust lately.
Re:Green vs. Brown Programming Languages by steveklabnik on Thursday April 22, 2021 @01:50PM (#26905683)
> Here is a survey of the error handling landscape circa 2019

All of this is helper functions built on the same identical core that your parent was talking about.

Not that that isn't its own kind of thing, but I think that the problems are different than "standard" vs "not standard"; this problem is only possible because there is a standard, and they all interoperate well with each other.

Re:Green vs. Brown Programming Languages by throwaway894345 on Thursday April 22, 2021 @02:22PM (#26906106)
Indeed, Rust has a very well thought-out core which enables variability (read: "complexity") of all kinds. Variability is a fine thing, but it is at odds with onboarding users from one project to another. I wasn't trying to overstate error handling in particular--I mentioned it briefly in a longer list of examples which in-aggregate affect one's ability to onboard to a new project. I also don't mean to convey that going between Rust projects is harder than in other languages on average--I don't think this is the case at all, only moreso than Go in particular.
Re:Green vs. Brown Programming Languages by void_mint on Thursday April 22, 2021 @12:55PM (#26904994)
> My intention wasn't to trash-talk, and I admitted my bias up front.

I apologize if my statement came off aggressive - I wasn't necessarily trying to say that you're shit talking specifically, just that it seems like lots of/most programming language discussions on HN devolve into some form of "Rust Good Go Bad" or "Go Good Rust Bad", which I think is usually just inflammatory.

Your prediction is 100% bias-based. There are equal (probably more) developers that would say the same thing you said, but with Go being the language that sticks and Rust being the language that's hated. The bias is the entire answer. An unbiased answer is "Who knows" and "Probably both will be loved and hated".

Re:Green vs. Brown Programming Languages by reducesuffering on Thursday April 22, 2021 @01:24PM (#26905338)
> Your prediction is 100% bias-based. There are equal (probably more) developers that would say the same thing you said, but with Go being the language that sticks and Rust being the language that's hated.

It actually sounds like your answer is more bias-based, because your intuition is more wrong here. There is data from the 2020 Stack Overflow survey[0] indicating a significant lead for devs who use Rust and continue to want to develop in it, vs. Go. 86.1% Rust vs. 62.3% Go.

[0]https://insights.stackoverflow.com/survey/2020#most-popular-...

Re:Green vs. Brown Programming Languages by lyjackal on Thursday April 22, 2021 @06:20PM (#26908857)
In the context of the article, I think that can be attributed to age (go is older than rust, so trending towards the "brown field." See for example Scala, which is a little bit older, and ended up in both loved and hated lists. I'd speculate that Go will be in the same camp in 4 years or so based on polarized sentiment I've observed.

That being said, there may be something about strict/complicated languages like scala and haskell that tends to polarize developer sentiment. Rust seems like it could fall into that same pattern based on the "up front" work that it demands.

Re:Green vs. Brown Programming Languages by nindalf on Friday April 23, 2021 @01:29AM (#26911276)
Those numbers aren’t comparable.

Go and Rust don’t have similar numbers of developers. My intuition is that Go has an order of magnitude more. It’s like comparing product reviews on a shopping website - 4.7 based on 20 reviews vs 4.3 based based on 200 reviews. It’s hard to say which is better. You’d have to go deeper into each of those reviews to learn if the pros and cons apply to your use case.

Another important metric, as OP pointed out, is the age of the code base these devs are working on. Rust devs are probably working on code bases they started and Go devs are maintaining someone else’s code base.

That said, I agree with the current top comment on the thread - Rust code based may prove easier to maintain when we look back 10 years from now.

Re:Green vs. Brown Programming Languages by void_mint on Thursday April 22, 2021 @11:51PM (#26910806)
> It actually sounds like your answer is more bias-based, because your intuition is more wrong here. There is data from the 2020 Stack Overflow survey[0] indicating a significant lead for devs who use Rust and continue to want to develop in it, vs. Go. 86.1% Rust vs. 62.3% Go.

That's great to hear. Unfortunately, language popularity in enterprise/production environments isn't really based around how much a developer loves or hates something.

There are more Go programs/programmers now than Rust, was the basis of my post that you're objecting to, which can be verified if you scroll up on the link you posted.