Win a copy of Serverless Applications with Node.js this week in the NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

Head First Go: Go Lang vs Others  RSS feed

 
Greenhorn
Posts: 11
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jay McGavren! Congrats on your book!

I'd like to know what the main advantages Go has in relation to other languages.

Thanks & Regards,
 
Ranch Hand
Posts: 2097
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Cleo Junior wrote:Hi Jay McGavren! Congrats on your book!

I'd like to know what the main advantages Go has in relation to other languages.

Thanks & Regards,



In addition to what Cleo asked, what are the limitations of what Go can do, if any? (e.g. java can do only what the jvm exposes)
 
Author
Posts: 22
5
Chrome Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Start by looking at my answer in this thread; I'll build on that here.

Go is designed for simplicity. Part of that means making Go code easier to write with things like short variable declarations, automatic memory management (garbage collection), interfaces that can be defined without modifying any types, etc.

But another very big reason the Go creators aimed for simplicity is that it makes Go code very fast to compile and run. Even large projects can compile in seconds. And the resulting programs are really fast. Talking in very general terms, Go programs are about as fast as C or C++ programs, faster to start up than Java or .NET programs, and much, much faster overall than Ruby or Python programs.

Regarding limitations of Go, again refer to this thread. There's basically nothing Go can't do. Even there's no native Go library for a task, Go can bind to C/C++ libraries to do what you need. One example might be the go-sdl2 library for game development.
 
Sheriff
Posts: 21692
101
Chrome Eclipse IDE Java Spring Ubuntu VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Jay McGavren wrote:There's basically nothing Go can't do.


Except make error handling easy

I've worked a bit with Go, and I don't dislike it, except for one aspect - error handling. As a Java developer, I feel like almost every call is the equivalent of "try { call } catch (exception) { throw exception }". That can get quite tedious after a while. Fortunately, that's one of the things that Go 2.0 should fix. See also https://go.googlesource.com/proposal/+/master/design/go2draft-error-handling-overview.md.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does Go have its own version of proposed features that way Python has PEP and Java has JCP?
 
Jay McGavren
Author
Posts: 22
5
Chrome Mac Ruby
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Karanveer Plaha wrote:Does Go have its own version of proposed features that way Python has PEP and Java has JCP?



The Go process is somewhat less formal. You can read about it in this official blog post.
 
Rob Spoor
Sheriff
Posts: 21692
101
Chrome Eclipse IDE Java Spring Ubuntu VI Editor Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since Go is hosted on GitHub, it's actually quite easy to fork it, add some code, and create a pull request. You have to sell your soul sign the Contributor License Agreement (CLA) for the pull request to even be considered, but that's normal for such projects. I also sold my soul to Oracle signed the Oracle Contributor Agreement (OCA), and this one was easier (no paper form that needed to be scanned).

Creating a pull request doesn't mean the code gets accepted, but that's quite normal for such a large project. I found the response to my pull request a lot friendlier than my first patch submitted to OpenJDK (which got shot down because apparently OptionalInt is already abandoned as far as Oracle is concerned - Optional<int> is the future).
 
Let me tell you a story about a man named Jed. He made this tiny ad:
global solutions you can do at home or in your backyard
https://www.kickstarter.com/projects/paulwheaton/better-world-boo
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!