3 ms·
There are any number of reasons to use Python over C#. (1) Ecosystem. Choice of language is often not dictated by language features, but what library features
by rbehrends 13y ago
There are any number of reasons to use Python over C#.
(1) Ecosystem. Choice of language is often not dictated by language features, but what library features and especially third party libraries are available.
(2) Simplicity. It's a lot easier to teach Python to non-programmer domain experts than C# or Java (a major reason, I think, why Python is used so extensively in scientific computing).
(3) Not being dependent on an IDE. Using an IDE is not always an option (e.g., system administration on the far end of an SSH connection).
(4) Prototyping. Especially when doing exploratory programming, a static type system can get in the way of drafting your ideas.
(5) Extensibility. It allows you to easily provide scriptability or configurability via Python.
(6) Portability. Like most interpreted languages, Python is extremely portable across a great many architectures.
(7) Interfacing with C. While P/Invoke is much better than the JNI, Cython is easier than both.
Speed, incidentally, isn't as much of an issue in many application domains as people seem to think. If it's needed, it's frequently just a few inner loops that dominate execution time, which can be implemented easily enough in Cython.
As for Python (or any other language) lacking features that you find in C#, I think you'll find that some programmers will think the opposite (e.g., much more cumbersome metaprogramming in C#).
In short, which language to pick (insofar as that choice isn't dictated by your job anyway) is influenced by a large number of factors, which different people will weigh differently.