I switched to writing python as my main backend/scripting language with my new job. Previously I was using Ruby for most of this stuff with some Go. I must say that so far Python has been a vastly inferior experience for me. The languages are fairly similar all though I prefer the more talkative/english style of ruby and the use of functions over list and dict comprehension. The thing that really stands out to me tho…
Check out conda sometime.
Why People Should Learn Python
81–90 of 329 posts
Re: Why People Should Learn Python
#82Is it just my feeling or are there languages which are preferred on HN? Indicators for languages which are liked by the HN community: - Positive stories get many upvotes and are instantly at the top of HN - Most comments are positive - Frequent coverage on HN about the language Indicators for languages which are not liked by the HN community: - Rants get many upvotes and are instantly at the top of HN - Most comments…
I would say that node.js is very liked on HN. Half the stories here are about Node.js. But I rarely see any positive mentioning on HN about c#, .NET, C++ or Java.
I think that might be a slight exaggeration. At present, zero of the stories on the HN front page appear to be about Node.js.
Re: Why People Should Learn Python
#83Now that I have a chance to ask: I've always found the def __init__ method with 4 (!) underscores one of the ugliest things I've seen in a programming language. Don't get me wrong: I like Python and know it's truly good, but __why__??
I believe it's part of the language design, a phrase you'll find quite a lot in Python language discussions, especially is more esoteric features is; "We're all consenting adults". There are certain areas of the language which may not behave exactly the way you'd be expecting, if you're new to it. These usually have an unusual syntax, which will cause you to find out more. They're basically the mini-roundabouts of py…
Driving in Belgium - the scripting equivalent of batch files
Re: Why People Should Learn Python
#84Re: Why People Should Learn Python
#85But today, I'm less excited about it. I've gotten spoiled by C#, that has static typing, and consequently, better tooling, as well as a good measure of the flexibility of Python, through dynamics, lambdas, LINQ.
It seems Python is finally getting over the 2.X -> 3.X schism, but that kind of threw a wrench into things for a number of years, as well.
Re: Why People Should Learn Python
#86The person who wrote this obviously has "the hacker's mindset". He praises expressivity and malleability of the language. Well, in this case it might be advisable to take a look at Perl. And never go back. Perl (especially Perl6) is hacker's paradise, where everything's true and nothing is forbidden. As somebody who shares the same mindset, I truly enjoyed my years with Perl, and I occasionally return to this experie…
> is hacker's paradise And support engineer's hell
Python is a strange case. The CPython code base seems to be quite well organized and well written, and about 10% of packages on GitHub or PyPI are extremely solid.
The problem is the staggering amount of packages (public or in-house) that have 100000+ LOC and use the worst features of OO, functional, and procedural programming at the same time.
The result is not spaghetti code, but ravioli code where there's zero control flow and "everything happens somewhere else". Add to that the "consenting adult" philosophy, and you have the modern equivalent of goto mixed with self-modifying code.
I'm sure Perl has all that, but it's far from the only language.
Re: Why People Should Learn Python
#87I'm glad I made that decision. The language was easy enough to pick up in my spare time. I hardly ever use pandas/numpy unless I'm doing some really serious statistical work; the core language and patterns in Python are now pleasant enough for me to use in day-to-day data wrangling and hacking. I'm now mixing in Ruby for a current project -- mostly because I like Rakefiles, and also, Ruby's static site generators like Middleman -- and it's been surprisingly painful to do things in Ruby. I used to hate how when doing a Google search for something in the Python stdlib would bring up 2.x before 3.x...but it almost seems even more problematic in Ruby, where 1.9.3 and 2.0.0 docs keep coming up, even though official maintenance of them has been dropped.
(2.0's maintenance ended in Feb. 2016 http://ruby-doc.org/core-2.0.0/Array.html)
If I didn't know better, I wouldn't even know what Ruby's official version was. For me, Google results show no other documentation for Ruby's Array, as the next results are from tutorialspoint and sitepoint.
And that's not even getting into the issue of how problematic the do-things-how-you-like freedom of Ruby is incredibly hard to discern as an outsider. To give one example I recently had: how do you iterate through a human-calendar-based time interval, such as a month (i.e. any interval that doesn't have a constant length in seconds)?
In Python, I remember how frustrating it was to figure out what the hell the difference was between datetime, time, calendar, the gmtime function, and then timedelta, and then the third-party libraries of pytz and python-dateutil. But once I understood them, which was largely a matter of realizing how naive I was about the nature of measuring time, doing something like iterating over calendar intervals is straightforward.
This is my first Google result for "python iterate month intervals" -- it's from 2008 and still works perfectly: http://stackoverflow.com/questions/153584/how-to-iterate-ove...
Now here's the result for Ruby; all of the answers, as far as I can tell, are not only not-very-Rubyish, but not reliable either: http://stackoverflow.com/questions/1724639/iterate-every-mon...
FWIW, I remember solving this problem by using the DateTimein ActiveSupport. Which is a credit to how much fun and joy it is to build things in Rails right out of the box. But that complexity catches up quick, and including ActiveSupport in day-to-day Ruby work can sometimes to unwanted monkeypatching.
Re: Why People Should Learn Python
#88Earlier quoted context omitted.
8. Significant whitespace. Not only is it a constant minor inconvenience when editing the program, it makes it very hard to cut-and-paste code fragments on the web.
"Making it hard to copy-paste code from the web" is something that I would consider a feature, to be honest.
Re: Why People Should Learn Python
#89Why is a beginner's introduction to one of the common scripting languages at the top of HN? Most everyone here should know at least one of the usual suspects (Ruby, Perl, Python, etc). They are all quite similar in capabilities. Is introduction to loops at the top, in an hour? Edit: The few newbies here which don't know a scripting language are hardly the ones voting this up... Edit 2: BanzaiTokyo is free to explain…
PS: editing your own post to reply is a weird way to do things when there's a "reply" link under each comment...