Hi guys,
I know some ruby language. Now I need do some .net development. I don't want to learn a new language. So, after googling I got IronRuby. Now my question is Can I use IronRuby to write all apps that c# can write?
Thanks.
Hi guys,
I know some ruby language. Now I need do some .net development. I don't want to learn a new language. So, after googling I got IronRuby. Now my question is Can I use IronRuby to write all apps that c# can write?
Thanks.
Yes, you can use IronRuby to write Apps, but with Ruby the support and online community will not be as matured as C# is. So, you would find it a bit easier if you learn C# and write applications. This is my personal opinion.
IronRuby is just one more implementation language that Ruby has besides C, Java etc., This does not mean that you can do coding in C#. You will be coding only in Ruby language and you can enjoy all its pros and deal with it cons.
So, the answer to your question is, whether you use IronRuby or JRuby or (C)Ruby does not really matter.
Broadly speaking, I believe you should be able to do almost anything you can do in C#. However, there may be some areas where C# makes things easier for you - the framework was certainly designed with statically typed languages in mind.
One area which does raise a spectre is LINQ. I don't know whether IronRuby supports expression trees at all directly. You could create them manually of course, but that would be a pretty poor experience. Likewise I don't know what IronRuby would do about inferring the relevant delegate types for LINQ to Objects etc.
Don't be too afraid of learning a language: it's an experience which can broaden the mind significantly. Given that you're already going to have to learn the .NET framework to at least some extent, you might as well learn the language which most of the examples of the framework are written in. If this is a reasonably large project, I suspect that overall you'll save time - and, of course, have a broader knowledge as a result.
Another thing to consider is who's going to maintain the code base. You haven't said why you need to do this development - but if it's for a professional reason, presumably you'll either have colleagues or have to hand the code over to someone in the long run. Find out what their preference is.
I think what you really want to be asking here is one of two things:
Can I use IronRuby to interface with existing .NET and .NET-based libraries, interacting as a C#-language program would?
The answer is yes, well, mostly. The primary section you will not be able to do directly is to interface Win32 API calls directly in the same way C# does with P/Invoke. P/Invoke is basically to C# what FFI is to Ruby. If you don't don't care about that, great.
Can I write any algorithm/structure/construct/etc. in the language Ruby that I can in the language C#?
This is the more literal interpretation of the actual wording of your question, but I don't think it's what you meant to ask, as the answer is more nebulous without getting into some pretty heavy theory. So, we'll just say 'sure'.
The general answer to your question is yes - everything you can do in C# you can do in IronRuby and vice versa. However, every language has its own advantages and disadvantages... for example, Ruby has awesome metaprogramming capabilities that C# can only dream of. On the other hand, C# has LINQ.
Regarding the community, I don't think there is much of a difference. With IronRuby you get the Ruby community and the IronRuby community. With C# you get the .NET community and MSDN...
Choosing a programming language is kind of a religious question... what would you go with - Christianity, Judaism or Islam? only you can tell... :-)
If you already know ruby and want to use .NET then IronRuby is great. But to learn .NET using IronRuby without knowing C# might be challenging. As Bragboy has pointed out, the IronRuby support and online community will not be as matured as C#. For example MSDN .NET documentation gives example code in C# but not in IronRuby. So it can help to know C# when looking at .NET documentation.