10-11-2010 10:57 AM
I'm trying to form a view on C# / .NET. There is the current version .NET4 shipped together with Visual Studio 2010. I don't know if it is the right decision to count on it for bigger projects. I read many prefaces in different books about C# and they are nearly the same but none mentioned any progress in stability or performance. Is .Net really that fast and stable that it didn't need to get fixed or optimized?
What about long-term stability?
Pros and cons?
What about performance?
Why not use CVI or C++ (without .Net) instead of C#?
Is it worth the time to dig into C#?
Any positive or negative experience, happiness, frustrations?
Isn't C# just a temporary fashion and will be gone in a view years?
Thanks for your opinions 🙂
Peter
10-12-2010 03:47 AM
Hi,
We are using Measurement Studio.NET (C#) already since 4 years for our projects. We are doing SW system test for automotive products with test bench based on NI technology. We also write a tool to make test designs inside VS and generate automatic Mostly we are using the DAQmx driver under Measurement Studio. We are also using MesurementStudio controls in forms. Since we started we have worked with VS2005, VS2008 and VS2010 + all corresponding .NET Framework.
To your questions:
What about long-term stability?
We work since 4 years with C# and until now we had no problem with the stability. By upgrading to newer version of the .NET Framework we never had a problem. I would tell each newer version comes with new idea how to improve our automatisimation and become more effective (LINQ to object for example was a major improvement). Of course you can never tell what it will be in the future but I am not expecting bad surprise concerning the future version of .NET. C# is more and more used in the software industrie to write software. In my opinion, it is not a passing mood. I doesn't appens often but it think this time Microsoft has done really good job.
Pros and cons?
Pro:
- I have access to the full power of a object oriented strong typed language (C#) and the full functionalities of .NET 4.0 (which coverage is impressive).
- Powerfull language with a power full development tool (VisualStudio): Intellisense, good debugger
- You can wrap all device driver in a library to use it at demand (automatisation)
- all you can do in Labview with DAQmx, you can do it in MeasurementStdio
- there is a lot of samples in .NET from NI
- If you have the programming skill, it allows you to make scalabe, modular, evolving applications
- You can use a software configuration management tool like Subversion to take trace of you changes
- C#-code to execute is REALLY quicker than calling function in LabVIEW or Teststand
- there is a lot of resources, forums in the internet
- mostly all know tools have an .NET API
- because you do everything, you know everything and can change what you want.
- C# is easy to lean - if the people like programming. And it is a JOY to program with it.
Cons:
- You need good knowledge and experience in programming, in particular in C#
- VS is not open source (cost money)
- You are not OS-platform independant (only windows). Or you can use Mono but I have no experience in it
- If you are runinning long-time test (the same test runs several days) you have to take care of the memory management. There is some programming rules to know to avoid to create to much instances of a class.
- depending on what you want to do, you have to program yourself something which exists in other commercial tools since years.
- If you have some really specifical question about how to do something with MeasurementStudio, it could become difficult to get an usefull answer from the NI Support.
Why not use CVI or C++ (without .Net) instead of C#?
When you program with C#, you have no to think about "Destructor" or "Out of boundary"-problems. C++ is really really powerfull and quick and you can do everything you want. But with C# also because of the managed classes .NET is bringing, you can concentrate on the problem you want to solve since thinking on which resources/memory you need to free. About CVI I have no experience.
Is it worth the time to dig into C#?
It is easy to start with C# - if you have already programming skills in object oriented languages. Else, the object oriented is not so easy to use the right way but this is the same with C++. You have to see what you need to do if you use C# and can you do the same with an existing commercial tool. What is the "plus" using C# in your project?
So it is difficult know to tell if it is worth without more informations about what you want to do. Generally I could tell: I you want to do something simple, use LAbview. If you need to handle with tables, data structures, file, timing or events: use C# (because handle and understand a VI from somebody else handling tables for example is not that easy in Labview)
Any positive or negative experience, happiness, frustrations?
If I had to do it again, I will without hesitation.
Isn't C# just a temporary fashion and will be gone in a view years?
I don't think so.
I hope my feedback can help you.
Regards,
Olivier Baillard
10-12-2010 04:33 AM
Wow! Thanks a lot! That sounds nice 🙂
Peter
10-12-2010 07:38 AM
Hi Peter,
we at NI Support aren´t involved much into C# programming (since we do LabVIEW and CVI most of the time).
So I´m sorry to say that you would have to consult the www or a experienced C#- person in order to answer your questions.
Marco Brauner NIG