File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Languages and the fly likes Why Go? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Other Languages
Bookmark "Why Go?" Watch "Why Go?" New topic
Author

Why Go?

Rogerio Kioshi
Ranch Hand

Joined: Apr 12, 2005
Posts: 689
Why should I use Go instead of any other language, like Java, Ruby, C#,... ?


SCEA 5 (part 1), SCBCD, SCWCD, SCJP, CLP, CLS
Mark Summerfield
author
Ranch Hand

Joined: Jun 20, 2012
Posts: 37

Hi Rogerio,

Another way of putting your question is "What is the best programming language?". And unfortunately there is no definitive right answer to that.

As for Go, you should use it if it is the language which best suits your needs. IMO Go's particular strengths are (in no particular order):

  • code scalability thanks to a very nice packaging paradigm---and with very fast compilation even for very large programs
  • code scalability because Go doesn't support inheritance---this makes it much easier to (in effect) extend types without needing massive recompiles or worrying about messing up an inheritance tree
  • high-level support for concurrency that makes it easier to write and reason about concurrent programs
  • goroutines that are so lightweight that it is reasonable to have 1000s of them if that best fits the algorithm at hand
  • a clean lightweight syntax that avoids repetition
  • excellent Unicode support (far better than C++11 IMO)
  • zero intialization of every value that isn't explicitly initialized: this avoids uninitialized values errors and doesn't require programmers to remember arcane rules for when initialization takes place (e.g., C++)
  • a language that is small enough for average programmers to master (C++11 is so big and complicated that mastery requires a lot of time and guru-level coding)
  • no annoying and in concurrent programs very complex bookkeeping thanks to Go having a decent garbage collector
  • the best successor to C I've yet encountered
  • the best alternative to C++98/03 I know of---C++11 is just too big and complicated


  • Mark Summerfield
    "Programming in Go" - http://www.qtrac.eu/gobook.html
    Palak Mathur
    Ranch Hand

    Joined: Jan 29, 2007
    Posts: 313

    As per the Go's official FAQs, the reason that led to the thought to create a new language are:-

  • Computers are enormously quicker but software development is not faster.
  • Dependency management is a big part of software development today but the “header files” of languages in the C tradition are antithetical to clean dependency analysis—and fast compilation.
  • There is a growing rebellion against cumbersome type systems like those of Java and C++, pushing people towards dynamically typed languages such as Python and JavaScript.
  • Some fundamental concepts such as garbage collection and parallel computation are not well supported by popular systems languages.
  • The emergence of multicore computers has generated worry and confusion.


  • The advantages of a Go, again as mentioned in the Go's official FAQs are:-

  • It is possible to compile a large Go program in a few seconds on a single computer.
  • Go provides a model for software construction that makes dependency analysis easy and avoids much of the overhead of C-style include files and libraries.
  • Go's type system has no hierarchy, so no time is spent defining the relationships between types. Also, although Go has static types the language attempts to make types feel lighter weight than in typical OO languages.
  • Go is fully garbage-collected and provides fundamental support for concurrent execution and communication.
  • By its design, Go proposes an approach for the construction of system software on multicore machines.


  • Palak Mathur | My Blog | TechJaunt | What is JavaRanch? | List of All FAQs
    Walter Ho
    Greenhorn

    Joined: Apr 09, 2008
    Posts: 22

    Mr. Summerfield, I have your "Programming in Python" book.
    Would you say that programming in Go is easier than Python?
    Which language would you prefer to program in?

    Mark Summerfield wrote:Hi Rogerio,

    Another way of putting your question is "What is the best programming language?". And unfortunately there is no definitive right answer to that.

    As for Go, you should use it if it is the language which best suits your needs. IMO Go's particular strengths are (in no particular order):

  • code scalability thanks to a very nice packaging paradigm---and with very fast compilation even for very large programs
  • code scalability because Go doesn't support inheritance---this makes it much easier to (in effect) extend types without needing massive recompiles or worrying about messing up an inheritance tree
  • high-level support for concurrency that makes it easier to write and reason about concurrent programs
  • goroutines that are so lightweight that it is reasonable to have 1000s of them if that best fits the algorithm at hand
  • a clean lightweight syntax that avoids repetition
  • excellent Unicode support (far better than C++11 IMO)
  • zero intialization of every value that isn't explicitly initialized: this avoids uninitialized values errors and doesn't require programmers to remember arcane rules for when initialization takes place (e.g., C++)
  • a language that is small enough for average programmers to master (C++11 is so big and complicated that mastery requires a lot of time and guru-level coding)
  • no annoying and in concurrent programs very complex bookkeeping thanks to Go having a decent garbage collector
  • the best successor to C I've yet encountered
  • the best alternative to C++98/03 I know of---C++11 is just too big and complicated
  • Mark Summerfield
    author
    Ranch Hand

    Joined: Jun 20, 2012
    Posts: 37

    Hi Walter,

    I think that Python is easier to learn from Go because Python completely insulates you from memory management. OTOH Go's low-level facilities such as pointers make it possible to create more memory efficient programs than Python. I think that Go is much easier to learn than C, C++, or Java because the Go language is much smaller and more consistent. (And despite Go being a small language it has a really good standard library with far more real-world packages, i.e., for cryptography, web data handling, etc., than C++ provides.)

    When starting a new project my default is to use Python 3. However, if speed, memory use, or concurrency are critical, Go is my choice.
    Walter Ho
    Greenhorn

    Joined: Apr 09, 2008
    Posts: 22

    Very cool. Thanks so much. Big fan!

    Mark Summerfield wrote:Hi Walter,

    I think that Python is easier to learn from Go because Python completely insulates you from memory management. OTOH Go's low-level facilities such as pointers make it possible to create more memory efficient programs than Python. I think that Go is much easier to learn than C, C++, or Java because the Go language is much smaller and more consistent. (And despite Go being a small language it has a really good standard library with far more real-world packages, i.e., for cryptography, web data handling, etc., than C++ provides.)

    When starting a new project my default is to use Python 3. However, if speed, memory use, or concurrency are critical, Go is my choice.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Why Go?