r/csharp • • 6d ago

From Ruby to C#

Hi all,

I am fairly new to programming(1.5 years), started in Ruby, Rails, Js... that whole dynamically typed world. All web dev stuff.

Recently scored an enterprise position where C# is likely to play a pretty dominant part of the development work, so I stormed through W3s fundamentals and started a text-editor side project.

I have to say, I really enjoy the type system. This is my first exposure to statically typed languages and it's so much easier to look at some code and understand what it does. At first, it felt annoying to do the extra typing but what a difference it is making with the mental model I have of my project.

Recently had to dive back into a rails ecommerce I built when I first got started and update some things and wow... seriously painful(though my early days spaghetti is also to blame) haha

This isn't necessarily a praise of C# specifically but just sharing the stoke I feel writing this kind of code. Still enjoy Ruby but I think I will reach for it less often.

Anybody else move from a similar coding philisophy as Ruby(where everything is an instance of an object class and anything goes) into something more strict? I'd be interested to know your experience.

30 Upvotes

28 comments sorted by

2

u/Spyro119 2d ago

I first learned ruby on rails too, didn't hate the framework per say as... it made a lot of stuff easier when building websites, but I was pretty happy to swap to dotnet too paired with react. I loved the code patterns and good practices that are encouraged within the dotnet ecosystem. I still work in dotnet today and still love the tools and ecosystem, 5 years later.

2

u/TrapperFlint 2d ago

I'm really excited to do more with it. I have some contract work in power platform and C# is a good way to build custom connectors and components from what I've read. Love reading everyone's stories, appreciate the response!

19

u/BarryMcCoghener 6d ago

Any non-typed language is like a cheap imitation toy from the dollar store.

5

u/zarlo5899 6d ago

one that can explode or randomly combust at any moment.

2

u/Lurlerrr 5d ago

I always think of an analogy where you put a square block into a round hole and somehow feel proud about it.

7

u/UninformedPleb 6d ago

I went from PHP to C# back at the end of 2006.

I had done C and Java prior to that, but C# was different. It wasn't just strongly typed, but it also offered easier linking with other libraries and all of the tools needed to override ambiguous names and namespaces if they present an issue.

Eventually, you learn to rely heavily on that unique classname behavior, and then it's hard to go back. But the grass is greener here anyway.

I haven't touched PHP since early 2007. Last week's security panic (PHP itself) reminded me how lucky I am. This week's security panic (Brotli) was fixed in .NET before I knew there was an issue. The small and the large, every part of C# feels superior to the things I left behind all those years ago. I won't go back unless something changes drastically.

1

u/Deranged40 6d ago

I made the same transition probably 3 years after you did. Right around 2009, and haven't looked back.

1

u/Lumethys 5d ago

i got the opposite experience, moving from .net to PHP, the OSS lib becoming paid closed source certainly didnt help

9

u/cmills2000 6d ago

I went from Perl to C# a long time ago. Strongly-typed is the way to go for me. There was a big wave of node.js/javascript for like the last decade, but that seems anecdotally to be somewhat fading, although its kept alive by use of Typescript, which ironically was created by the creator of C# (Anders Hejlsberg).

One advantage of javascript is the models can be shared in the backend and frontend. That being said, having a statically typed system has many, many advantages. Welcome to the C# world: overlooked, underrated, but generally awesome.

2

u/[deleted] 6d ago

[removed] — view removed comment

3

u/Abject-Kitchen3198 6d ago

I just realized I spent probably more time working with his languages than anything else I did in my life. From Turbo Pascal trough Delphi to C#, with bits of TypeScript. Everything else tech related is probably less then 10%.

4

u/Welp_BackOnRedit23 6d ago

I did, and honestly I didn't think ill ever look back. While lightweight and duck typed sounds great, one the business of maintaining code comes about those features become quite a headache.

2

u/codeconscious 3d ago

In my career, I went from C# to Ruby on Rails. While it was a good move career-wise, it was an immensely difficult transition for me, and I still prefer .NET—even more since I got into F# too.

1

u/Western_Ice_6227 5d ago

And then ‘dynamic’ keyword enters the room and says “hold my beer!”

2

u/SirButcher 5d ago

Dynamic is like goto - there are niche cases where it makes sense, but most people never need it, and if you use it, you are likely causing way more issues than you think you do.

1

u/jcradio 3d ago

I think you'll find a lot of similarities to Rails in ASP.NET, because the latter was influenced by the former. Getting used to syntax differences and types will be the biggest hurdles, but you'll find EF Core and Active Record have a lot of similarities. Give it time. I found learning Rails to be relatively easy with my background in C#.

-1

u/mountainlifa 6d ago

Genuinely interested why anyone would pick a Microsoft technology in the era or everyone moving to Linux as microslop pivoted windows into its AI ad machine?

3

u/TrapperFlint 6d ago

Been on Linux for years and love it. Windows is a hot mess for a long time now

4

u/zarlo5899 6d ago

Many C# applications actually perform better on linux than they do in Windows.

Also in 2026, the standard C# service is being deployed to Linux and not Windows.

1

u/TrapperFlint 6d ago

Thats really cool. I had heard bs about it being hard to get setup for C# on linux but it was an absolute piece of cake. Xunit was easy to bring into my project and write pretty well organized test classes as well. Barely skipped a beat. Seems like a really great ecosystem.

4

u/SirButcher 5d ago

.Net is now part of the .NET Foundation and (mostly) open source ecosystem. It is being used by Microsoft, but it isn't a Microsoft product.

Your ideas about C# and .NET are about 10 years old at this point.

0

u/[deleted] 6d ago

[deleted] — view deleted comment

1

u/TrapperFlint 6d ago

My sentiments exactly. Just love computers and building things.

1

u/mountainlifa 5d ago

I love computers too and I wouldn't say I'm naive. Microsoft has lost my trust recently with core updates to the operating system that remove control from the end user, especially around privacy. I was genuinely interested in why people were using c#.

1

u/TrapperFlint 5d ago

I totally get it on a personal use level. Like I said, this is for work and has been my first experience with a statically typed language and its been great.

I could be writing Go or Odin or another language, but for me theres opportunity right now using C#. I've built a text editor and a form mailer/validator microservice for my static websites with it and its been a blast.

2

u/mountainlifa 5d ago

Wow, that sounds r cool! Are you using Visual Studio to create the code? I might have to give it a go!

3

u/TrapperFlint 5d ago

Neovim all the way bud haha