Coming from Perl, I love Ruby (for non-Rails stuff), but end up using Python because: - The documentation in the Python ecosystem is generally better. - There's more Python libraries, and they're generally better maintained and better documented. - Python has a better interface to C. - Python is more popular and generally more supported by third parties. - Django/Flask - There is comparatively little Ruby activity ou…
Ask HN: Why did Python win?
821–830 of 856 posts
Re: Ask HN: Why did Python win?
#822The way I (somewhat hazily) remember it, Python was mainly competing with Perl as a scripting language, not Ruby as an application/web language. I started hearing about Ruby years later when Ruby on Rails drove the Web 2.0 movement, but that feels like a different era to me. Eric S. Raymond wrote an article[1] in 2000 about his experience trying Python after spending a lot of time with Perl. I'll quote some of it her…
The quotation is so true. There was a "Python WTFs" posted recently which was fun but the thing is you could work with Python successfully for years without ever running into them. Contrast that with other languages where you need to learn the WTFs before you can stop writing buggy code.
Re: Ask HN: Why did Python win?
#823FWIW Ruby's FFI is pretty advanced and when you interface it from C it feels like duck typed C. Also back then I struggled writing a hello world in Python, so I think it's bad luck. On the other hand I think the Ruby community changed Software development quite a lot, making it more welcoming and defining how Web development should be done.
Re: Ask HN: Why did Python win?
#824Earlier quoted context omitted.
I think Python was popular as a general-purpose language first. After all, there was a reason people put so much effort into writing Numpy in the first place. I think a lot of people were attracted to the language design, as captured in the Zen of Python ( https://peps.python.org/pep-0020/ ), such as: Explicit is better than implicit. Readability counts. Errors should never pass silently (unless explicitly silenced)…
> There should be one-- and preferably only one --obvious way to do it. This is so hilariously wrong in python though
Re: Ask HN: Why did Python win?
#825Earlier quoted context omitted.
The one thing Rust is getting right that I hope Carbon et. al take from it is using the type system to manage memory. not having to explicitly remember `free` in safe Rust code is amazing. Knowing that if my types are sound that memory will be managed reasonably is great. I also think that immutable by default, mutable by explicit declaration is pretty great. I do think there is a lot of room to add better ergonomics…
The amount of complexity that Rust adds is not worth in most scenarios in my opinion. I can think of Rust as something for OS with critical safety or so. Besides that, in real life you end up having C in most of your software, so I am not sure how Rust behaves compared to well-written C++ with all warnings and linters on and using smart pointers. But my hypothesis is that they do not stay very far apart in safety. Th…
Can C++ compilers + linters reliably detect all misuses of unique_ptr? Because that sounds like a halting-problem kind of problem, and as soon as you can't guarantee memory-safety, you're definitely not in the same ballpark in terms of safety. I mean, memory-unsafety is the number one vulnerability cause in software. C++ has many qualities, but safety certainly isn't one of them.
Re: Ask HN: Why did Python win?
#826Earlier quoted context omitted.
Doesn’t seem like that big of a deal. You’re going to have a really hard time getting your first test to pass if you make a mistake. I don’t mean using testing as a poor man’s type system, I mean even the tests you would write in a statically typed language will quickly uncover any mistakes you could possibly make there.
In statically typed systems, this wouldn't even compile. I'm pretty sure I'd see multiple cases where the function would return different types depending on a code path.
Still, it's not like you're going to miss that a function doesn't return something expected. Even in statically typed languages you are going to have tests to validate that much.
> I'm pretty sure I'd see multiple cases where the function would return different types depending on a code path.
That's another problem entirely. Although even then it would be pretty hard for an errant type to not blow up your tests. Again, not tests specifically meant to check that your types or sane, just the same tests you would write in a statically typed language.
Re: Ask HN: Why did Python win?
#827Python really presented itself as a general purpose language for me. For example, as a language that could do a lot of the general scripting that you could do with Bash could but using a language that is much, much easier to read. Even though I can write it better now and appreciate how much faster it runs, at the time I had a really hard time writing and understanding Bash scripts.
Ruby on the other hand, almost seemed as a language you had to learn as a pre-requisite to get to use Ruby on Rails. But if you did not care about Rails, then there was little incentive to learn it. Since I already used PHP for the web and had lots of experience with its respective frameworks (like Symfony) I did not feel the need to double up on a web language / framework combo.
And, yes I know it is used in other frameworks/software but the perception that I had at the time was that Rails was the most popular use case for it.
But then when Python really solidified itself for me as the truly general purpose language was seeing it as the language behind projects like Pandas, Numpy and Ansible for example and being able to use that software no problem.
And all this in spite of the fact how readable both of them were and the fact they both have great package managers.
So all those things being equal I chose to learn Python because it seemed like I get more out of it beyond web development.
I will say this about Rails though, Ruby on Rails is one of the most influential web frameworks of all time and Laravel borrowed so much from it.
Re: Ask HN: Why did Python win?
#828There's a joke that is roughly "Python is not the best language for any particular task, but is nearly always the second best language for that task" - it's a jack of all trades language. Because of this, lots of people learned Python, and then applied it in many different areas, and it just became more prevalent and useful.
And when you get older, and you care more about solving problems than about trying new things, and you've got more responsibilities in life and lack the time to devote to learning new language / technology du jour, then knowing and using Python becomes so handy.
If it is indeed the 2nd best language for the job, it is still a decent choice if you get to solve the problem.
Re: Ask HN: Why did Python win?
#829Earlier quoted context omitted.
If the length of mylist ... see how length comes first? Only unintuitive if you never spoke English or other european languages.
A really, really bad argument in my opinion. That thinking would lead us to Cobol.