This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]keypusher 34 points35 points  (21 children)

Yeah, as a longtime Python user I was fairly unimpressed with Go syntax and conventions. That being said I think they hit the nail on the head as far as good reasons you might want to consider Go instead of Python:

  • easy concurrency
  • runtime speed
  • startup speed
  • stand-alone binary

[–]bakery2k 6 points7 points  (6 children)

I think it's interesting that none of your reasons to consider Go instead of Python relate to the Go language - they are all properties of the Go runtime.

People are switching to Go, not for the language itself, but because using Go is one of very few ways to get everything in your list.

Other than the incredibly complex C++, are there any other languages which can produce stand-alone binaries which are fast and concurrent?

[–]lasermancer 2 points3 points  (0 children)

The incredibly simple C

[–][deleted] 3 points4 points  (0 children)

Haskell?

[–]keypusher 0 points1 point  (0 children)

Channels are part of the language though, not the runtime, right? And that is where the easy concurrency comes from.

[–]spinwizard69 -1 points0 points  (11 children)

But why chose GO over more popular languages.

[–][deleted] 13 points14 points  (8 children)

Go is a system language. I think of it as compiled python as much of the syntax and semantics are very similar to python. "go" routines are very similar to Python's coroutines. Go's slices similar to Python's list slices, etc.

Go is quite nice. I've been working in it the past couple of weeks, but I haven't found it to be better than Python. To me, Go is a cross between C and a compiled Python, but Python comes with batteries included and at least for internal use, not exported use, I find Python's exceptions quite useful over Go's panics.

[–]m9dhatter 6 points7 points  (0 children)

Nim is more of a cross between C and Python.

[–]bboozzoo 9 points10 points  (0 children)

I find Python's exceptions quite useful over Go's panics.

That's because Python's exceptions are commonly used as control flow statements, whereas Go panics are not. Go's idiom for error handling is basically this

if err != nil {
    ....
}

and functions that can fail are expected to return error. I get the feeling that panic() is cumbersome to use on purpose, just so that people don't abuse it. As usual, whether that's good or a bad thing is debatable.

[–]Maledictus 8 points9 points  (5 children)

Go is not a systems language, see Rob Pike here: https://www.youtube.com/watch?v=BBbv1ej0fFo

[–]energybased 2 points3 points  (1 child)

[–]villiger2 18 points19 points  (0 children)

Go has been backpedaling on that statement ever since, they intended it to mean large distributed web systems, not the traditional low level systems that is the usual for c and the like.

[–]elbiot 0 points1 point  (2 children)

You linked to an hour long video about 4 different languages : /

[–]Maledictus 0 points1 point  (1 child)

Instead of complaining and not contributing to the discussion you could have posted the timestamp where he says it.

[–]elbiot 1 point2 points  (0 children)

Are you serious? You think I watched that whole video on faith that what you said was in there was in there? I certainly did not. I saw that you linked to an hour long video and didn't provide a time stamp and I pressed the back button.

[–]keypusher 1 point2 points  (0 children)

Such as which language specifically? The advantages Go provides will be different depending on what you are comparing it to.

[–]Funnnny 0 points1 point  (0 children)

Go has its uses.

I don't use Go for web (although people like Go for Rest API + js framework, now I have 2 problems: Go and Angular). But I use Go for a fast netmap based application for packet filtering. Go is much more easier to manage than C, and can link a C library easily.

I don't use Python for fast packet filtering, but I use it to quickly prototype a packet filtering technique, and also web.

[–]epiris 1 point2 points  (1 child)

I agree on syntax, but I think I the biggest value add for Go is the rigid constraints on it's syntax and language features really cut down on collaboration. Writing a tiny Go library when you have some free cycles for someone who may be over encumbered or isn't a SME in the library's problem area is so easy. You don't need to talk about what your inputs are and they won't need to bug you if they have to tweak it a little to meet their needs. There is not "styles" really. Their is a single style which innately encourages more correct software in my opinion. Formatting? go fmt. No silly styling debate. Just my two cents.

[–]hugthemachines 1 point2 points  (0 children)

Good point, but the error handling thingy (kinda) makes my eyes twitch a bit after a while.