News for hackers. Stuff that matters.
Re:Why I went from Python to Go (and not node.js) by juddlyon on Friday September 14, 2012 @05:10PM (#4523979)
"... 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 that don’t exist, or those insane Erlang programmers who are content writing sumerian cuneiform all day long."

This made me laugh, thank you.

Re:Why I went from Python to Go (and not node.js) by IsTom on Friday September 14, 2012 @07:15PM (#4524454)
"Everyone less nerdy than me is stupid and everyone more nerdy than my is a no-life". I think it's pathetic, not funny.
Re:Why I went from Python to Go (and not node.js) by tikhonj on Friday September 14, 2012 @10:16PM (#4524991)
I read that quote from the article as essentially self-pardoying. The author is essentially making fun of himself and the general attitude he--and other Pythonistas, I imagine--held.

Then again, maybe I'm reading too much into it. For the record, I think Haskell is a strictly superior choice to Go, so I'm what he would probably call "gray-bearded" :P. (And I'm certainly working on a beard, even if it shouldn't be gray any time soon.)

Re:Why I went from Python to Go (and not node.js) by zemo on Saturday September 15, 2012 @02:47PM (#4526921)
>maybe I'm reading too much into it.

no, you got it. It's not really meant to be a criticism of Python itself, it's just behavior that is common among 20-something web developers, which is representative of some areas of the industry, and is specifically the target audience for the post. You know, the kind of developer that is advanced enough that they can build non-trivial projects, but not experienced enough to have wisdom forged in the furnaces of years of industry experience (that's ... me and a lot of other HN users). The same type of attitude can be found in all languages and isn't specific to the Python community; the specific swipes at other languages are just what you get if you apply that attitude to Python. Judging people by the tools they use is a pretty useless metric.

>For the record, I think Haskell is a strictly superior choice to Go

I'm pretty sure it's the best programming language, that's why I put them in the gray-beard category. Or maybe it's OCaml or some Lisp dialect; it doesn't really matter. It's even why I further apologized to Dons and acknowledged that Haskell programmers tend to be able to solve harder problems than other programmers I know, but even after I twice acknowledged the superiority of Haskell, he basically just looked at me and said "you're a stupid idiot, and by the way, look at how many numbers I can compute with my superior Haskell program that runs on a lot of machines". Uh, ok, that's cool... I guess.

But every time I sit down with Haskell programmers and they explain to me how elegant their code is, I just don't really care. It's not what makes me interested in computer programming. I don't really care to use the best programming language; I really only care to make the best programs. PHP (and other shit technologies) have shown us that you don't need to understand monads to make people happy.

A friend of mine, who is a very strong programmer that I have a tremendous amount of respect for professionally, once showed me how to use Coq to prove that multiplication is commutative. I found that very boring, and it didn't make me want to learn Coq. Mind you, I spend between 40 and 60 hours a week working with software. I'm in it because I like to build things that are useful to people, and I think software is a great creative medium. I think that's a fairly common attitude.

Every time I say the name Haskell I am sorry for it, because every time I say the name Haskell I am met with bitter condescension. It makes me sad that despite talking about having experience with seven programming languages in my post, or mentioning having built a variety of things that are very different, Haskell programmers consistently treat me like I am a stupid person. So I'm glad you're not like that, and I'm glad that you understood I didn't mean to dismiss Haskell on technical grounds. Thank you for your comment.

Re:Why I went from Python to Go (and not node.js) by tikhonj on Saturday September 15, 2012 @05:26PM (#4527367)
For what it's worth, the reason I prefer Haskell is exactly what you're interested in--I want to make the "best" programs. The elegance of the language is just a proxy for this.

Out of all the languages I've tried--and I've tried a decent amount--Haskell is by far the most productive. I can write my programs faster and they come out shorter, more readable, more maintainable and easier to test. I've found it far easier to go back to old Haskell code I've written than old Java or JavaScript or Perl or even Python code. All this without significantly sacrificing performance.

I've also found Haskell far easier to refactor. In most languages, my projects' code size goes up monotonically; in Haskell, it isn't rare for me to both add a feature and make the code shorter! This was a surprise the first couple of times, but now I almost expect it.

Also, critically, I've found Haskell's advantages scale superlinearly with the complexity of the problem. That is, the harder a problem is conceptually, the bigger the advantage of using Haskell over another language. Haskell actually helps me think about the problem, even if I don't want to write a program for it. I've certainly found certain tasks far easier even in other languages by thinking in Haskell terms about things like nondeterminism.

This may seem counter-intuitive, but I've even found Haskell to be very good for prototyping. Once you get used to the slightly different style of thinking it requires, the type system actually starts helping you develop solutions quickly. I'm sure other languages may be better at this than Haskell, but Haskell really shines when it's time to take your prototype and transition to a solid piece of software--it makes the refactoring much easier and makes even significant architectural changes more approachable.

The real problem is that Haskell, for whatever reason, has the rather unfair reputation of being impractical. Really nothing could be further from the truth--yes, there is plenty of theory and research in the language, but this is not there just for fun: it actually makes the language better to use, even for more mundane tasks!

You definitely don't need to understand monads to make people happy, but it certainly helps. In practice, as PHP has shown :P, you really don't need to understand much of anything to do awesome stuff. And yet we all still heavily recommend encapsulation and testing and code reuse and so on; the Haskell philosophy is just a systematic extension of this.

I think Haskell's widely spread reputation as just an academic curiosity makes some people a little defensive--and well it should! But never take it personally. It's just a little annoying for an immensely practical and productive language to be cast aside simply because it derives its efficiency from a well-founded theoretical basis.

Re:Why I went from Python to Go (and not node.js) by jonathansizz on Friday September 14, 2012 @08:57PM (#4524779)
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.
Re:Why I went from Python to Go (and not node.js) by slurgfest on Friday September 14, 2012 @11:50PM (#4525229)
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) by 3amOpsGuy on Saturday September 15, 2012 @09:41AM (#4526056)
I can relate to what he said, like the grandparent here it made me laugh.

I wouldn't say i espouse the view presented (have too much respect for what's been achieved in the other camps such as Ruby and even PHP), but internally yeah i think i do view the world that way.

I don't think it's any different from the common "anyone driving slower than you is a doddler, anyone faster is a maniac" - a patently absurd view to hold.

The enlightening part for me is that other pythonistas think this way, because as you said, i have also never experienced this view expressed publicly by the python community.

Re:Why I went from Python to Go (and not node.js) by Ideka on Friday September 14, 2012 @09:47PM (#4524916)
since Python is a thoroughly mediocre language.

Care to elaborate?

Re:Why I went from Python to Go (and not node.js) by tikhonj on Friday September 14, 2012 @10:28PM (#4525022)
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, admittedly, readable) syntax. It is fairly verbose and writing most anything takes more than one line. It pretends to support functional programming, but only grudgingly and never well. It has OO support, but also rather half-heartedly compared to Self or Smalltalk. It has a completely arbitrary and unnecessary delineation between statements and expressions (this one really annoys me).

In short, it's a language best define by what it isn't: it isn't bad, but it also isn't good.

It isn't particularly elegant, but it isn't particularly ugly either. It isn't exceptionally expressive, but it's also no tarpit. It isn't very concise, but it isn't quite overly verbose.

It is the very essence of plainness. If languages had a color, Python's would be a dull gray.

An interesting thing to note is which communities do not like Python. For what it's worth, the least Python-endorsing site I've found is Lambda the Ultimate. That should definitely tell you something, although I suspect what it tells you depends entirely on your own preferences :P.

Python really is nothing but mediocre and uninspiring. Sure, it isn't bad, but I would like a language that is actively good.

The very interesting thing about all this is that, quite often, you need a mediocre language. So Python is actually a great fit for a bunch of startups--it's the modern lowest common denominator. But I--being deeply interested in programming languages--wouldn't want to work anywhere that settled on a language that way.

Re:Why I went from Python to Go (and not node.js) by slurgfest on Friday September 14, 2012 @11:45PM (#4525213)
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) by tikhonj on Saturday September 15, 2012 @12:56AM (#4525366)
For what it's worth, I've used Python professionally and in several classes. I certainly don't have much experience in it, but it would be odd if I did--why would I use a language I don't particularly like too much?

You only say there are no horrible gotchas with tuples because you've never spent hours hunting down a bug and finding that you forgot a trailing comma. More pertinently, changing something like

    ("foo",
     "bar",
     "baz")
to

    ("foo")
actually breaks the code. This style is used often in configuration scripts (e.g. for Django) and certainly got me before. I don't really see what generator expressions have to do with anything.

The performance problem isn't a problem per se--the performance just isn't good. But this does not mean it's bad! That was really the whole point of my post; the performance, like everything else about the language, is unimpressive. In my experience, even naively written Haskell tends to perform better while being shorter and easier to write.

My point with Lambda the Ultimate was more general--I've noticed that the more programming language oriented a community is, the less people like Python. The people who spend the most time thinking about and working on different programming languages--the denizens of Lambda the Ultimate--are the ones who like it least. It's very much like music that musicians don't like.

What I meant by lowest common denominator is that you could get virtually anybody, regardless of skill level, to use Python. C is far more tricky--and has far more odd edge cases and ways to shoot yourself in the foot--than Python. It trades this for lower-level hardware access and performance, but this makes it far less of a LCD language than Python.

This is not a matter of "cool"--and it's not even a matter of Python being a bad tool. It's a matter of Python not being an outstanding, or, honestly, even a good tool. And, as I said, this is perfectly fine; there are plenty of reasons to choose a solid tool you know well over something that may even be strictly superior. I can even understand why people would like this; many people like something approachable and bland over something seemingly exotic but also exciting.

But this does not fit with Python's general hype. People trot Python out as the gold standard of language design and are rather proud of themselves (as the post starting this whole discussion parodied) without having the substance to back that attitude up.

And all this goes back to the original thesis: Python is not actively bad, but it is also not actively good--it occupies a rather uninteresting middle ground. This is only surprising in light of its somewhat incongruous reputation as one of the best languages in certain circles.

Re:Why I went from Python to Go (and not node.js) by tompudding on Saturday September 15, 2012 @08:47AM (#4525987)
People who like programming languages are not the intended users. People who like programming are, and in my experience there is rather less overlap between these two groups than you might think.
Re:Why I went from Python to Go (and not node.js) by antihero on Saturday September 15, 2012 @07:46AM (#4525913)
Doing that makes it not a tuple but just a string that's in brackets.

Anybody that's done Python for more than a day will instantly know that you'd do ("foo",), and to be honest you'd more likely write it as

  (
      "foo",
      "bar",
      "baz",
  )
So removing the last two elements will not break the tuple.
Re:Why I went from Python to Go (and not node.js) by jvm on Saturday September 15, 2012 @02:55PM (#4526949)
I'm so confused. You seem to be saying that

> 4 * (3+2)

should throw:

> TypeError: unsupported operand type(s) for *: 'int' and 'tuple'

???

I beg to differ.

Re:Why I went from Python to Go (and not node.js) by achompas on Sunday September 16, 2012 @10:22AM (#4529184)
No, parent is saying that:

>>> isinstance(tuple, ("foo", "bar"))

True

>>> isinstance(tuple, ("foo"))

False

which is correct. In Python, a single-element tuple must end with a comma--otherwise it is just that element, e.g.:

"foo" == ("foo")

FWIW, OP is right--finding a bug related to this issue is almost a rite of passage for new Python devs.

Re:Why I went from Python to Go (and not node.js) by jvm on Monday September 17, 2012 @10:49PM (#4536036)
I'm not clear on what in my comment you're saying "no" to. isinstance(tuple, ("foo")) being True is not a "rough edge" (or if it is anything people are ever confused by is a rough edge). If it were True, that would also mean you couldn't use parentheses to set the order of operations, since items inside parentheses would be tuples. That would be nuts.

IMO this is just an educational issue where people aren't taught that the comma is the tuple operator (e.g. `x = 3,4` is perfectly legal) and parentheses just come along for the ride to disambiguate other uses of commas. If I were king tuples wouldn't have the same syntax as argument lists (`f((3,2))` is pretty ugly), but both Python tuples and Python argument lists conform to a lot of people's expectations of how both those things should look.

The fact that duck typing makes tuples and literals (temporarily) indistinguishable to the interpreter is more of a rough edge of duck typing itself. Duck typing can result in tricky bugs in many scenarios well beyond singleton tuples.

Re:Why I went from Python to Go (and not node.js) by achompas on Tuesday September 18, 2012 @07:16PM (#4541084)
I responded to this point (which was phrased as a question):

You seem to be saying that 4 (3+2) should throw: TypeError: unsupported operand type(s) for : 'int' and 'tuple'???

Parent wasn't saying that at all, and I was clarifying.

Re:Why I went from Python to Go (and not node.js) by jvm on Wednesday September 19, 2012 @10:07AM (#4543573)
Sorry to belabor the point, but this is exactly what parent was saying.

> changing something like > ("foo", > "bar", > "baz") > to > ("foo") > actually breaks the code.

Of course it breaks the code because the first thing is a tuple and the second is a string. He's implying that the second thing shouldn't be a string. I'm saying that's nuts.

Re:Why I went from Python to Go (and not node.js) by StavrosK on Friday September 21, 2012 @06:02AM (#4553080)
No, he's saying that the operation you perform to truncate the former to the latter is the operation you would logically expect to perform (i.e. removing the trailing comma), which makes the thing a string.

He's not actually proposing that a string be a tuple. He's just saying that a single element enclosed in parentheses doesn't work the way you'd expect it.

Re:Why I went from Python to Go (and not node.js) by achompas on Saturday September 22, 2012 @02:33PM (#4558593)
Thank you, Stavros.
Re:Why I went from Python to Go (and not node.js) by StavrosK on Saturday September 22, 2012 @06:38PM (#4559231)
You are quite welcome.
Re:Why I went from Python to Go (and not node.js) by icebraining on Saturday September 15, 2012 @12:53PM (#4526544)
I don't get your tuple example. If you don't use the tuple operator - the comma - why would you expect to get a tuple?

People trot Python out as the gold standard of language design

Who?

Re:Why I went from Python to Go (and not node.js) by emmelaich on Sunday September 16, 2012 @08:20AM (#4529025)
> I don't get your tuple example ...

The point is that it's a subtle syntactical difference but a dramatic semantic difference. I think most newcomers to Python hit this.

Re:Why I went from Python to Go (and not node.js) by alexanderh on Saturday September 15, 2012 @01:27AM (#4525413)
I like how after all these paragraphs you've managed to avoid having to offer up your own personal example of a "good" and "outstanding" language. But have no problem labeling other languages as NOT being such, with very poor examples :P

You should get an achievement of some sort. Hackernews needs achievements.

Re:Why I went from Python to Go (and not node.js) by skrebbel on Saturday September 15, 2012 @02:02AM (#4525470)
Why were the examples poor? Also, if he'd have "Python is mediocre, and X is fantastic", the discussion would've moved to X. He was right in not doing that.

And why the bitterness?

Re:Why I went from Python to Go (and not node.js) by mixmastamyk on Saturday September 15, 2012 @03:32AM (#4525601)
There are no perfect languages. They aren't a bag of individual features, but platforms these days. Taken as a broad platform, the python ecosystem is up there with the best, warts and all. Why, because others have even more.

No offense, but your youth is showing--it appears you haven't used it long enough to fully understand it (gotchas), have unrealistic expectations of purity, and aren't very aware of the preceding. Yet you still have strong opinions... like most of us experience will beat you down, give it time.

I wrote a few of these stinkers a decade ago and would laugh at them now.

Re:Why I went from Python to Go (and not node.js) by njharman on Saturday September 15, 2012 @10:22AM (#4526113)
> In short, it's a language best define by what it isn't: it isn't bad, but it also isn't good.

Exactly, as you point out in the end. It's a language for people who are deeply interested in getting shit done. Rather than people "being deeply interested in programming languages".

You are acting out the 2nd (tower type) stereotype so well I can almost believe you are a parody.

Re:Why I went from Python to Go (and not node.js) by jvm on Saturday September 15, 2012 @03:17PM (#4527003)
I don't always code Python, but when I do I don't complain much about these issues :-).

I think everything you've mentioned is pretty defensible, particularly the readability bit. Honestly if a language does everything reasonably well, I think that's pretty awesome. I'm also curious what magical dynamically-typed interpreted language you prefer. The only mainstream general-purpose alternatives I can think of are Ruby (which is basically alternate-universe python) and Perl (which seems strictly worse), or are you into JavaScript or APL-derivatives? It's all a matter of taste of course, but I could probably write a much more vicious rant against any of those.

Re:Why I went from Python to Go (and not node.js) by mjcohenw on Friday September 14, 2012 @11:48PM (#4525222)
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) by mixmastamyk on Saturday September 15, 2012 @03:19AM (#4525583)
Wasn't it asshole/maniac?
Re:Why I went from Python to Go (and not node.js) by nobleach on Saturday September 15, 2012 @11:09AM (#4526230)
It was idiot/maniac... one of the few times George opted for a repeatable joke to children.
Re:Why I went from Python to Go (and not node.js) by jimbokun on Friday September 14, 2012 @08:54PM (#4524770)
That was the joke.
Re:Why I went from Python to Go (and not node.js) by burntsushi on Sunday September 16, 2012 @12:30PM (#4529479)
There is apparently something wrong with your ability to detect when something is said in jest.
Re:Why I went from Python to Go (and not node.js) by slurgfest on Friday September 14, 2012 @11:49PM (#4525223)
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.