News for hackers. Stuff that matters.

Ask HN: New OSS Projects: Go or Java?

I'm thinking of working on building something new and open sourcing it. I know java really well so my first choice is to build it in java (pure java - no J2EE or other bloat) but Go also looks like a great alternative. Plus I'll have an excuse to learn Go.

Since I'm hoping others in the community will want to contribute, I thought I'd ask here before making a decision.

What do folks think - should I build it in Java or Go? Would you prefer to contribute to a Java or a Go codebase?

( 28 comments | 19 points | on HN )
Re:Ask HN: New OSS Projects: Go or Java? by benologist on Monday September 19, 2016 @03:26PM (#12534002)
I think you should decide what your single most important goal is:

1) launch a project

2) learn a language

Learning a new language will derail your project completion and launch indefinitely, often permanently.

Re:Ask HN: New OSS Projects: Go or Java? by kt9 on Monday September 19, 2016 @03:39PM (#12534092)
This is actually a great point.
Re:Ask HN: New OSS Projects: Go or Java? by rplst8 on Monday September 19, 2016 @03:55PM (#12534198)
Totally. IMO it's equivalent to deciding whether to write a book in your native language or in another language you don't speak because they have more words in the domain of the book's topic.
Re:Ask HN: New OSS Projects: Go or Java? by lord_braleigh on Wednesday September 21, 2016 @12:05PM (#12549452)
You wrote this in English? What kind of comment-writer are you? English has so many spelling inconsistencies and homonyms it's a wonder that anyone can understand anyone else. Everyone knows that real authors write in Spanish. Neruda, Borges, Márquez. Spanish's clear pronunciation rules, elegant conjugations, and separation of mutable state (`estar`) from immutable state (`ser`) ensure you'll never run into any dangerous misunderstandings. Consider this sentence:

    "¡Hola, mundo!"
Note that the sentence is one character shorter than the corresponding phrase in english (`"Hello, world!"`) - this kind of efficiency is quite common when you write in Spanish. Also note that the extra space won by removing a character was then used to add a pre-exclamation flag (`¡`). This flag is a neat optimization to ensure that the interpreter knows to prepare for an exclamation ahead of time.

Better interpretation, pronunciation, efficiency. Why are you not writing Spanish today?

Re:Ask HN: New OSS Projects: Go or Java? by reitanqild on Monday September 19, 2016 @04:10PM (#12534297)
> What do folks think - should I build it in Java or Go?

There is an old quote that when people ask for advice you should carefully figure out what they want to hear and then tell them that.

In this case even more so: if you are starting an open source project I'd strongly recommend optimizing for long-term motivation. Whatever that means in this case I'm afraid I cannot tell.

> Would you prefer to contribute to a Java or a Go codebase?

I personally would have a way simpler time contributing to a Java project than a Golang project.

Re:Ask HN: New OSS Projects: Go or Java? by tylerpachal on Monday September 19, 2016 @08:29PM (#12535964)
I was wrestling with the same question a few months ago and ended up choosing Scala! I got to learn something new but could still fall back to things I liked about Java.
Re:Ask HN: New OSS Projects: Go or Java? by pbohun on Monday September 19, 2016 @03:27PM (#12534010)
The most important thing is to use the right tool for the right job. If the project has networking and doesn't involve building a GUI or graphics, then Go is a great choice. (Not that Go can't do GUIs or graphics, but there aren't very robust and mature libraries for those things yet).
Re:Ask HN: New OSS Projects: Go or Java? by raptaml on Monday September 19, 2016 @03:53PM (#12534184)
Java's networking capabilities are rock solid, battle-tested and have got very fast as it is used in many heavy duty back end systems all over the world
Re:Ask HN: New OSS Projects: Go or Java? by _RPM on Monday September 19, 2016 @03:41PM (#12534106)
With network applications, you're often trying to optimize performance. It seems to me that the Go GC would make it a non optimal choice for network applications. I think writing it in Go would be good for the prototype.
Re:Ask HN: New OSS Projects: Go or Java? by perfmode on Monday September 19, 2016 @03:42PM (#12534119)
Go is great for I/O bound applications.
Re:Ask HN: New OSS Projects: Go or Java? by AnimalMuppet on Monday September 19, 2016 @03:29PM (#12534023)
Does Go do networking better than Java?
Re:Ask HN: New OSS Projects: Go or Java? by perfmode on Monday September 19, 2016 @03:42PM (#12534116)
Go's standard library is pretty nice.
Re:Ask HN: New OSS Projects: Go or Java? by AnimalMuppet on Monday September 19, 2016 @03:53PM (#12534186)
I know that Java's standard library is very complete. I know very little about Go's, but I presume that it's not more complete than Java's. Is Go's library easier to use than Java's? Is it significantly easier?
Re:Ask HN: New OSS Projects: Go or Java? by Matthias247 on Monday September 19, 2016 @04:03PM (#12534252)
Go is through it's integrated support goroutines (green-threads) very efficient at IO, while still presenting it in a traditional fashion (like blocking IO).

Java can also be very efficient, but only provides the lower level NIO library out of the box. To use that you either have to build und understand a lot of components for yourself (e.g. an IO Reactor, timer handling, etc.) or include one of the bigger frameworks for this purpose (e.g. Netty).

Re:Ask HN: New OSS Projects: Go or Java? by kt9 on Monday September 19, 2016 @03:38PM (#12534090)
If I did any UI pieces it would probably be in React talking back to an API handled by the core server.
Re:Ask HN: New OSS Projects: Go or Java? by samblr on Monday September 19, 2016 @05:01PM (#12534670)
Get to read so much good about Go and I want to try. But then you see the syntax of Go - its plain-ugly - why ?
Re:Ask HN: New OSS Projects: Go or Java? by mrits on Monday September 19, 2016 @05:50PM (#12535074)
plain-ugly is a lot better than unclear-ugly
Re:Ask HN: New OSS Projects: Go or Java? by samblr on Monday September 19, 2016 @06:43PM (#12535380)
What qualifies as unclear-ugly ?
Re:Ask HN: New OSS Projects: Go or Java? by atmosx on Tuesday September 20, 2016 @03:58AM (#12537905)
This:

    $,="\t"; print readlines.map{|r| s=r.split; [s[0].to_i,r]}\
    .max{|a,b| a[0]<=>b[0]}
It's a ruby one-liner that prints the largest first field and the lines that contains that field.
Re:Ask HN: New OSS Projects: Go or Java? by sporkenfang on Monday September 19, 2016 @10:04PM (#12536467)
Being too clever for your own good and writing wonderfully elegant code that randomly breaks on some other engineer who doesn't know you long after you have left the company. Surprise tire fire!
Re:Ask HN: New OSS Projects: Go or Java? by cweagans on Monday September 19, 2016 @07:20PM (#12535591)
Java ;)
Re:Ask HN: New OSS Projects: Go or Java? by transfire on Monday September 19, 2016 @04:04PM (#12534258)
Between Java and Go, definitely Go. I think you'll find it surprisingly easy to learn, although a bit constraining compared to Java.

OTOH, if the project will require heavy loads you might want to consider Phoenix/Elixir. That's would be learning something truly different too.

Re:Ask HN: New OSS Projects: Go or Java? by gazarullz on Tuesday September 20, 2016 @09:07AM (#12539192)
Given the scope of the question, if you are thinking about creating something useful in the OSS space, then I would clearly recommend to start with Java since you would be laying the foundation of the project in a language you know.

Otherwise pick Go.

Re:Ask HN: New OSS Projects: Go or Java? by softinio on Monday September 19, 2016 @03:58PM (#12534216)
personally if I were you I would use this as an excuse to learn Scala especially as you have a Java background.
Re:Ask HN: New OSS Projects: Go or Java? by pesfandiar on Tuesday September 20, 2016 @12:27PM (#12540767)
What's the nature of your project? If you want people to use it and maybe create a community around it, the language might play a big role.

My impression is that Java is used by enterprise and more established sectors, whereas Go is popular with hobbyists and early adopters.

Re:Ask HN: New OSS Projects: Go or Java? by iurisilvio on Tuesday September 20, 2016 @09:50PM (#12544862)
I tried to start another project in Go instead of Python/Flask. I never really started.

If you want to learn, Go is a good choice. If you want to get things done, use what you already know.

Re:Ask HN: New OSS Projects: Go or Java? by _RPM on Monday September 19, 2016 @03:40PM (#12534100)
How about C?
Re:Ask HN: New OSS Projects: Go or Java? by tuananh on Tuesday September 20, 2016 @02:40AM (#12537599)
whether you want to ship or you want to learn more?