Live data from Hacker News

Why I went from Python to Go (and not node.js)

orel.li

121–130 of 202 posts

Re: Why I went from Python to Go (and not node.js)

#121
post #107

Earlier quoted context omitted.

since Python is a thoroughly mediocre language. Care to elaborate?

Is there anything to add? It's not very fast. It does not have any interesting abstraction. It doesn't push the envelope further. It doesn't allow any clever optimizations. It has a bunch of horrible gotchas (scoping, mutable default arguments, tuples of one element...). It isn't elegant--the grammar alone takes pages and it's just a loose collection of mostly orthogonal features with largely arbitrary (but, admitted…

There is no 'horrible gotcha' with tuples of one element. Have you even tried generator expressions? Do you have any specific performance problem, or do you just suppose that you couldn't write sufficiently performant code in Python?

Overall, from your post, I don't believe you have used Python seriously.

I don't care what color Python would be, nor would I care what ice cream flavor it would be. Nor do I care whether it is cool on Lambda the Ultimate. Is this grade school?

If you are looking for a lowest common denominator, I think the language best fitting that description is C. I do not say this to damn C, which I rather like in its way. The core language is relatively simple and portable and is the closest thing that practical programming has to a lingua franca (not talking about academic stuff like ML).

If you can't understand why anyone would like C then it isn't at all surprising that you wouldn't understand why someone would like Python.

Use whatever you want for yourself, but let's be clear that this is a matter of you being too cool for Python, not of you having any real reason why it is a bad tool.

Re: Why I went from Python to Go (and not node.js)

#122

I keep hearing about go. I am new-ish to programming. Only really getting started on my first project, which depends on pyparsing, which depends on other things. Is go something a novice should be attacking real-world problems with?

if you're programming for the web, give it a Go.

If you want to get ordinary web jobs it would pay off better to pick up Javascript and Rails or Django.

Re: Why I went from Python to Go (and not node.js)

#123

Earlier quoted context omitted.

You don't need macros to solve this problem. You can use unique types, STM, etc. to forbid the data sharing at the type level and ensure a coherent memory model.

The paper's position is that you can't implement threads, safely, as a library because the compiler is not aware of the concurrency. My point was that this reasoning may not hold if your language has full macros. Your suggestions will work great, but those are in the compiler, not as a library.

Well, the point is that concurrency primitives don't have to be built into the language to enable libraries to write safe concurrent abstractions. Rather, the type system features that enable it can exist in the compiler as general type system features unrelated to concurrency that just so happen to be able to ensure the safety of concurrent code if used properly.

Re: Why I went from Python to Go (and not node.js)

#124
post #90

"... as a Python programmer, I was the member of an elite cabal of superhuman ultranerds, smarter than those childish Rails/JavaScript/PHP/whatever developers that couldn’t write a bubble sort or comprehend even basic algorithmic complexity, but more in touch with reality than the grey-bearded wizards of Lisp/Haskell/whatever that sat in their caves/towers/whatever solving contrived, nonexistent problems for people t…

"Everyone less nerdy than me is stupid and everyone more nerdy than my is a no-life". I think it's pathetic, not funny.

Sounds like a variation on George Carlin's line that everyone who drives slower than me is stupid and everyone who drives faster is crazy.

Re: Why I went from Python to Go (and not node.js)

#125

"... as a Python programmer, I was the member of an elite cabal of superhuman ultranerds, smarter than those childish Rails/JavaScript/PHP/whatever developers that couldn’t write a bubble sort or comprehend even basic algorithmic complexity, but more in touch with reality than the grey-bearded wizards of Lisp/Haskell/whatever that sat in their caves/towers/whatever solving contrived, nonexistent problems for people t…

I go to Python conferences and meetups regularly and I cannot say that I have ever run into this attitude, let alone the specific combination.

I do run into a lot of egos but these don't seem much different from the types I see posting comments like this on Hacker News. And a lot of Python people have picked up Node or Go these days, so I wouldn't be too sure that you weren't damning a significant part of your own favorite community here.

Re: Why I went from Python to Go (and not node.js)

#126
post #90

Earlier quoted context omitted.

"Everyone less nerdy than me is stupid and everyone more nerdy than my is a no-life". I think it's pathetic, not funny.

It's actually kind of bizarre that so many Pythonistas actually have the kind of attitude that the article mocks, since Python is a thoroughly mediocre language. I can only attribute their patronizing disposition to a lack of genuine awareness of the broader programming world.

How many Pythonistas? I would like you to substantiate this claim. I would assume that you actually don't have that much contact with the Python community because otherwise it is pretty unaccountable how I have never encountered that attitude all these years. and I am a grumpy person, and not without my own axes to grind about the Python community.

Re: Why I went from Python to Go (and not node.js)

#127

Earlier quoted context omitted.

Agreed. I think we, as a profession, have a tendency to focus on what's "easy" (syntax and constructs we're already familiar with) to the exclusion of other, potentially more important factors. I am and have been guilty of this myself, so I'm not claiming any sort of sainthood, just making an observation. Often people pick on the use of single-letter variable names as "unreadable." This is mostly a matter of keeping…

I think the issue with single-letter variables goes deeper than it just being unreadable (although its that too for someone that isn't "used to it"). For example there are issues with scope (what happens when I need a second or third "f" variable" and maintainability too (6 months from now I have to remember if "f" stands for "foo" or "file").

Speaking of scope issues, you're missing a paren.

Re: Why I went from Python to Go (and not node.js)

#128
post #94
post #56

Earlier quoted context omitted.

Exactly what I thought - "what about multiprocessing?" Doesn't that count as language-level concurrency support? You can fire off a background job to send email or whatever just as easily as in the Go example.

This confused me as well, it felt like the author was thinking about the problem space all wrong. As soon as I read "As a Django developer, there wasn’t a straightforward and obvious way to just do things in the background on a page request" I started thinking, "um, django produces http responses, you can only respond once...". Clearly, from his gevents example, he's looking to do things that take time, and wants to…

If for whatever reason you don't want to build everything into the front end Javascript, it is very common to throw jobs onto a task queue to be done outside of the HTTP flow, so they do not block the response.

This could be a lot more accessible to beginners, however, because there are moving pieces like a message queue that have to be set up and blah blah.

Re: Why I went from Python to Go (and not node.js)

#129
post #117

Earlier quoted context omitted.

Probably not if that's what you start with. Carnegie Mellon now starts all CS students with ML, I believe. For those of us who learned to program in an imperative language first, the difficulty with learning functional programming is unlearning all of our bad habits.

"Functional programming" is 10% of what makes Haskell difficult. The intricacies of laziness and existential types and opimizing higher order functions are more the problem.

[deleted]

Re: Why I went from Python to Go (and not node.js)

#130

Earlier quoted context omitted.

Agreed. I think we, as a profession, have a tendency to focus on what's "easy" (syntax and constructs we're already familiar with) to the exclusion of other, potentially more important factors. I am and have been guilty of this myself, so I'm not claiming any sort of sainthood, just making an observation. Often people pick on the use of single-letter variable names as "unreadable." This is mostly a matter of keeping…

I think the issue with single-letter variables goes deeper than it just being unreadable (although its that too for someone that isn't "used to it"). For example there are issues with scope (what happens when I need a second or third "f" variable" and maintainability too (6 months from now I have to remember if "f" stands for "foo" or "file").

Generally, I try not to use single letter variable names in any scope that doesn't fit into a single screen in my editor. That way, I don't need to remember what "f" means, it's right there in front of me. And I shouldn't have too many variables in that scope, so conflicts aren't all that important; if I really do, I just start using multi-letter names again.
Post reply on HN