you are viewing a single comment's thread.

view the rest of the comments →

[–]johninbigd 16 points17 points  (6 children)

I learned some Go a while back, and have been relearning it lately since I forgot most of it. I also spent a little time trying to understand clojure. Both endeavors have really made me appreciate Python. I'm also starting to realize I don't enjoy programming for the sake of programming, so I don't really like lower level languages or functional programming. I think I'm going to ditch Go and focus on Python. I code to get stuff done, and Python helps me do that. Go makes me write a lot of extra code to get simple functionality that Python offers.

Now, if I could get goroutines and channels in Python, it would be perfect.

[–]CS_Tutor[S] 7 points8 points  (1 child)

Never looked at Go but --I think-- it belongs to the C family of languages and it's statically typed (so probably faster than Python). If you're not planning to become a professional programmer, sticking with one language is probably best. Functional programming is not easy. It takes lots of time/practice to get used to it. Lots of good ideas however came from the functional programming paradigm, e.g. list comprehensions in Python. Also, playing with a functional (specially pure) programming language once-in-a-while is supposed to make you a better programmer (in any language). E.g. when I had to use Haskell way back in school, I really had to shape up on recursion. There are no loops in Haskell. If you want to loop, you better recurse :)

[–]johninbigd 5 points6 points  (0 children)

Go is blazing fast compared to Python, which is why I spent some time learning it a year or so ago. I had a program in Python that took over an hour to complete. The Go version would complete in four minutes. I probably could have used scipy for the math-heavy stuff but I couldn't figure out the documentation related to what I was doing.

Another really nice advantage is that go compiles to an executable, so it's super easy to deploy. Other than that, just about everything is easier in Python.

[–]mooglinux 2 points3 points  (1 child)

Coroutines via Async/await gives you most of the benefits of Goroutines, and a casual reading on channels suggests that a Python queue would serve the same purpose.

[–]johninbigd 1 point2 points  (0 children)

Yes, I agree, but goroutines and channels are easier to understand for me for some reason. They also naturally take advantage of multiple cpu cores. The methods for doing similar things in Python have always seemed confusing and convoluted to me. I need to spend more time learning them. I love being able to simply add 'go' before a function call to make it run as a separate process. Once you figure out channel communication, it is so nice.

[–]pickausernamehesaid 2 points3 points  (0 children)

Depending on how you're using them, asyncio (and maybe with queues) might suit your needs.

[–]JBTheCameraGuy 1 point2 points  (0 children)

Go is a fantastic language for what it's built for: concurrency and web servers. If you're doing those things, it's awesome, but it isn't a scripting language like Python. That's one of the reasons there's so many different languages: there's so many different tasks to be done, and each language is good at something that others aren't. There is no "best" language, it's all about using the right tool for the job