none
Best .net Languge for algorithms RRS feed

  • Question

  • Is there one .net languge that is better suited for writing algorithms?

     

    Regards,

    Tuesday, February 26, 2008 1:14 PM

Answers

  • It depends on your needs but I know C# algorithm can be used with all .NET development if you use C++/CLI, what you can do gets restricted in most .NET develoment.

     

    Tuesday, February 26, 2008 8:41 PM
    Moderator

All replies

  • Hi,

    I think it is C++/CLI .
    Tuesday, February 26, 2008 1:26 PM
  • Thanks for the quick response.  Would that be managed or unmanaged?

     

    Regards,

     

    Tuesday, February 26, 2008 1:38 PM
  • Hi,

    As for me unmanaged C/C++ is the best choice for implementing difficult algorithms, but you ask me about .net languages, so the answer is managed C++.
    Tuesday, February 26, 2008 2:00 PM
  • Actually most of the known algorithms are implemented in C# and covered in the free book in the link below.

     

    http://www.brpreiss.com/books/opus6/html/page10.html

     

     

     

    Tuesday, February 26, 2008 8:03 PM
    Moderator
  • Thanks for that.  Based on the date of the copyright, the code must be from .net v1, is that correct?

    Tuesday, February 26, 2008 8:17 PM
  • That is correct and I think the size of the project does not let the frequent updates.

    Tuesday, February 26, 2008 8:30 PM
    Moderator
  • Caddre,

     

       Do you think that the C# algorithms are as fast as C++/CLI ones?

     

    Thanks

    Tuesday, February 26, 2008 8:35 PM
  • It depends on your needs but I know C# algorithm can be used with all .NET development if you use C++/CLI, what you can do gets restricted in most .NET develoment.

     

    Tuesday, February 26, 2008 8:41 PM
    Moderator
  • There is also a none free book for VB.NET published in 2005 rather small in size but you could check it out but I cannot tell you much because I only write C#.

     

    http://www.amazon.com/Structures-Algorithms-Using-Visual-Basic-NET/dp/0521547652

     

    Tuesday, February 26, 2008 8:51 PM
    Moderator
  • Ah...C# it is then.

     

    Tuesday, February 26, 2008 9:21 PM
  • It has to be Fortran.Net, right?  Just kidding.

    It really depends on what your algorithm is gona do.  Non managed C++, if written correctly, should out perform managed C++ and C#, but you have to pay the price for marshaling the data to and from managed memory to unmanaged memory.  So if the data the algorithm is going to very CPU heavy than it might be worth while to take that hit.  It then really depends on how much data you are going to marshal over.

    Managed C++ (C++/CLI) is good because you can just pin a managed array in managed memory and then do pointer magic with it like you can with regular C++ in global memory.

    Then again, if your algorithm isnt that heavy and/or there isnt a good way for it to take advantage of pointer arithmatic than writing it in C# would be just fine.

    So the questions I'd ask would be:
    What kind of algorithms are you looking at?
    What does your data look like?  make up of the data and how much there is.


    Tuesday, February 26, 2008 10:23 PM
  • Not sure what the algorithms are going to be yet.  I have a data analysis application written in VB 6 than I am in the process of converting over to C#.  I am using some .Net components from multiple vendors to do sorting and summarization but it is taking too long to execute. I was thinking about using DataSet tables to do the sorting, filtering and so on but then I will have to take hit for the overhead on DataSets.  My application is ad-hoc so the amount of rows runs from a few to >100K.

     

    Thanks

    Wednesday, February 27, 2008 12:41 AM