News for hackers. Stuff that matters.
Re:Rob Pike interview by gorgoiler on Thursday April 30, 2020 @11:50AM (#23032173)
Go is the language that made me realize I’m not much of a production quality software engineer.

Normally I would be quite happy riffing with ideas in Ruby or Python, and just running my code and iterating trying to figure out what to do.

When I tried this in Go, every time I wanted to change the shape of my code to try doing things slightly differently I had to do a lot of work to get the code to compile again.

I feel like a professional coder wouldn’t hit that road block because they’d have a better idea what they were doing in the first place.

I have scurried back to Ruby with my amateur tail between my legs, but I hope to try Go again some day and find a style that’s a bit more forgiving of my not-Staff-SWE skills.

Re:Rob Pike interview by jpgvm on Thursday April 30, 2020 @12:00PM (#23032312)
This isn't true at all.

Go is not the tool of choice for experienced professional programmers for exactly this reason.

The ability to quickly refactor code is very important and Go fails at it horribly for a number of reasons. 1) sheer verbosity. 2) multiple return makes altering function signatures tedious. 3) no generics mean code is written in hard to refactor styles out of the box 4) poor reflection support 5) poor tooling compared to professional grade languages (Java/C#/etc)

I could go on but long story short it's not you, it's the tool.

These issues can be overcome by remaining vigilant but for the most part they are part of the accepted "cost" of Go.

Which is to mean you pay them in return for a language that is very easy to learn (albeit hard to master because of the above problems), has a great runtime and has reasonable out of the box performance and memory footprint and stellar compile times.

These tradeoffs can actually be right for some teams, i.e larger ones with less experienced engineers that can afford to spend more cycles doing busy work refactorings.

However it's often a poor fit for small teams trying to work on software that is evolving quickly and can benefit from features of more powerful languages.

Re:Rob Pike interview by dnautics on Thursday April 30, 2020 @01:39PM (#23033604)
> Go is not the tool of choice for experienced professional programmers for exactly this reason.

that's really funny, because I always thought of Go as the language that programmers who were aging out flocked to because it has

1) google-cred

2) familiar algol syntax

3) close enough to C++ to make a run for it

4) (systems-wise) safe enough to make it worth it

5) hip enough that you don't seem like an aging out programmer anymore

(I myself am an aging out programmer, that ironically just got started, so take that as you will)

But my observation is from 5 years ago and things may have changed.

Re:Rob Pike interview by pjmlp on Friday May 01, 2020 @02:47AM (#23039640)
3) Would be true when comparing with pre-C++98, back when C++ compilers shipped pre-processor based macros for writing generic code, and used something like TObject as interface{}.
Re:Rob Pike interview by cy_hauser on Thursday April 30, 2020 @04:36PM (#23035779)
I had always thought the same thing about high use by aging out coders. Don't know how representative it is but the just released Go annual survey results seem to show that isn't the case.
Re:Rob Pike interview by pjmlp on Friday May 01, 2020 @02:48AM (#23039642)
We are busy keeping Java, .NET and C++ codebases running.
Re:Rob Pike interview by dvirsky on Thursday April 30, 2020 @01:15PM (#23033311)
> Go is not the tool of choice for experienced professional programmers

[citation needed]

Re:Rob Pike interview by Insanity on Thursday April 30, 2020 @01:47PM (#23033718)
it's turning into a bit of a theme by people not used to Go to claim this I guess..
Re:Rob Pike interview by dvirsky on Thursday April 30, 2020 @06:38PM (#23037052)
In general good "experienced professional programmers" don't have one "tool of choice" but their tool of choice varies by what they're doing. I would choose Go for a lot of things, but not for everything.
Re:Rob Pike interview by jpgvm on Thursday April 30, 2020 @06:55PM (#23037214)
Whilst I generally agree with this it's definitely the case that experience leads you to prefer certain tools over others even when they may both be usable for a specific task.

i.e Go is relatively well suited for a simplistic web service. But even if I don't expect to need to extend it I would still prefer to write it in something that is more extension friendly than Go.

Therein lies the problem. Go actually isn't better than other tools at most things so if you don't actually have a tool of choice than Go is rarely the best choice assuming you are comfortable with a large range of tools.

Building a database? C++/Rust (arguably JVM) are better choices. Building a correctness critical piece of software? Rust/Haskell are likely better choices if this is your main constraint. Building a big data pipeline? JVM language of choice is probably the clear winner because of sheer ecosystem momentum. Building a large web application? JVM/C# are miles ahead of the competition here. Building a bunch of microservices? This is probably one case where Go actually does reasonably well, if you work hard architecturally to constraint to complexity of each service it can do OK here. Unfortunately, just OK. JVM/C# probably still beat it out here because of better tooling. Building a kernel? C/C++/Rust/D/Zig. GC is a non-starter. Building a browser? See above.

Once again, I could go on. Go can be used for lots of these but all of the tools above are better for each of these domains. So if you are an experienced professional with a wide array of languages at your disposal what are you going to pick Go for?

Re:Rob Pike interview by sswezey on Thursday April 30, 2020 @08:50PM (#23038030)
I like the lack of enterprise layers that Java espouses, the simply deploys of a single binary, built in support for JSON and a perform at HTTP server. A code base that is accessible from the high level all the day to the fundamentals of the standard library. If I can’t find documentation, I can read Go code and grok it instantly. There is one style - gofmt style. Honestly, I rarely need genetics and I prefer the simplicity over over-engineered templates classes in Java and C++. If I need to do concurrency, it’s super simple and easier to get performant than Java or C++. Working with junior developers? They can learn Go in a week. Good luck with C++ and to a degree Java with the norm of relying on layers of Beans and XML frameworks.
Re:Rob Pike interview by dvirsky on Thursday April 30, 2020 @11:56PM (#23038978)
If you consider all the trade-offs (performance / simplicity / security / etc), and you need to create robust RPC services, whether microservices or outward facing API frontends - Go (to me at least) will be the best choice considering all aspects (C++ may be faster but harder to write/debug in, Java more widely adopted but a nightmare in every other aspect, Python easier but slower and less stable, etc etc).

Think about successful tools use Go - they would have been a nightmare in some aspect in most other languages. Can you imagine Kubernetes in Java? Docker in Python? It shines where it shines for a reason.

Re:Rob Pike interview by pjmlp on Friday May 01, 2020 @02:53AM (#23039664)
> Can you imagine Kubernetes in Java?

Yes, I can, that is how it was originally prototyped and due to pressure of Go advocates on the team it got rewritten in Go.

However given that Go type system isn't as advanced as Java, the result wasn't the best one.

"The clusterfuck hidden in the Kubernetes code base"

https://archive.fosdem.org/2019/schedule/event/kubernetesclu...

"Fixing the Kubernetes clusterfuck"

https://fosdem.org/2020/schedule/event/kubernetes/

Re:Rob Pike interview by saturn_vk on Thursday April 30, 2020 @04:13PM (#23035552)
> The ability to quickly refactor code is very important and Go fails at it horribly for a number of reasons. 1) sheer verbosity. 2) multiple return makes altering function signatures tedious. 3) no generics mean code is written in hard to refactor styles out of the box 4) poor reflection support 5) poor tooling compared to professional grade languages (Java/C#/etc)

1) there are worse languages in that category. some are even more widely used.

2) that doesn't make sense. return arguments are part of the argument list signature. either changing any argument makes this tedious, or none does. you indicated that only return ones do for some reason.

3) can't argue there. in the rare occasion that type asserting interfaces is required because of lack of generics, things really do suck.

4) can you elaborate on that?

5) only thing i found lacking was absence of advanced refactoring tools. for everything else, the available tooling seems to be on part with what i've used with java (anecdotal)

Re:Rob Pike interview by erik_seaberg on Thursday April 30, 2020 @04:22PM (#23035636)
On tooling, Go doesn't seem to have anything like Java's

- configurable sandboxing

- hot reloading

- AspectJ (cross-cutting code injection at link time or during classloading)

- JMX (extensible RPC API for metrics and administration)

- YourKit (interactive remote profiler wired in during classloading)

Re:Rob Pike interview by nappy-doo on Thursday April 30, 2020 @12:02PM (#23032348)
use a better editor. VSCode, vim with vimgo, emacs with whatever those apes use.
Re:Rob Pike interview by jpgvm on Thursday April 30, 2020 @12:04PM (#23032369)
This helps but doesn't solve the core issues. I generally use Goland whenever editing Go code (as I am currently doing sigh) but even with such a powerful IDE the language is the main limiting factor in carrying out refactorings (which again, I'm doing right now).
Re:Rob Pike interview by dlsniper on Friday May 01, 2020 @01:40PM (#23044553)
What kind of refactorings would you like to do but GoLand doesn't help with? I'd be interested in that kind of feedback. Thank you!
Re:Rob Pike interview by centimeter on Thursday April 30, 2020 @12:23PM (#23032638)
I shouldn't need an industrial-strength editing engine to efficiently express my ideas. (And don't, if I'm using a nice expressive language.)
Re:Rob Pike interview by throwaway894345 on Thursday April 30, 2020 @01:00PM (#23033148)
Generally speaking, Go is one of the easiest languages to write with a simple text editor. Rust is among the hardest due to its complexity and demanding static analysis. This isn't a bad thing, and tools like rust-analyzer make writing Rust a lot easier. But rust-analyzer is amazing technology from the future; hardly an ordinary text editor plugin.
Re:Rob Pike interview by eropple on Thursday April 30, 2020 @01:14PM (#23033295)
> Generally speaking, Go is one of the easiest languages to write with a simple text editor.

And one of the absolute dog's-breakfast worst to refactor regardless of editing environment. No statically typed language should be this hard to do basic changes in, and yet it exists.

Being writable in a "simple text editor" isn't a plus when the "simple text editors" in 2020 are IDEs with the name filed off.

Re:Rob Pike interview by mcqueenjordan on Thursday April 30, 2020 @04:27PM (#23035697)
OK, I'll bite...

The demanding static analysis and clear compiler errors actually make it easier and more robust to write unaided for me. Especially when it comes to refactoring -- it's essentially a process of resolving the compiler errors and you can be pretty confident you've arrived at a correct result.

Source: I write Rust everyday in a plain text editor without syntax highlighting.

Re:Rob Pike interview by centimeter on Thursday April 30, 2020 @04:19PM (#23035605)
> Go is one of the easiest languages to write with a simple text editor.

As long as you never refactor anything.

> Rust is among the hardest due to its complexity and demanding static analysis

I have never wanted or needed to offload Rust's "demanding static analysis" to my text editor. Rust's linearity/lifetime type system is really quite simple - it's not like you have to keep track of long-distance lifetime relationships in your head.

Even a reasonably powerful type system with e.g. HKTs, arithmetic, etc. like Haskell's rarely benefits from external tooling, and any interactivity can often be just as easily done via a polling build tool like ghcid rather than integrating it into a text editor.

The one place where it strikes me as sane to have a "smart" text editor is if you're using a proof assistant-style language like Coq/Idris/Isabelle/Liquid Haskell/etc. where there's actually a non-trivial amount of interactivity required while writing the code.

Re:Rob Pike interview by nappy-doo on Thursday April 30, 2020 @12:30PM (#23032756)
ever written Java?
Re:Rob Pike interview by losingthefight on Thursday April 30, 2020 @03:13PM (#23034885)
I am going to disagree pretty heavily with this. You don't give any explanations, evidence, or mention your experience, so let me lead with mine before I explain where I think you are wrong.

I cut my teeth in the 90s with C, and have professionally used PHP, Python, Java, C#, Javascript (both server and client side), and have been using Go as my main choice for the past 4 years. I've worked on teams as small as 1 up to teams in the hundreds, both as an individual contributor and tech lead. I say all that because I would consider myself an "experienced programmer". I am mostly writing APIs for web and mobile apps to communicate with, although I have written code in a wide variety of contexts. I say all of that because I can't imagine going back to Java or Python. I even migrated a bunch of my services from Typescript to Go because I found Go to be far more productive and easier to work with. Refactoring as always been easy. At my current job as a Chief Software Architect, I have over 25,000 lines of code in production running Go. I say all of that to provide background and context on my humble opinions.

1) Verbosity is among the leanest I have seen for a type-safe language. Compared to Java or C#, it is much more like Python. Perhaps the most verbose sections are a repetition of "if err != nil" blocks, but those are there for a reason and I explicitly prefer that over long "try catch" blocks.

2) Not sure what you are arguing here. If you are talking about functions returning multiple values, many languages do that. If you really don't want to, return a struct or a map. Or choose to not return multiple values. That is a choice of the programmer, if I understand you correctly. You could also use any of the major editors (I prefer VS Code) to refactor; the tooling is awesome (see #5)

3) Maybe it is due to the nature of what I do, but I have never once thought "man, I wish I had generics for this." I am sure there are some who genuinely need it, but I haven't run across that in my own experiences. I find that structs and interfaces have been everything I needed there, but again, my use case is on the server.

4) I haven't needed to use reflection either, so I have no comment here.

5) Hard disagree. GoLand (by Jetbrains) and VSCode are INCREDIBLY powerful. I will never go back to Eclipse or Visual Studio if I can avoid it. Go ships with tons of tools (formatters, linters, vetters, etc) and integrate with a ton of others (delve, etc). So your statement simply isn't true.

Your last statement is probably what drove my response. I was able to spin up a full API server incredibly quickly alone, and then with one other person, in a fresh startup with minimal issues. Rules and requirements were changing daily, so the code and business logic had to change. I can't imagine having to do that kind of work in Java (don't get me started on the deployment story here...). I would argue Go is a great fit for small teams. It is a small language with opinions, so programmers can focus on their use case.

Go isn't perfect, but it's my tool of choice. That's my two cents though.

Re:Rob Pike interview by dehora on Thursday April 30, 2020 @05:55PM (#23036633)
Great to see an answer that provides context and reason for a language preference. By way of reflection on your answers:

1) This is hit and miss for me. I have to read Go code frequently: not every day or even week, and sometimes under incident pressure. It's less verbose than Java/C#/JavaScript, more verbose than Python/Ruby/Scala. But it's sufficiently verbose to require, for me, cognitive discipline to not skim (ie, "I've been skimming, need to go back up" awareness). So when I'm reading go I put my Java/C#/JavaScript hat on not my Python/Ruby/Scala hat. Not a big problem, but it was so, so close to being in the latter camp. For me then, its regularity claims are something of a wash such that I'd like to see some supporting empirical data or summation of anecdote that it does in fact optimise well here and make good engineering tradeoffs.

2) The problem (I think) is being being to skip by the returned values. It's better than return codes in C, but you're not absolutely required to handle them. I suspect trying to patch structured returns onto an algol-like is a dead end, and if we want structured returns, we want to use a language that really induces us to 'process it forward' eg via map/flatmap/case handling, rather than adding ceremony around if. I think Go made sensible and realistic choices here.

3) Lack of generics are a pain, but a pain for writers. Go does not optimise for that concern, except afaict for its core language creators who have escape valves. The conspiracy theorist in me says Go was wait and see on generics (and exceptions, and objects) as a function of when it was incepted, and may now reasonably conclude that generics are here to stay so the language will need to solve for them, but objects and exceptions were good holds. ie, I don't completely buy it required a decade to figure it out, but could buy it took a decade to observe generics are not going away.

4) In Go, this seems to be satisfied by codegen and templated YAML. I wonder if this is generational, in that the need for reflection might be lessened because of how work on cloud/virtualised systems happens (networked services handling data in and out, with regular deployments).

5) Agree. GoLand I find a great tool for reading and delving into programs, and VSCode is a fantastic 'every day carry' for code.

Re:Rob Pike interview by runald on Thursday April 30, 2020 @10:06PM (#23038439)
Javascript is plenty concise and expressive. Can you give an example where Go is less verbose compared to javascript?

Edit: C# is actually quite expressive too, I have a hard time believing Go is less verbose than C#.

Re:Rob Pike interview by jpgvm on Thursday April 30, 2020 @10:53PM (#23038631)
Most people that think C# is verbose haven't used modern C#. It's an excellent language and if I had to go back to MS world I wouldn't bad sad at all.

That said right now I get little opportunity to use it because it doesn't fit into the current ecosystems I am working in. Shame because it really is a joy to program in, tooling is excellent async programming in C# -just works- which isn't the case in Rust, Java (or Kotlin) or anything comparable.

So while I don't get to use it often I hold C# in high regard.

Re:Rob Pike interview by hashamali on Thursday April 30, 2020 @01:42PM (#23033652)
Hm, not sure I agree with some of those criticisms:

1) I don't think Go is in the Java (pre 8) realm of verbosity, but I concede it's not as compact as say Python. 2) Technically you can write single return Go but idiomatic Go leans towards immutability so it's not recommended. 3) I've run into the lack of generics a few times, but personally haven't been too hampered by it. This is an entirely valid complaint, hopefully support will be added soon! 4) Some would argue this is a feature. ;) 5) This was more true a few years ago. Now with Go Modules for package management and VSCode + Go extension with full debugger freely available, tooling is much improved.

Re:Rob Pike interview by bfrog on Thursday April 30, 2020 @12:09PM (#23032441)
Liking Go has nothing to do with being a quality software engineer. Go itself is probably the least software engineering friendly language out there. The goal of a computer language is to express your thoughts and instructions into something a machine can understand. Full stop. Go is absolutely terrible at letting you the human express what you want the machine to do. It has compile time type checks, but then fails to provide the hatches needed to work with types sanely. It has the ability to call out to large bodies of C code, but not without significant costs. It compiles fast, which is good, because your going to write a lot more code to do the same things you'd do in other languages, even other compiled languages.
Re:Rob Pike interview by takeda on Thursday April 30, 2020 @12:28PM (#23032720)
Yeah the type system is absolutely horrid. Just try to use any other type size than int, int64, float64 then you will be in a lot of pain casting every time you use them.

It's so silly for example that math.Min/Max only works on float64, it won't work with float32 without casting, or integers (although for ints is highly discouraged, because casting to float could cause you to get a different number, it is encouraged to just do if statement yourself)

It is a horrible language, only popular because it came from Google. It's biggest benefit was that it supposed to be easy to pick up, but it also demonstrates that the simplicity doesn't help at all with a significant code base, you still have to spend the same amount of time to learn it as in any other language.

Re:Rob Pike interview by throwaway894345 on Thursday April 30, 2020 @01:17PM (#23033331)
> Go itself is probably the least software engineering friendly language out there

My experience with software engineering went from "the language (type system, grammar, syntax, etc) is super important!" to "the language is one of the least important considerations in choosing a language". The more important features are tooling and ecosystem.

I don't want to have to learn a new configuration language or imperative DSL just to add project dependencies or setup tests. I don't want to have to learn yet another documentation framework for generating documentation from code comments. I don't want to have to spend lots of time setting up CI/CD pipelines to build my source code and documentation packages and publish them to their respective repositories. I don't want to have to worry about whether my users or fellow developers have the right versions of dependencies or the runtime installed on their system. I don't want to have to make unmaintainable Dockerfiles because it's the only way to have performant builds in the happy path. I want to minimize time wasted during code review on comments about style or programming paradigms. Similarly I don't want to waste time waiting for code to compile.

If the language is type safe in 95% of cases, that's good enough--people still make lots of money writing lots of 100% untyped JS and Python and Clojure and so on--the extra 5% would be nice to have but I'm not going to trade tooling, ecosystem, and developer velocity for it.

Basically, as I become more experienced, I begin to understand the difference between programming and software engineering (my heart is in programming, but software engineering pays the bills). Go is a great language for software engineering, but most of its criticism seems to be directed at programming concerns.

Re:Rob Pike interview by dnautics on Thursday April 30, 2020 @01:44PM (#23033673)
> Go is a great language for software engineering

Is it though? While tests in go are not terrible, to be a truly effective software engineer (vs just a programmer or dev) you want a very good test and documentation story, and there are languages out there with far, far, better tests and documentation primitives than Go.

Re:Rob Pike interview by throwaway894345 on Thursday April 30, 2020 @01:55PM (#23033835)
I think the point is that Go gets like a 90% score in most categories. You can get languages that score 100% in performance or testing or documentation, but they tend to trade off 60+% in several other important categories.

Further, I contend that Go has excellent documentation primitives, notably that it doesn't have any sort of markup or documentation package management. I've never seen a better language in this regard.

Re:Rob Pike interview by sleepydog on Thursday April 30, 2020 @04:34PM (#23035766)
Can you name a few? Genuine question. I've only really written a lot of tests in Python and Go, and I really dislike the python tests I've had to write. I don't think it's so much the language itself, but that python is so flexible with the mocking you can do that it enables code that is really tedious to test. With Go you have much more limited ability to mock things, so there are added constraints for code to be testable.

Similarly, with documentation, I really like that the godoc toolchain has resisted all the markup and annotation syntaxes that you see in Java. And I like that Go's convention of using a public URL as the module import path helps enable sites like godoc.org.

I find the language itself slightly more than mediocre. But I really like the toolchain and the restraint of the maintainers.

Re:Rob Pike interview by dnautics on Thursday April 30, 2020 @08:09PM (#23037760)
Testing wise, elixir is fantastic. I have a relatively large codebase where I run what are effectively full on simulations of the system in sharded-by-test partitions of state to verify correctness and robustness of the code. There are about 60 of those that run concurrently with the unit tests and the whole thing closes in 10 seconds.

Docs for elixir are pretty, too: here's a library that I wrote. The doc system is extensible enough that I could patch in docstrings from another language and also hyperlink (the </> buttons link to github) the GitHub code across languages (the `zig structs` section in the sidebar is autogenerated by parsing zig code) https://hexdocs.pm/zigler/Zigler.html

My joke is that you want to write documentation that's pretty and html-responsive enough that you can read it on the can between coding sprints.

Re:Rob Pike interview by morelisp on Friday May 01, 2020 @03:10AM (#23039744)
> With Go you have much more limited ability to mock things, so there are added constraints for code to be testable.

I agree Go makes things more difficult to mock, but it's also the language I've used where it's easiest to avoid mocks and test the real thing. We have tests for REST and RPC services that... just make a service. There's relatively little boilerplate to make a gRPC or HTTP service with some basic expectations/fake data attached and just run your real client against that real fake server. ("Relatively" meaning, less than the equivalent mocks in Java, for a substantially more realistic test outcome.) And once you have this fake server, it's probably useful in multiple projects, while mock setup tends to be suite- or even case-specific.

Re:Rob Pike interview by wst_ on Thursday April 30, 2020 @05:42PM (#23036499)
Must be a matter of preference but this is exactly what I hate about godoc. I'd love to use markdown or any other structure, really. Just a wall of plain text is sometimes good, but most of the time bad idea for readability. And the idea of starting each godoc comment with function/variable name is terrible. YMMV.
Re:Rob Pike interview by christiansakai on Thursday April 30, 2020 @01:10PM (#23033251)
I do JS/TS profesionally, I play around with various languages on the side including Haskell/Rust.

The more I work in JS the more I realized that I'm dumb. I'm not worthy to hold the power that JS has, much more other more complicated languages.

I tried Go. I like it. It makes me feel safe and smart enough to write production grade app.

Small docs, small language, no need fancy IDE, just any regular text editor like Vim works. Easy to read, easy to reason about. Everything is easy.

Now I finally can focus on other non-programming passion instead of chasing endless language features in other programming languages.

I like Go. The language for mediocre SWE like me. I code, I go home, I enjoy life.

Re:Rob Pike interview by thefounder on Thursday April 30, 2020 @01:52PM (#23033776)
>> Now I finally can focus on other non-programming passion instead of chasing endless language features in other programming languages.

I think this is really the best feature of Go. It's a pragmatic language. The only complain I have is the incomplete/half backed reflect package.

Re:Rob Pike interview by christiansakai on Thursday April 30, 2020 @02:18PM (#23034160)
My only complaint is the use of capitalization as public private. Because I quickly run out of naming variables/instances/structs, and naming is hard!
Re:Rob Pike interview by eropple on Thursday April 30, 2020 @11:57AM (#23032267)
I would entreat you to not be afraid of Golang. To be frank its adoption speaks to a desire to make software that does not require (or, often, benefit from "staff SWE" skills). Treat it as what it is, a jumped-up, terser, and in some ways gutted Java, and give it another go. It is designed, to a fault--and this is a little pejorative, I absolutely do not enjoy writing Golang because of it--to be not that hard.
Re:Rob Pike interview by wutbrodo on Thursday April 30, 2020 @01:46PM (#23033688)
This is my impression too. I was at Google when Golang v1 was released, and my friends and I were hobbyist language geeks and decided to play around with it.

We were....not fans. We were already in the habit of writing extremely clean and healthy code[1], and having a language hand-holding and hectoring us into doing things in its narrow, specific way was just too much of a hit to productivity. Now that I work in a C++ codebase full of very smart domain experts but light on engineering expertise, I can appreciate Go's value in certain circumstances, but if you're lucky enough to work with a talented and experienced engineering team, Go is a pain in the ass for anything but beginners.

[1] A habit I'm paradoxically trying to unlearn a little at my newer company, due to being on a different point on the short-term velocity/long-term health spectrum

Re:Rob Pike interview by eropple on Thursday April 30, 2020 @03:23PM (#23034981)
This is largely where I'm at. I've never gotten paid to write C++, though I've written my share, and I went through Scala, Ruby, Kotlin, a little Elixir and a little Rust, and now almost exclusively TypeScript--and I just don't need what Golang wants to make me do to do a good job and to output high-quality code.
Re:Rob Pike interview by apta on Thursday April 30, 2020 @01:56PM (#23033841)
golang is not terser than Java for any non-trivial code bases, it's quite the opposite.
Re:Rob Pike interview by pjmlp on Thursday April 30, 2020 @04:56PM (#23036020)
Go is what Java 1.0 could have been, however we are already on Java 14.
Re:Rob Pike interview by eropple on Thursday April 30, 2020 @05:20PM (#23036279)
I usually note that it matches up pretty favorably with Java 1.4, and now there are some ten-percent jokes to be made...
Re:Rob Pike interview by pjmlp on Friday May 01, 2020 @02:38AM (#23039612)
I see what you did there. :)
Re:Rob Pike interview by eropple on Thursday April 30, 2020 @03:22PM (#23034972)
FWIW, I don't disagree. That is, however, the general impression. :)
Re:Rob Pike interview by nostrademons on Thursday April 30, 2020 @11:56AM (#23032255)
There's a software lifecycle. At the beginning of a software project, nobody knows anything about what to do, because (if the market niche isn't already filled) nobody has done it before. Python and Ruby are great for that. Then as the software grows up, the requirements become more well-known, and more people start using it, you need to transition to more maintainable code that runs more quickly. Go is ideal for companies in that growth stage - it runs fast, it's easy to communicate what the code does, it doesn't allow a lot of tricks that can trip up other developers, and it encourages relatively robust code. Once you get to the massive scale stage like Google you probably need to be in C++ anyway, but by definition growth companies are where a lot of the action is.
Re:Rob Pike interview by throwanem on Thursday April 30, 2020 @12:03PM (#23032367)
Speaking as a professional with 15 years of career in software engineering under his belt: don't be so hard on yourself.

I mean, I don't typically prototype or iterate on ideas in Typescript, either; I do that in Javascript, and reserve strong typing for when I know what I need to build, and it's just a matter of doing so in a way that's reliable, maintainable, and secure.

The point is that flexibility and strictness both have value, and it's more worth knowing which is more useful at a given point in a project's lifespan than trying to be dogmatic about one or the other.

Re:Rob Pike interview by slx26 on Thursday April 30, 2020 @02:22PM (#23034204)
Sorry, but I have to be honest: in my opinion most of the replies you got to this comment are extremely misleading.

As a user of Go and Ruby I can tell you that: Ruby is an awesome language, and there's nothing else that beats it at getting things done quickly and painlessly (unless you have a mathematical mindset, in which case nothing gets shorter and more elegant (at least the day you write it) than functional programming). It has many other defects, like safety in larger codebases, speed, some weird quirks, etc., but it's an awesome language, don't expect many other languages to be less painful than Ruby (on small programs at least).

Don't listen to those that say professional programmers won't use Go. The only reason a professional programmer will say hard no to Go is for extremely optimized or mission critical code that can't tolerate garbage collection (even though the GC in Go is very low latency) or need a more sophisticated type system, or numerical applications for which Go isn't really well suited.

If you compare Ruby and Python to Go, the transition might be hard if you haven't studied computer science formally. That said, it's a matter of making the switch, understanding that all those objects (boxes to put data in) that you had in Ruby, now are statically typed; this means that a box is of exactly one type and can't change midway (and even subtle changes need explicit casting/conversion). You also need to learn the difference between composition and inheritance, which might be tricky depending on how you learned to program... but beyond that, Go is a very small and easy-to-write-code-in language. You might like the syntax more or less, but it's easy to write good code in Go. It has many other gotchas and hoops you will need to jump through (var initialization, error handling, new vs make, weird append/len, learn to printf, learn pointers, etc), but it's a good step after Ruby / Python, if you need things bigger than what Ruby / Python allow you to comfortably manage.

A hello world might require defining a package, importing another package, and a more verbose print statement than python / ruby, but those are all great (and minimal) appliances when developing at a larger scale.

Re:Rob Pike interview by save_ferris on Thursday April 30, 2020 @11:57AM (#23032262)
I felt the same way the first time I used go, but I came to realize that languages like go really force developers to think about details that languages like ruby don’t care as much about, like handling nil.

Sure, you can’t move quite as fast in go as you can in ruby, but you also get the benefit of not having to deal with errors like “undefined method foo for nil:NilClass” in production, which is nice.

Re:Rob Pike interview by kovac on Thursday April 30, 2020 @10:01PM (#23038417)
Don't beat yourself up for that. I tried Go sometime back (year or so may be) and found it an awkward language. It probably has its own design philisophy may be that I missed.

Things like lack of generics and type system makes you repeat things quite a lot (e. g. It was pretty impossible to write a true ORM or a DI system in go). I found the interface system quite awkward in that types implicitly implement an interface if they have the same method signature was weird to me. I think method overloading wasn't supported either, if I remember correctly.

I think people who loved Go initially probably came from C. It feels a lot like C with better standard library, memory safety and fast compile times. I like Go for the same reasons actually. But until there's at least some way to write generic code, it's an awkward language to anyone coming from more expressive languages. I program in C# mostly which is an extremely expressive language with classes, interfaces, generics, expression trees, linq, delegates (akin to function pointers). Go is far behind other languages for application development, my two cents. But for systems programmers used to C which is a very small language, Go must be like a transition to paradise :)

Re:Rob Pike interview by zeroc8 on Friday May 01, 2020 @03:48AM (#23039959)
I came from C++, where accidentally changing the wrong header file resulted in a 2 hour long build cycle. No thanks. Modern C++ has its good parts, but Go has made me enjoy the profession again.
Re:Rob Pike interview by kovac on Friday May 01, 2020 @04:27AM (#23040144)
Interesting you said that. Recently, I started doing some work in C++ again to stay up to date with what's going on in the C++ world. Do you really feel it's not worth it? I'm thinking about something new to do, and C++ is what I picked. I started implementing a TUI email client.

The build time of C++ can be really long. I noticed it too.

Re:Rob Pike interview by zeroc8 on Friday May 01, 2020 @11:21AM (#23042882)
I don't know, I guess it depends, what kind of software you are planning to write. All I can say is that learning C++ properly is a huge effort with diminishing results.

I'd say, invest your time wisely. Things are changing rapidly and old languages are usually solving problems that are not quite as important anymore as they used to be.

Re:Rob Pike interview by kovac on Friday May 01, 2020 @07:37PM (#23047617)
Thanks for the advice and i actually wxperience that diminiahing return you mentioned. I initially learnt programming with c++, so mostly picked it up again purely for nostalgic reasons to see where the language is now. It's become unmanageably large now! Where i live there isnt much work in C++, so job prospects are low for C++.

Im thinking of may be Rust or Go right now for more pragmatic reasons. Thank you for sharing your opinion.

Re:Rob Pike interview by bluntfang on Thursday April 30, 2020 @11:56AM (#23032250)
this is a toxic mindset. just because the tooling is poor doesn't make you an amateur. if you're getting paid, you're doing great. keep it up and use the tools that work to get the job done.
Re:Rob Pike interview by cbhl on Thursday April 30, 2020 @11:59AM (#23032304)
"Guess and check" is a technique that I have also used in Go code, and it is fine.

A lot of the compiler errors really could be errors in pre-commit hooks (like, the one about unused variables), but the language designers made a trade-off to be Even More Opinionated (than, say, Rails) because they thought it was best from a pedagogical perspective.

Re:Rob Pike interview by potta_coffee on Thursday April 30, 2020 @12:42PM (#23032911)
I had an initial period where Go felt really difficult, coming from Python. Now I've adapted and I actually feel like refactoring things is easier than it was before coming to Go. Just the fact that arguments and their return values are more strictly defined helps a lot.
Re:Rob Pike interview by takeda on Thursday April 30, 2020 @03:27PM (#23035048)
This is not that obvious, since many people are resisting it, but if you ever tried to use type annotations in Python, it dramatically improves refactoring (from my experience PyCharm it actually is more reliable than GoLand), you get autocompletion and bug detection. Highly recommend this for large Python projects.
Re:Rob Pike interview by potta_coffee on Thursday April 30, 2020 @03:50PM (#23035295)
I didn't like type annotations in Python, but I didn't like Go's type system either when I started. I'd be willing to take a second look at types in Python now. But, my real reason for choosing Go was for performance, and it blows our previous solution out of the water. Go isn't perfect but I'm pretty happy with it for right now. I still use Python for a lot of other things though.
Re:Rob Pike interview by takeda on Thursday April 30, 2020 @04:12PM (#23035546)
Well, if performance is the objective, then I can't suggest Python, because that isn't the goal. You can still have a performant application implemented in Python, I for example had it encode video stream on the fly, but this of course is done through extensibility via C extensions and the core work wasn't really done in Python itself.

Sometimes with the right approach (mapping PostgreSQL calls 1:1) and right tooling (uvloop, Cython) you can write code in Python and still squeeze better performance than in Go[1], but you need to know what you're doing.

If you want to explore types, these resources[2][3] were useful for me.

[1] https://github.com/MagicStack/asyncpg

[2] https://mypy.readthedocs.io/en/stable/

[3] https://docs.python.org/3/library/typing.htm

Re:Rob Pike interview by potta_coffee on Friday May 01, 2020 @07:36PM (#23047610)
I realize that with a lot of effort, Python can be performant or can be scaled. It was a pretty low-effort move to rewrite my Python service (which was pretty small) in Go and go from really poor performance to acceptable performance right away, and it only took me a short time. Also, I'm pretty good at Python but I'm not very knowledgeable about optimizing it for performance. I'd like to learn those tricks though.
Re:Rob Pike interview by empath75 on Thursday April 30, 2020 @12:00PM (#23032321)
> I had to do a lot of work to get the code to compile again.

That's fine, in most cases, writing python code, you find out that you fucked up when you run the script. Compiler errors catch whole classes of errors that you ordinarily wouldn't find unless you ran the code.

Re:Rob Pike interview by gorgoiler on Thursday April 30, 2020 @12:18PM (#23032567)
My experience was that I would have an idea for a new model and change my code. Later on I would find that new model would be flawed, but only after fixing compiler type errors in many different places when all I really needed to find was that one error that showed my model was flawed.

I should add that it’s heartening Pike actually acknowledges this in the interview, regarding limited typing and how it helps playfulness in languages like Python and Ruby.

Re:Rob Pike interview by takeda on Thursday April 30, 2020 @12:35PM (#23032814)
I'm Python you can also define types in the annotations, and with IDE that understands them it will catch errors, have working autocomplete and make it very easy to refactor.
Re:Rob Pike interview by myvoiceismypass on Thursday April 30, 2020 @12:51PM (#23033023)
One of Go's downsides (imho) - immature tooling (lagging ide support especially compared to other languages), definitely makes your job harder as a software engineer. That is not a reflection on you or your quality. If it feels like it is getting in the way - it is okay to prefer other languages or platforms to express and codify your ideas. The languages don't define you :)
Re:Rob Pike interview by zozbot234 on Thursday April 30, 2020 @12:06PM (#23032410)
> When I tried this in Go, every time I wanted to change the shape of my code to try doing things slightly differently I had to do a lot of work to get the code to compile again.

Ha. Try Rust if you like a challenge: at least you will get outstanding compiler diagnostics while refactoring, and far better performance as an end result.

Re:Rob Pike interview by troutwine on Thursday April 30, 2020 @12:29PM (#23032739)
Having done a fair bit of work in both languages I find Rust's type system here is much more of a help. I've got a clear sense of where things have gone sideways in Rust, even if that clear sense can sometimes feel like a long hike to get through. Go leaves me constantly wondering if I remembered to implement all the right functions for this or that interface, among concerns put elsewhere in this thread by others.
Re:Rob Pike interview by seph-reed on Thursday April 30, 2020 @12:23PM (#23032636)
I love Rust like I love Dark Souls.

It's difficult, but fair. I can not praise enough the software developers that realize proper errors are vastly superior to extensive docs.

Re:Rob Pike interview by BookHeretykow on Wednesday May 06, 2020 @02:22PM (#23094521)
Fine taste in language and games
Re:Rob Pike interview by vpner on Thursday April 30, 2020 @04:25PM (#23035664)
Don't confuse the shortcomings of the tools you use with your intellectual limits. This is a very insidious philosophy and there is no good reason to internalize it. Always remember that tools must be subservient to user needs because they're tools.
Re:Rob Pike interview by monkey26 on Thursday April 30, 2020 @11:52PM (#23038953)
I consider myself able to write production quality code.

When I started with Go I thought it was awesome. As my projects grew I found them to become less maintainable than my previous Java projects, and still less maintainable than my newer Rust projects.

Re:Rob Pike interview by kerng on Thursday April 30, 2020 @11:56AM (#23032259)
Agreed, for creative coding endeavours other languages are better suited, especially when doing rapid prototyping and refacturing. Sometimes even simple bash scripting allows for quicker results.