• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Head First Go: Go Lang vs Others

 
Greenhorn
Posts: 16
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 2108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Mac Ruby Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 22862
132
Eclipse IDE Spring TypeScript Quarkus Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Mac Ruby Chrome
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 22862
132
Eclipse IDE Spring TypeScript Quarkus Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
reply
    Bookmark Topic Watch Topic
  • New Topic