7
$\begingroup$

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 self-driving cars.

I already know C# and I wanted to become more professional in it. However, now that I see that Python is being used a lot, so I'm getting intrigued by 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 especially, so, it doesn't really matter.

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.

$\endgroup$
8
$\begingroup$

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?

| improve this answer | |
$\endgroup$
5
$\begingroup$

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.

| improve this answer | |
$\endgroup$
  • 2
    $\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
4
$\begingroup$

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.

| improve this answer | |
$\endgroup$
  • $\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
  • 2
    $\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
0
$\begingroup$

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 ;-)

| improve this answer | |
$\endgroup$

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