Need advice about which tool to choose?Ask the StackShare community!
C# vs Python: What are the differences?
What is C#? Simple, general-purpose, object-oriented programming language for the .NET platform. C# (pronounced "See Sharp") is a simple, modern, object-oriented, and type-safe programming language. C# has its roots in the C family of languages and will be immediately familiar to C, C++, Java, and JavaScript programmers.
What is Python? A clear and powerful object-oriented programming language, comparable to Perl, Ruby, Scheme, or Java. Python is a general purpose programming language created by Guido Van Rossum. Python is most praised for its elegant syntax and readable code, if you are just beginning your programming career python suits you best.
C# and Python can be categorized as "Languages" tools.
"Cool syntax", "Great lambda support" and "Great generics support" are the key factors why developers consider C#; whereas "Great libraries", "Readable code" and "Beautiful code" are the primary reasons why Python is favored.
Python is an open source tool with 25K GitHub stars and 10.3K GitHub forks. Here's a link to Python's open source repository on GitHub.
According to the StackShare community, Python has a broader approval, being mentioned in 2789 company stacks & 3500 developers stacks; compared to C#, which is listed in 684 company stacks and 1118 developer stacks.
Python has become the most popular language for machine learning right now since almost all machine learning tools provide service for this language, and it is really to use since it has many build-in objects like Hashtable. In C, you need to implement everything by yourself.
C++ is one of the most popular programming languages in graphics. It has many fancy libraries like eigen to help us process matrix. I have many previous projects about graphics based on C++ and this time, we also need to deal with graphics since we need to analyze movements of the human body. C++ has much more advantages than Java. C++ uses only compiler, whereas Java uses compiler and interpreter in both. C++ supports both operator overloading and method overloading whereas Java only supports method overloading. C++ supports manual object management with the help of new and delete keywords whereas Java has built-in automatic garbage collection.
Go is a way faster than both Python and PHP, which is pretty understandable, but we were amazed at how good we adapted to use it. Go was a blessing for a team , since strict typing is making it very easy to develop and control everything inside team, so the quality was really good. We made huge leap forward in dev speed because of it.
I am working in the domain of big data and machine learning. I am helping companies with bringing their machine learning models to the production. In many projects there is a tendency to port Python, PySpark code to Scala and Scala Spark.
This yields to longer time to market and a lot of mistakes due to necessity to understand and re-write the code. Also many libraries/apis that data scientists/machine learning practitioners use are not available in jvm ecosystem.
Simply, refactoring (if necessary) and organising the code of the data scientists by following best practices of software development is less error prone and faster comparing to re-write in Scala.
Pipeline orchestration tools such as Luigi/Airflow is python native and fits well to this picture.
I have heard some arguments against Python such as, it is slow, or it is hard to maintain due to its dynamically typed language. However cost/benefit of time consumed porting python code to java/scala alone would be enough as a counter-argument. ML pipelines rarerly contains a lot of code (if that is not the case, such as complex domain and significant amount of code, then scala would be a better fit).
In terms of performance, I did not see any issues with Python. It is not the fastest runtime around but ML applications are rarely time-critical (majority of them is batch based).
I still prefer Scala for developing APIs and for applications where the domain contains complex logic.
Pros of C#
- Cool syntax319
- Great lambda support268
- Great generics support243
- Language integrated query (linq)187
- Extension methods161
- Properties with get/set methods76
- Automatic garbage collection75
- Backed by microsoft69
- Automatic memory management57
- Amaizing Crossplatform Support53
- High performance28
- Beautiful27
- LINQ24
- Great ecosystem of community packages with Nuget21
- Vibrant developer community18
- Dead-simple asynchronous programming with async/await13
- Great readability12
- Strongly typed by default, dynamic typing when needed9
- Productive8
- Easy separation of config/application code7
- Visual Studio - Great IDE7
- Open source6
- Object oriented programming paradigm6
- Events management using delegates5
- OOPS simplified with great syntax5
- Operator overloading5
- Conditional compilation4
- Organized and clean3
- High-performance3
- Coherent language backed by an extensive CLR3
- Cool3
- Comprehensive platform libraries3
- Great community3
- Good language to teach OO concepts3
- Linq expressions2
- Top level code2
- Concise syntax, productivity designed2
- Unity2
- Lovely1
- Interfaces1
- Interfaces0
Pros of Python
- Great libraries1.1K
- Readable code921
- Beautiful code815
- Rapid development764
- Large community669
- Open source414
- Elegant375
- Great community264
- Object oriented257
- Dynamic typing206
- Great standard library68
- Very fast51
- Functional programming47
- Scientific computing33
- Easy to learn31
- Great documentation29
- Matlab alternative25
- Productivity22
- Easy to read21
- Simple is better than complex19
- Imperative17
- It's the way I think17
- Very programmer and non-programmer friendly15
- Free14
- Powerful14
- Fast and simple13
- Powerfull language13
- Scripting12
- Explicit is better than implicit9
- Machine learning support9
- Unlimited power8
- Ease of development8
- Import antigravity7
- Clear and easy and powerfull7
- Print "life is short, use python"6
- It's lean and fun to code6
- Great for tooling5
- Fast coding and good for competitions5
- There should be one-- and preferably only one --obvious5
- Python has great libraries for data processing5
- High Documented language5
- I love snakes5
- Although practicality beats purity5
- Flat is better than nested5
- Readability counts4
- Multiple Inheritence3
- Complex is better than complicated3
- Plotting3
- Rapid Prototyping3
- Lists, tuples, dictionaries3
- Socially engaged community3
- Great for analytics3
- CG industry needs3
- Beautiful is better than ugly3
- Easy to learn and use2
- List comprehensions2
- Generators2
- Special cases aren't special enough to break the rules2
- Now is better than never2
- If the implementation is hard to explain, it's a bad id2
- If the implementation is easy to explain, it may be a g2
- Simple and easy to learn2
- Import this2
- No cruft2
- It is Very easy , simple and will you be love programmi1
- Batteries included1
- Because of Netflix1
- Web scraping1
- Easy to setup and run smooth1
- Pip install everything1
- Only one way to do it1
- A-to-Z1
- Many types of collections1
- Flexible and easy1
- Better outcome1
- Powerful0
- Pro0
Sign up to add or upvote prosMake informed product decisions
Cons of C#
- Poor x-platform GUI support11
- Closed source6
- Requires DllImportAttribute for getting stuff from unma6
- Fast and secure5
Cons of Python
- Still divided between python 2 and python 348
- Performance impact26
- Poor syntax for anonymous functions26
- Package management is a mess18
- GIL18
- Too imperative-oriented13
- Hard to understand12
- Dynamic typing10
- Very slow8
- Not everything is expression8
- Indentations matter a lot7
- Explicit self parameter in methods7
- Poor DSL capabilities6
- No anonymous functions6
- Requires C functions for dynamic modules6
- The "lisp style" whitespaces5
- Hard to obfuscate5
- The benevolent-dictator-for-life quit4
- Lack of Syntax Sugar leads to "the pyramid of doom"4
- Threading4
- Fake object-oriented programming4
- Incredibly slow4
- Not suitable for autocomplete3
- Official documentation is unclear.3
- Circular import2
- Training wheels (forced indentation)1
- Meta classes1