
Go Is the New Ruby - jedisct1
https://00f.net/2019/10/28/go-is-the-new-ruby/
======
mkr-hn
Go really is the easiest language I've used. It installs with no fuss. The
VSCode extension sets everything up and works perfectly. The library
documentation is so clear that it usually answers any question I have without
having to dig up blog posts and without dodging top search result Stack
Overflow pages closed without answering the question. The highly opinionated
nature means I can go into any Go code base and make sense of it quickly.

~~~
panpanna
Go is the new Java.

It runs everywhere, is easy to learn and use and people who don't get it hate
it with passion.

Anyway, comparing go documentation with rust docs, I'm surprised anyone can
get any work done with rust.

~~~
littlestymaar
> Anyway, comparing go documentation with rust docs, I'm surprised anyone can
> get any work done with rust.

That's an unexpected comment. Rust has among the best documentation I've seen,
and arguably the best ecosystem around documentation, which helps a lot and
encourage third party developers to write high quality doc. I understand when
people complain about the learning curve (like this article, because fighting
the borrowchecker is only a thing while learning) but docs, really?

~~~
mkr-hn
For comparison:

[https://doc.rust-lang.org/std/fmt/index.html](https://doc.rust-
lang.org/std/fmt/index.html)

[https://golang.org/pkg/fmt/](https://golang.org/pkg/fmt/)

I don't know why I find Go's version easier to follow, but I do.

~~~
steveklabnik
Context: I wrote most of the stdlib docs

the fmt docs are... not ideal. That said, there's a _lot_ there, and it's all
useful, but it's just tough. Frankly, I just punted on improving them, and
haven't taken the time to do so in the years since.

~~~
mkr-hn
It seems like enough people find their way around them. Refinement might make
them easier for people like me with less experience navigating language
documentation, but that might come at the expense of developing the language.
Priorities are important. Especially since Rust doesn't have Google's
resources.

------
karmakaze
I don't really get the affinity of Go and Ruby. The most similar thing I could
say about them both is that they're both not Java. This makes sense from a
hiring sense, either your hiring from the large Jvm/.Net pools or you're not.

I suppose both Ruby and Go have less steep learning curves compared to
Java/Kotlin/Scala.

I can't wait until Go v2 gets generics then I can use it like other
statically-typed compiled, gc'd languages. At the rate of Go language
development, Java might get coroutines and value-types before then.

I haven't used Rust but I read the "Rust where the compiler constantly shouts
“fuck you”" quote differently. I read it as, where the non-existent Ruby
compiler will shout “fuck you” in production.

~~~
tln
The affinity for the author is in the last line,

"Go has become the new Ruby. A language I use to get things done, and enjoy
programming again."

Good for him

------
Phillips126
I enjoy learning new languages. In my day job I spend most of my time writing
JS (ReactJS specifically) building dashboards and other internal business
tools. Sometimes I need to build API's or perform tasks that just cannot be
done in the browser and I take the opportunity to experiment with other
languages.

A few examples:

\- We purchased a cheap USB duplicator (10 slots) to copy the contents from a
master USB to the clones. It worked, but wasn't a great solution. It was slow,
error prone and when it failed you never really knew what USB was having the
issues (or what went wrong). Using a Golang backend and ReactJS frontend I
created an alternative which had a nice GUI showing what files were copying,
the percentages complete, error messages, etc. It was a far better solution
and using Goroutines it was fun. We ended up scaling the system to 100 USB's
at a time and that was fun to watch (lots of blinky lights :D). The solution
didn't take much time to write (Golang was quick to learn) and we finished the
duplication WAY sooner than the due date.

\- We needed to automate a bunch of DNS stuff with CloudFlare. I ended up
creating a parser for a custom config we wrote, hooked it up to CF's API and
we ran it as a service. The language I used for this project was Nim[0]. I
liked the syntax and the final binaries were TINY and FAST.

\- More recently I was approached by an IT guy at the company that manages all
of our software licenses. He showed me this command line tool he uses to query
all licenses and goes through the cryptic output trying to figure out what
licenses were being used, by whom, etc. I ended up using Go to parse the
command and serve a ReactJS application with all sorts of bells and whistles
(reports, history, alerts, etc). Since the application is browser-based he can
even use it mobile which he loves.

\- I've been working on some prototype BLE Mesh stuff in C, but that is a ways
out and not yet worth mentioning much more.

Rust has held my interest for a while as well, just waiting for the right
project to come along.

[0][https://nim-lang.org/](https://nim-lang.org/)

~~~
iam_takada
On top of ReactJS, what else do you use to build dashboards and internal
business tools?

~~~
Phillips126
I typically do everything custom these days. In the past I would use
Bootstrap, Semantic or one of the many other CSS frameworks but I found that I
add a lot of size to my applications when I only used a few things from it.
Most features (sidebars, grids, menus...) are simple enough to just implement
on your own. I was a graphic designer that moved into development so I feel I
have a pretty good sense of design and UX.

I do however use various charting libraries out there for ReactJS as they are
typically quite well done and small in size. If I need something a little more
custom I'll install D3 and build it out.

For backend I have used Node/Express quite a bit to serve API's and such. But
as mentioned in my previous post lately I've been using system programming
languages a lot more for building backend things mostly as a learning exercise
and because I have the freedom to do that in my job.

Building out these tools and seeing them being used daily from nearly all
employees in a ~400 person company is really rewarding. It really gives me a
sense of appreciation for the work I do and I get a lot of good suggestions on
how to improve the applications that in turn improve the work these employees
do.

Other things I've used in the past for various projects include Ionic
Framework & PhoneGap (mobile app), Zephyr RTOS (BLE Mesh Programming), React
Native, Angular, Electron (Visitor Check In/Out Kiosks), and lots of CSS
frameworks (too many to name).

------
mikece
“All languages suck, but they all bring interesting concepts as well, that can
overall make you a better programmer.”

True on so many levels. Learning other languages means learning a new way of
thinking due to the reasons those languages were created in the first place.
Even if you never change the language you use daily, learning other languages
and doing small projects in them will make you better in your “home” language.

~~~
segmondy
Not true, There are lots of languages that bring absolutely nothing to the
table in terms of making you a better programmer. Take something like Elm, it
doesn't make you a "better programmer". It does make your program better by
being statically typed. Kinda like typescript doesn't make you a better
programmer than if you use javascript, but it makes your program better. You
can say this for a lot of languages.

~~~
save_ferris
I don’t agree with this. Using typescript really helped me understand the
value of types, which wound up radically changing the way I read and write
vanilla JS. I’m much better at recognizing and preventing bugs in vanilla JS
because typescript has changed the way I think about JS.

------
SPBS
The key point of the article is that Ruby and Go are similar for being very
developer friendly and productive languages. It is not about keyword arguments
or the expressive power of the language or something similar. Although it's
not explicitly mentioned why Go is the new Ruby, given that both are equally
productive, I would assume that it's because Go is much faster where it
counts.

------
jamil7
I kinda throught Elixir / Phoenix was the new Ruby / Rails. Nice read none the
less.

~~~
Vesuvium
Indeed. For scripting languages, it's usually Python people moving to go and
Ruby people adopting Elixir.

------
throw_m239339
More like Javascript is the new Ruby and Go is the new Java.

------
selfipaprazzi
Moving to a new job with Perl and Go. I know neither of them. This article has
me excited!

------
pcwalton
> But, just like in Java, if I need speed, I can preallocate and reuse memory
> to avoid hitting the GC.

No, you can't. Language constructs in Go allocate in ways that are not
immediately obvious. When the GC runs, it still has to scan all of that
memory, regardless of whether you preallocated it or not, which is especially
unfortunate with a non-generational garbage collector like that of Go.

Also, I have to say that I really don't get it when people say that they have
to think about the borrow checker for a long time before writing a program in
Rust. That's not the case for me or anyone else I know.

~~~
skybrian
One possibly useful thing to know is that the Go GC doesn't scan non-pointer
memory, so if you have big strings, byte arrays, or structs that don't contain
pointers, they don't need to be scanned.

Also, while the garbage collector may not be generational, it's mostly
concurrent. Looks like GC pauses are below 1ms now?

------
WinonaRyder
> For me, Go has become the new Ruby. A language I use to get things done, and
> enjoy programming again.

Despite my annoyance with the direction that Go's taken since 1.10, this line
really resonates with me.

TL;DR

Windows + PHP + slow laptop drove me to put away my childish anti-Google fears
for a weekend and try Go, and for the first time since I started coding (with
Pascal) I enjoyed programming.

Cool story:

Around late 2010, after a few years of using (btw, Arch) Linux exclusively, I
was given a slow Windows laptop for work. The laptop came with Windows Vista
IIRC and the whole experience of writing PHP code on an unfamiliar OS combined
with a slow laptop was just misery - it was even worse than my memories of
Windows ME/XP.

I tried everything to get a familiar Linux env going: Cygwin, msys, KDE... and
it just added insult to injury.

Anyway, soon after, it was Go's birthday so it was in the news again and one
weekend I decided to put away my childish anti-Google fears and try it and I
never looked back.

Something about the simplicity, its lack of CMake, Makefiles, latest build-
system-of-the-week, dynamic linking hell, C++ complexity, D and its 2 std
libs, etc. was a breath of fresh air.

Before even falling in love the the concurrency primitives, I started writing
"bash scripts" in Go - something I do to this day. I even started writing
prototypes in Go to then port them to PHP and Python because I could write the
inefficient, naive, brute-force code to validate an idea... and it'd still end
up being faster and use less memory than the code the was deployed to
production.

I later also discovered that my shitty naive linters written in Go that parsed
and checked whole PHP packages every time I saved a file ran near instantly
compared to the heavy disk-destroying IDE indexing - it was crazy.

------
hootbootscoot
I thought Crystal was...

[https://crystal-lang.org/](https://crystal-lang.org/)

~~~
hootbootscoot
as for rails, pick your poison

[https://luckyframework.org/](https://luckyframework.org/)
[https://amberframework.org/](https://amberframework.org/) [https://spider-
gazelle.net/](https://spider-gazelle.net/)

~~~
karmakaze
I tried Lucky, Amber, then finally Kemal which is more of a Sinatra. It was
the only thing that compiled fast enough to feel productive.

------
tboyd47
Then what is the new Rails?

~~~
throw_m239339
You can't have Rails in Go.

I mean you can, but "go advocates", would crap on your work with an endless
litany of articles about why whatever you wrote shouldn't be used because it's
not the "go way". Remember Martini? That's right you don't.

Fortunately for Go, the biggest pain in the ass when it comes to web
development is kind of a solved problem with the use of JSON support in SQL
Dbs. All you have to do then is un-serialize directly from the DB, which helps
getting rid of ORM when building object graphs.

~~~
badrequest
I have no idea where all this salt comes from about go advocates, but there
are plenty of Rails-likes in Go that are accepted and used by the community.
Buffalo is probably the most Rails-ish (from a glance, I've not use Rails
extensively), and it's maintained/advocated for by folks who have long been
pillars of the community. Martini was effectively replaced by Gin
([https://github.com/gin-gonic/gin](https://github.com/gin-gonic/gin)), which
is still heavily used.

~~~
throw_m239339
Martini wasn't replaced by Gin, 2 different developers.

Buffalo uses code generation sure, but it doesn't make an extensive use of
interface {} like Martini did, thus can't really be compared to Rails in terms
of polymorphism.

------
kyledrake
A statically typed compiled systems language with anachronistic C semantics
and a regressive package dependencies system is never going to be a new high
level DSL oriented scripting language. A far better take is that Crystal is
the new Go, because it mixes the benefits of a high level language with the
benefits of a lower level language, and learned a lot more of the lessons from
the ruby and node ecosystems about how to manage code dependencies.

~~~
melq
I mean this to come of in a non antagonistic way, but did you read the
article? You seem to be refuting the title of the article without addressing
any of the points made within it.

------
commandersaki
I wonder what the authors thoughts is about not having a secret annotation for
wiping secrets.

------
tcyrus
Why would you say something so controversial yet so brave?

------
fleur-de-lotus
I don't understand the comparison with Ruby. Go, as a language, is
underpowered by design. Ruby is "overpowered". Ruby should better be compared
with Kotlin and Swift.

------
solidsnack9000
In more ways than one.

------
musicale
Go is not the new Ruby.

Ruby has keyword arguments and optional arguments with defaults.

Among [many] other things.

