I know that every program has some positive and negative points, and I know maybe .net programming languages are not the best for AI programming.

But I prefer .net programming languages because of my experiences and would like to know for an AI program which one is better, C or C++ or C# and or VB ?

Which one of this languages is faster and more stable when running different queries and for self learning ?

To make a summary, i think C++ is the best for AI programming in .net and also C# can be used in some projects, Python as recommended by others is not an option on my view !

because :

  1. It's not a complex language itself and for every single move you need to find a library and import it to your project (most of the library are out of date and or not working with new released Python versions) and that's why people say it is an easy language to learn and use ! (If you start to create library yourself, this language could be the hardest language in the world !)

  2. You do not create a program yourself by using those library for every single option on your project (it's just like a Lego game)

  3. I'm not so sure in this, but i think it's a cheap programming language because i couldn't find any good program created by this language !

  • 1
    $\begingroup$ Welcome! From the tour: "Artificial Intelligence Stack Exchange is a question and answer site for people interested in conceptual questions about life and challenges in a world where "cognitive" functions can be mimicked in a purely digital environment." You'd probably have better luck asking this in Data Science. $\endgroup$ – Matthew Graves Sep 7 '16 at 14:20
  • 1
    $\begingroup$ @MatthewGraves THX :) $\endgroup$ – Sinf Sep 7 '16 at 14:25
  • $\begingroup$ @MatthewGraves I think this still applies, as he's asking in what digital environment these cognitive functions can be developed. This SE is for questions people have about the how's and why's of AI. But I'll leave it to mods to decide. $\endgroup$ – Avik Mohan Sep 7 '16 at 17:18

If you're talking about pure speed, C will get you there if you really know C and operating systems, etc. C++ is nicer in terms of user friendliness, and won't be much slower. I don't know much about VB but I don't see many benefits.

Please clarify at least generally what the AI program is about. It is extremely difficult to answer the generalized question "What programming language is best for AI"? if you know what I mean. ( I vote python :^] )

To add: Any programming language of those listed is "stable" if you write things correctly, but C++ and its great IDE's will help you to that point much more nicely than C will. C, to fully utilize it's potential, requires much fiddling with delicate and precise systems. It'll go that little bit faster, as the cost of being less stable in the practical, " uh oh, now I need to troubleshoot this" sense.

  • $\begingroup$ Thank you, well, first, it's just an start for me, I have experience in web based programing and scripting using .net and php, now I like to step up and try something new :) To answer ur question, it shouldn't be a gaming AI and not a Robot (Maybe in future), I would like to create a self teaching program which can learn with it's daily jobs and mistakes. I already did a bit of research about all this and I want to start a project now. $\endgroup$ – Sinf Sep 8 '16 at 8:22
  • $\begingroup$ May I ask why u or most of people vote Python as a AI programming language ? And not a .net language ? What is the real different between those programming languages for AI programming ? $\endgroup$ – Sinf Sep 8 '16 at 9:14
  • $\begingroup$ Python is brilliant for its simplicity and ease of use. Even if you've never used python before, you can just go to the online tutorial the dev's put out and be sufficiently literate in a few hours. Any other problems you run into can be quickly found online. The reason it's so great for AI is that this simplicity and 'batteries included' mentality mean that it's waaaaay quicker and easier to write code relative to C++. Great libraries, great plotting, etc. Check this vid series out, I think you'll be convinced by the end of it: $\endgroup$ – Avik Mohan Sep 8 '16 at 15:07
  • $\begingroup$ Another big advantage Python has is the numpy and scipy libraries. You can describe your algorithm in Python, but then the actual number crunching is done by a backend written in C or Fortran. If it wasn't for that, it'd probably be too slow to do any serious work, but this way, you (mostly) get the best of both worlds. $\endgroup$ – Ray Sep 8 '16 at 18:59
  • $\begingroup$ So basically, Python is much easier and faster in programming then .net (which i'm agree with after my search about Python yesterday :D), just another question if u have experience with Python, is that possible to easily create visual programs like what we do in C++ by adding a windows forms application ? because as I saw, u have to run a Python program using command line ! $\endgroup$ – Sinf Sep 9 '16 at 8:03

In the Visual Studio, there is no real difference between C and C++. It is compiled with the same compiler binary, although with different flags.

In most cases, the easily programmable complex data structures are generally more important, as the linear speed. The AI is an exception. AI has mostly not so complex data structures, and also the linear speed improvement is very important.

It closes out the garbage collected languages, i.e. any managed code, and, in my opinion, the best solution would be if you would use not a .net-based language, but a directly to asm compilable one.

But, knowing that you are asking explicitly for a .net one, I would suggest one, which can be easily ported later to machine code. It closes out C# and VB, but it doesn't close out C++.

C++ has also the needed complex data structures, while it still has the near-asm speed (and memory need).

My idea would be to start with unmanaged C++ in .net, but use simply, native .exe-s to your final programs. It would make also possible to make your program portable, because C++ is for everywhere, while .net only for windows. I.e. your program will be later able to run in non-windows server (or cluster) environment, too.

It would be also important to prefer the deeply parallel or easily parallelizable algorithms. Ideally it should be made adaptable to slow communication channels (also for the parallel cluster run).


Your program will probably have some user interface, persistent database and similar things, these aren't speed and memory critical things, thus these you can implement in anything as you wish. The result will be a two-process solution, where a speed-optimized, C++ calculating daemon is controlled by essentially a GUI (or db.. or script.. or anything) interface.

Probably there are already C++ frameworks for this task, so you don't need to reinvent the wheel.

  • $\begingroup$ May I ask why u said, don't use .net for AI programming ? $\endgroup$ – Sinf Sep 9 '16 at 7:55
  • $\begingroup$ Excellent review, C++ is a just as competent for AI as any other language. The only problem is that it doesn't have as many libraries for scientific computing as lets say Python, Java or Lua. $\endgroup$ – Seth Simba Jan 19 '18 at 7:36
  • $\begingroup$ @Soheyl Mainly yes, but I also explained, how should you use .net if you really want to. $\endgroup$ – peterh - Reinstate Monica Jan 19 '18 at 9:43

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