WowKhmer Tech

Samnang Chhun - Gravatar

About the author: Samnang Chhun. I develop software for my living and hobby. I feel blessed to have been able to enter a profession that I love. I love being able to share my enthusiasm and knowledge with other guys.

.NET Coder should give Ruby a try!

Last weekend, I gave Ruby a try. Ruby is a dynamic, open source programming language with a focus on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write. I’m a .NET coder, everyday I use C# for developing projects in my company. There are few reasons that bring me to try Ruby because I see a lot programmers mention Ruby is a very powerful and flexible programming language, is it true? And the main reason, I would like to try something new because almost my programming skills are just in static typed language and a bit dynamic typed language with Javascript.

After I played with Ruby about a few hours, I started loving it. Ruby is a fun toy. Like the differences between spoken languages, Ruby differs from most other programming languages not only by syntax, but by culture, grammar, and customs. And some programmers consider Ruby is English for computers. Ruby brings a new way of thinking about programming and software development. I would like to show you very basic examples, let’s go to see snippet code comparing between C# and Ruby.

//Swap value between two variables
int a = 5, b = 10;
int temp = a;
a = b;
b = temp;

//Output message 3 times
for(int i = 0; i <= 3; i++)
 Console.WriteLine("Hello");

//Output message if condition is true string
str = string.Empty;
if(str == string.Empty)
 Console.WriteLine("str is empty");
#Swap value between two variables
a, b = 5, 10
a, b = b, a

#Output message 3 times
3.times { puts "Hello" }

#Output message if condition is true
str = ''
puts "str is empty" if str.empty?

Code comparisons above are not to show which language is bad and another is good, but I just want to show how I feel about new language. Ruby code is short and readable like in English. There are lots of more powerful features in Ruby that I haven’t mentioned here.

If you haven’t touched something new recently, why don’t you give Ruby a try?

http://tech.wowkhmer.com/wp-content/plugins/sociofluid/images/digg_48.png http://tech.wowkhmer.com/wp-content/plugins/sociofluid/images/dzone_48.png http://tech.wowkhmer.com/wp-content/plugins/sociofluid/images/delicious_48.png http://tech.wowkhmer.com/wp-content/plugins/sociofluid/images/technorati_48.png http://tech.wowkhmer.com/wp-content/plugins/sociofluid/images/facebook_48.png http://tech.wowkhmer.com/wp-content/plugins/sociofluid/images/twitter_48.png

3 people have left comments

.NET Coder should give Ruby a try!-WowKhmer Tech BEC Development Blog - Gravatar

.NET Coder should give Ruby a try!-WowKhmer Tech BEC Development Blog said:

[...] original post here: .NET Coder should give Ruby a try!-WowKhmer Tech Posted in Object, software. Tags: anti-virus, archives, clipboard, home, khmer-tech, net, orm, [...]

Posted on: August 10, 2009 at 12:01 pmQuote this Comment
Frankie - Gravatar

Frankie said:

Hello! Please e-mail me your contacts. I have a question zachary@complective.ru” rel=”nofollow”>……

Thanks!…

Posted on: June 12, 2010 at 2:16 amQuote this Comment
HECTOR - Gravatar

HECTOR said:


PillSpot.org. Canadian Health&Care.Best quality drugs.No prescription online pharmacy.Special Internet Prices. High quality pills. Buy drugs online

Buy:Cialis Professional.Soma.Viagra Super Force.Levitra.Cialis Super Active+.Viagra Professional.Super Active ED Pack.Cialis.Viagra Super Active+.Propecia.Viagra.Tramadol.VPXL.Zithromax.Cialis Soft Tabs.Viagra Soft Tabs.Maxaman….

Posted on: July 4, 2010 at 11:02 amQuote this Comment

Leave a Comment-

Comment Guidelines: Basic XHTML is allowed (a href, strong, em, code). All line breaks and paragraphs are automatically generated. Off-topic or inappropriate comments will be edited or deleted. Email addresses will never be published. Keep it PG-13 people!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

All fields marked with "*" are required.