DEV Community

Cover image for Learning Go - Part 1: The Differences

Learning Go - Part 1: The Differences

Learning a new programming language is exciting — and intimidating. Where should I start? What do I need to know? Am I doing it right? How far can I take this? And so on...

I remember when I first started learning frontend development, It was a very different world — no AI, no polished video courses, no fancy bootcamps. Just curiosity, stubborn persistence, and a deep interest in building things. There weren’t many mentors, either. At least as easy as it is now. You had to figure things out mostly on your own.

But today? It’s a whole new game. If you know how to use what’s out there, you can move fast. Really fast. There are free tutorials on YouTube on almost everything, tools like AI to guide your path, and people to talk to on LinkedIn. Just build something. Anything. Doesn’t have to be impressive. Just working is enough.

That wasn’t exactly my experience though. I’ve been working in the industry for almost a decade. I’ve seen a lot, worked with a bunch of tools, and picked up a good understanding of software in general. So for me, the real question was: Where do I want to go next?

That’s when I decided to learn Go.

Learning Go

Getting Started: Go vs JavaScript

I already had a strong JavaScript background. I wouldn’t call myself a JS master (master as legends like Dan Abramov), but I can build serious applications and participated in lots of projects. At some point, frameworks and libraries stopped mattering so much to me — I believe once you understand the language well, everything else becomes “just tools”.

Still, I wasn’t planning to dive into Go blindly. I started simple. In my opinion, every programming language stands on three universal pillars:

  • Variables and types
  • Conditions and operators
  • Loops and iteration

These exist in every language. The syntax may vary, but the concepts are shared. Thanks to my JS experience, I approached Go by constantly asking:

“How would I do this in JavaScript? And what’s the Go way of doing it?”

With the help of ChatGPT and tools like the Go Tour, these comparisons made everything click faster. Honestly, within a few hours I understood most of Go’s syntax — even the parts that looked odd at first. Comparing made it digestible, even fun.

Some Differences That Stood Out

Let me give you an idea of what I mean.

  • In JavaScript, all numbers are just number. But in Go, numbers come in different flavors — int, int64, float32, etc (I know so many other types are different too, but numbers are just example).
  • Functions in JS return a single value. In Go? They can return multiple values. And that’s not just a party trick — it’s actually useful.
func multiReturn() (uint, error) {
  return 10, nil
}
  • Go’s type definitions reminded me of TypeScript, but cleaner. For example, you can write
func printNames(a, b, c string)

and it knows all three parameters are strings. No fuss.

  • The concept of scopes is very similar in both languages.

One major shift though is Go’s compile-time nature. JavaScript is interpreted, unless you’re using TypeScript — but even then, TS doesn’t hold a candle to Go’s compiler in terms of strictness and safety. I’ll be honest, after working with Go for a while, TypeScript started to feel... a little clunky. 😅

Building Silly Stuff (On Purpose)

After I got comfortable with syntax, I started building basic programs. You know, the classics:

  • A program that adds numbers
  • A program that guesses your age
  • Something that creates and edits a file via CLI

The goal wasn’t to build anything useful. It was just about writing code and get used to Go’s behavior and standard library. I didn’t care about performance, clean code, or even style. Just write → run → learn.

Then I started separating files — just like I would in a JS project. In JS, we export or import modules. In Go, it's done with packages. You don’t “export” functions the same way. Instead, capitalizing the first letter of a function name makes it public. Simple as that.

func Something() {} // exported
func something() {} // internal

Playing With Packages

Next, I tried installing a third-party package — I wanted to make a simple HTTP server with a ping/pong route.

Go has a built-in net/http package that works great, but I figured: “Let’s pretend Go doesn’t have it. How do I install something external?”

In JS, we use npm, yarn, pnpm, etc. We have package.json, package-lock.json, and the infamous node_modules.

In Go, the system is much simpler — and honestly, way more efficient. You don’t get a node_modules equivalent.

You get a go.mod file (like package.json) and a go.sum (like your lockfile).
When you import a package, you just use its real path — like:

import "github.com/gorilla/mux"

Imports use real URLs, It reminded me a lot of Deno (or maybe it’s Deno that copied Go — either way, I liked it).

What also stood out is how Go handles name conflicts. You can import the same package more than once under different aliases, which gives you flexibility without chaos. JS allows aliasing too, but it’s not as clean in practice. In my opinion at least.

What's next?

That’s where I started — comparing Go and JS, writing dumb little programs, and learning by doing.

As I progressed, I found myself working with slices and maps (Go’s equivalents to JS arrays and objects), saving data to memory and then to files, and eventually to a real database.

But I’ll save all of that for the next chapter.

Final Thoughts

Go has a reputation for being clean and strict — and it really is. But what surprised me most was how accessible it felt once I got past the initial friction. If you're coming from JavaScript, especially with TypeScript experience, the learning curve is a lot smoother than you'd think.

Whether you're a frontend dev curious about backend, or a junior backend dev looking for a modern language to grow into, I think Go deserves your attention.

Top comments (0)