Live data from Hacker News

Ask HN: Why use Python or similar?

news.ycombinator.com

11–20 of 72 posts

Re: Ask HN: Why use Python or similar?

#11
Generally speaking, the Python community believes the strength of Python is in its culture, which can be summed up by the Zen of Python: http://www.python.org/dev/peps/pep-0020/. Python also recieves much praise for being easy to learn, readability, productivity, expressiveness, and its library support, namely NumPy and SciPy (Python is often used in scientific computing for this very reason). Aside from this, Python programmers like it and that's reason enough. Performance for Python (and Ruby) is adequate for most use cases.

Personally, I don't like Python. If I want a dynamically typed language, I use Ruby, but I came to this conclusion after spending time with both languages, and it wasn't the feature set that sold me of one over the other, but rather how I felt while working in the language and its ecosystem. In other words, whether or not Python or Ruby are worth your time is a decision you'll only be able to make after using the language.

I believe in being language agnostic whenever possible. Don't hold strong opinions about languages. People invest a lot of time and energy into their tools. This is a "sunk cost." Their time and energy can't be reclaimed. So it's no surprise that, when asked, they will praise their tools -- even if they aren't objectively all that great -- solely to justify the costs. They aren't trying to convince you, they're trying to convince themselves. So don't waste time trying to find feature comparisons. All languages have redeemable values, and learning a new one is always a valuable exercise.

So give Python and Ruby a shot. You might find you actually like them, but not for the reasons you expected to. And if you don't like them, at least you'll know why.

Re: Ask HN: Why use Python or similar?

#12
Python code is smaller, and had better package management. I am sceptical you have something in C# that does not exist within a "pip install XXX" in python.

Python requires less LOCs than C#

Less code to maintain and it's quicker to write. Binding to C is no problem either when you need raw performance.

You can run it on a wide range of systems too.

Re: Ask HN: Why use Python or similar?

#13
It's easy. Like, really really easy. That alone makes up for a lot of flaws. Also, it's easy in a way that makes it easy to mold to the problem at hand. It's my goto language when I just want to throw something together, and for a few more complicated projects as well.

Re: Ask HN: Why use Python or similar?

#14
It is not just language. It is the platform behind language. You choose python/ruby your stack probably is opensource/linux stack. If you choose c# you probably is stuck with windows stack, (in which you don't have a lot options like open source stack).

Re: Ask HN: Why use Python or similar?

#15
One thing that I really like about Python is the interactive style of development that it encourages, at least for me. I tend to do Python development in emacs with source code in one buffer and a repl in another buffer, building my program up slowly and evaluating bits of it as I go along. This style of development works very well for me. There are other languages where you can do development like this but (and please correct me if I'm wrong), this doesn't seem to be the way that people write code in C#.

Secondly, with Python, the most popular implementation of the language is supported on all the main platforms. Compare this to C# and .Net where, although you can use Mono on Linux and Mac, you'd not be using the same runtime that folks would be using on Windows. Call me paranoid but I still don't wouldn't trust Mono as much as I would trust CPython or Microsoft's .Net runtime.

Having said all that, and despite the fact that I've written little C# code in anger, I still do like the look of C#. Microsoft seem to have done a pretty good job of updating the language over the years to support stuff like generics and functional programming. They've certainly done a better job on this front than Sun/Oracle have done with Java. If C# works better for you than Python does on the platform that you use then I wouldn't worry about sticking with it.

(EDIT - typo)

Re: Ask HN: Why use Python or similar?

#16
As some others have pointed out, speed of the application at runtime is not always the most important consideration, else we'd probably be doing everything in a mix of Fortran, C, and Assembly.

I have found that developer productivity is higher, especially when it comes to maintenance. For me, all the tools in an IDE help offset Python or Ruby's simplicity when working in say, Java, when writing new code. But when reasoning about old code I haven't touched in a while, or looking at others' code, Python is easier for me to reason about.

If casting about for a reason to learn any new language, I can think of a few. Understanding another language and how you approach problems with it may provide insight on how to better use your main language. Your career may be long, and your main language may not be popular forever. When acting as a hiring manager, I look for people who know multiple languages, even if I only need one. Especially if they tackled learning them outside of school. It shows both passion and initiative.

Re: Ask HN: Why use Python or similar?

#19
To some extent if you choose C#, you also have to choose windows, visual studio, iis, etc. In python you can take each of those pieces and exchange it for something else. A lot of people like to do that.

Fortunately if there's no need for a lot of .net ecosystem, you can run .net on linux and similar systems using mono. (I have and it's a great platform to write for) But as soon as you want something more than the bare .net you'll realise the pieces are hard to find.

Regarding the missing features - I don't think there's anything missing, you just need to know where to look. Only linq may not be available since relies on specific syntax, but due to what you can do dynamically, it's not that needed in the first place.

Re: Ask HN: Why use Python or similar?

#20
Don't try to evaluate the languages in isolation, because it's the libraries and ecosystems of the languages that make all the difference in your life. If you evaluate Erlang the language in isolation, you might hate it. But if you evaluate it while trying to make a server that will scale up from 1 to a hundred machines with fail over and no single point of failure, you might find yourself adoring it (in which case you should look Elixir). Python has its sweet spots of amazing things too, defined mostly by its easy to use libraries for doing everything from image processing, language processing, face recognition, and you name it.
Post reply on HN