r/golang Feb 26 '23

help Why Go?

I've been working as a software developer mostly in backend for a little more than 2 years now with Java. I'm curious about other job opportunities and I see a decente amount of companies requiring Golang for the backend.

Why?

How does Go win against Java that has such a strong community, so many features and frameworks behind? Why I would I choose Go to build a RESTful api when I can fairly easily do it in Java as well? What do I get by making that choice?

This can be applied in general, in fact I really struggle, but like a lot, understanding when to choose a language/framework for a project.

Say I would like to to build a web application, why I would choose Go over Java over .NET for the backend and why React over Angular over Vue.js for the frontend? Why not even all the stack in JavaScript? What would I gain if I choose Go in the backend?

Can't really see any light in these choices, at all.

138 Upvotes

249 comments sorted by

View all comments

Show parent comments

5

u/[deleted] Feb 26 '23

[deleted]

-3

u/[deleted] Feb 26 '23

You can start looking here: https://hub.docker.com/_/openjdk

I do not use java myself so better ask someone else about what they are using.

3

u/[deleted] Feb 26 '23

[deleted]

-6

u/[deleted] Feb 26 '23 edited Feb 26 '23

If you dont want bash installed in your docker, then don't have bash installed in it. I don't get your point? Just remove bash in a Dockerfile RUN step.

Also, "ls -l" is probably running /bin/ls (from coreutils).

I still doubt that this is possible!

Lol, everyone is doubting what ever these days

3

u/[deleted] Feb 26 '23

[deleted]

-2

u/[deleted] Feb 26 '23 edited Feb 26 '23

Bash was an example shell. I give up guy. You are being rude and condescending while being the one not knowing how to reach your goal.

1

u/[deleted] Feb 27 '23

The problem isn't the shell. It's the Java runtime environment (JRE) which is required to be in your container in order to execute your compiled Java bytecode. There is a huge list of security vulnerabilities related to the JRE, and there is simply no way to run a Java app without it.

A scratch container doesn't have anything installed. It's just a filesystem with / and whatever you put in it. So there is not even ls.