So guys, I've been seeing a lot of tutorials on the Internet about AI that are mostly done with Python. Apart from these, I've seen C# being used in AI topics but in things like for example "Self-Driving cars", I've seen Python and not C# or any other languages. I wanted to ask, do you recommend that I learn Python? Because I know C# and I wanted to become more professional in it, but, now that I see that Python is being used a lot, I'm getting intrigued in it. Do you recommend Python or other languages or should I keep up with C#? Just to mention, I'm 14 years old and I have enough time to learn more and it doesn't really matter what I love to do, because, I love coding and AI specially, so, it doesn't really matter. If it's not a waste of time, I should get started, right? If you recommend Python, please tell me which compiler I should use. I don't really know if it has a compiler, but I want to know where I should start from. Thanks.

  • $\begingroup$ Deciding between C# and Python is relevant to Artificial Intelligence if the aim is to generate self-modifying code. That means, the C# code is stored as a linked list and a parser is trying to optimize the source because he is trying to inject new objects from the knowledge base into it. In my opinion, Python is easier to modify on-the-fly because the code is interpreted, but it is also possible to write a conditional planner for C#. $\endgroup$ – Manuel Rodriguez Oct 2 '18 at 18:10
  • $\begingroup$ I don't see the punishment as being a big enough risk. There are already too many duplicates being closed when they aren't really and reopening almost never happens. I like the idea if that issue could be solved (the problem of encouraging sloppy dupe finding),instead of mind boggling the scientific community. $\endgroup$ – quintumnia Oct 2 '18 at 18:13
  • $\begingroup$ Thanks @ManuelRodriguez for your answer. As I have understood, your saying that learning Python isn't really a big deal, and you're also saying that I can work with C#. In the current condition, I think that getting the main idea of AI is important. If you could give a source or tip to start, I will appreciate it so much. I think that AI can be run on any language, I suppose at least. If I'm wrong, please tell me. Thanks. $\endgroup$ – Alireza Sh Oct 2 '18 at 18:47
  • $\begingroup$ @AlirezaSh If “I” is equal to a parser then yes, but maybe we talk past each other. Mastering a programming language is easy for humans. A programmer can handle any of them, no matter if it is Python, LISP or whatever. The problem from AI perspective is to program sourcecode without human intervention. For example, a robot sees a table with his camera and then the robot creates a C# class for that table and everything in realtime. This kind of topic is researched by Artificial Intelligence. $\endgroup$ – Manuel Rodriguez Oct 2 '18 at 20:12
  • 1
    $\begingroup$ This answer should help you. $\endgroup$ – Ugnes Oct 2 '18 at 23:53

If you're doing deep learning (which I assume you are, if you say you want to learn "AI"), then Python is a MUST. Virtually all the big frameworks are Python wrappers over a C++ core.

C# has no real deep learning frameworks. There are a couple such as the Microsoft Cognitive Toolkit, but they are on a completely different level from PyTorch or Tensorflow. No serious ML practitioner would do the majority of their research in a framework like that.

For more information, see: Why is Python the most popular language in the AI field?


Corporations, government research, and academia are favoring C, Python, Java, LISP, and R currently. The trends are not favorable to C# for AI.

C#'s peak of use was in the 2009 to 2012 range. By buying GitHub, Microsoft intends to regain some control over development tools and language but has never been particularly successful in either. Even eclipse is giving way to other open tools or proprietary tools with community versions, and JavaScript and Python are the languages gaining popularity in this decade. It is not clear whether C# will be very well known as a general purpose programming in ten years.

C/C++, Java, and JavaScript have stood the test of time. C/C++ is the language of choice for low level access to dedicated hardware, which is what it was designed by Bell Labs to do. Java is almost as fast and still very popular, strongly OO, still developing, and with Scala, Groovy, Maven, and Gradle, looking strong for the future.

Python started slow but has seen continuous rapid growth trend for the last two years because of its MATLAB-ish-ness and syntactic clarity. JavaScript, with its heavy influence from LISP and Scheme from the birth of AI, will likely enter in greater strength as AI reaches the front end and middle tiers of web applications.

C# doesn't look hopeful for keep pace.

  • $\begingroup$ I’ve got the needed information now. As @Omegastick and FecilityC said, I need to know Python as it’s more powerful. Thanks to all of the folks that answered. $\endgroup$ – Alireza Sh Oct 4 '18 at 9:43
  • 1
    $\begingroup$ I disagree with the bleak outlook you are drawing for C#. There is the SciSharp STACK project, which is porting the most important Python libraries to C# to create an equally good machine learning ecosystem for .NET: scisharpstack.org $\endgroup$ – henon Jul 31 '19 at 20:13

I agree with Felicity's answer, except the part where he says that "C# doesn't look hopeful for keep pace."

There are new frameworks such as ML.Net being developed right now and the new version of C# (C# 7.0-8.0) focus on performance while keeping simplicity. I cannot find the link right now, but there was a post on their GitHub explaining their new vision. By the way, the .Net Core performance is really close to C++. For these reasons, I think C# is a language that will be more and more popular within the next years in the AI industry.

The downside of using C# is that you really need to know the language deeply in order to take full advantage of it. Personally, it took me ~2 years of full-time work to be really good at it while Python only took me two weeks. I think many people in the AI industry doesn't want to spend too much time on learning an language, so they prefer to opt for Python. But for references, C# is actually MUCH FASTER than Python as of February 4th, 2019.

Also, I have developed in both languages, and I have found that it is much easier to develop good development practices using C# development tools than Python (this is a personal opinion - it's not a fact)

Choosing a language for AI development really depends on multiples factors, so giving a general answer here is difficult.

  • $\begingroup$ Saying that C# is faster than Python is a bit misleading. While it is technically true, in AI Python is never used for the heavy lifting. Instead, we call methods implemented in C (which is faster than C#) via a Python wrapper (numpy, PyTorch, Tensorflow, etc.). $\endgroup$ – Omegastick Feb 6 '19 at 1:13
  • 2
    $\begingroup$ You can still see that Python is performing worse than C# Core 2.1 (2.2 is faster, like 30% in some cases than 2.1 version) in Amazon Lambda benchmarks. By the way, this is why I hesitated before giving an answer because it really depends on the type of application you want to develop. If you want to start a company and you develop your program in Python, it is a very bad language for many reasons. If you want to do a PHD, or just want to learn about AI, then it is a very good language $\endgroup$ – Jonathan Feb 6 '19 at 11:19
  • 1
    $\begingroup$ Sure, you can have your AI engine in Python only, and then use other language to call the methods. But the thing is it really depends on what you want to develop. It's hard to give a general answer to OP's question. I guess the good answer for OP's question is Python since he's 14 and just want to learn about it. What I liked about Python is that it's his simplicity and that's probably what OP is looking for. I'm still leaving my answer tho, because advanced developers coud see this thread and be aware of the new vision of C#. $\endgroup$ – Jonathan Feb 6 '19 at 11:21
  • $\begingroup$ Cannot edit my comment, but I said C# Core 2.1/2.2, I meant 2.0/2.1. Anyways, higher version = faster for these versions lol. $\endgroup$ – Jonathan Feb 6 '19 at 11:25

I did use both languages for a few things and I really do like python because it’s just so neat and tidy. But if you have never coded before it might be a little hard for you to learn. (to truly learn; basics are easy)

I would suggest the following: If you have learned a different language already (coded more than "hello world") then python might be the right deal otherwise start with a different language to learn a few basics before you are going to use and learn python. C# is a good choice then. It is important to learn how to code nice and tidy, how to comment und to understand what’s happening before stumbling into a field of "AI".

But to answer the question: Python it is! C# is maybe a choice for companies but I think even there it would not actually be used to code "AI".

BUT: AI or in all honesty Neural Networks... that's a pretty heavy topic as you wander the field. It has a lot of math and special coding in it and it will keep you "tangled". Make time to learn the scientific wrappers and it does not really matter where you start!

I wish you luck and all the best! Have fun however you decide! PS: if you are going to use python make sure to use tensorflow and keras in the beginning it just simplifies the start tremendously. And as an IDE I would personally choose PyCharm ;-)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.