8 ms·
Is it as good as rails? When I run a rails new command, I can setup my postgres connection, nodejs and webpack libraries, rails core library in one command. Rai
by KurtMueller 6y ago
Is it as good as rails? When I run a rails new command, I can setup my postgres connection, nodejs and webpack libraries, rails core library in one command. Rails has database migrations with conventions i like - the timestamp and a file name that represents the action to be performed against the database (e.g. AddNameToBlogs) which that can also be rolled back.
I also really like the Rails restful router which is strongly tied to its controllers.
I could go on. I really like that Rails gives me strong, opinionated conventions but also allows me to configure things to be liking if needed.
I want to love .net core - I really like F#. Any other rails dev out there make the transition to .net core?
- zamalek 6y agoI had about a month of experience with Rails many years back (hobbyist), and have used ASP.Net Core extensively (professionally). The default web template is far more spartan than what Rails provides out of the box. The workflow you're talking about can be done by installing packages and configuration (5-10min maximum for experienced .Net developers), and I'd wager good money on such a workflow being available as a "dotnet new" template.
- manigandham 6y agoI wouldn't rely on "setup everything in 1 command" as indicative of platform quality but .NET does come with the CLI and the unmatched Visual Studio, both of which have plenty of templates and tooling to get you started quickly. Everything you mentioned can be done with some packages and a few lines of code, and the entire framework does have some opinionated conventions but with much more freedom than Rails. The fact that you can have MVC, Razor Pages, raw controllers, and Blazor all in the same app shows just how much freedom you have.
- KurtMueller 6y agoThat freedom is/was overwhelming for me. With Rails, you can choose the relational database and the frontend libraries you want to use - that's really about it. There's a default path I can take if I want to get up and running quickly - it comes with strong opinions and sane set of defaults. I think Microsoft is moving in the right direction though. Scott Hanselman has some .net core 101 videos out on Youtube that are good to get up and running.
- mkarklins 6y agoYes, I recently transitioned to net core. First of I'd say that trying to find a 1:1 feature/convention parity between the frameworks won't work. E.g. in aspnetcore you'll add an attribute to model and after generating a new migration the column change will already be in-place. Most of the time it works out-of-the-box, you can always edit the migration if needed What I found lacking (at the time) was specifically a better Webpack integration, similar to rails. Also I got used to having rspec, in net core world you have xUnit which is something like ruby TestUnit. At the start I also found DependencyInjection a bit confusing and also the fact that in Aspnetcore the models/entities aren't like AR models where you have a bunch of validation/instance methods inside it. In .net you try to separate everything in repositories/validators/viewModels. But yes, unlike Rails, .net won't have an opinionated way on how to do things. All-in-all I'm quite satisfied with the experience. Though I will say that Rails is still a tad more "batteries included" type of thing.
- pjmlp 6y agoIs Rails as fast as .NET?
- ddek 6y agoTechempower says no, and it’s not even close.
- pjmlp 6y agoThat was my point.
- KurtMueller 6y agoI guess I'm being selfish as a developer and thinking about my own ergonomics and dev experience. Is Rails as fast as .NET? Probably not, but if it can serve web pages in under 200ms, it's fast enough.
- borland 6y agoAgree, and I wouldn’t trade rails for a perf boost if I had to go to a horrible Java web stack (or a horrible C# web stack prior to .NET core) Right now though, the dev ergonomics and productivity of .NET core are not actually very far behind rails at all, so you can serve your pages in 2ms instead of 200ms without suffering for it. In some regards actually, perf helps a lot. Running a large bank of tests for example - those are going to complete a LOT more quickly in .NET which means you can iterate faster and have a better dev experience
- nullsense 6y ago>I want to love .net core - I really like F#. Any other rails dev out there make the transition to .net core? They're worlds apart. Rails is optimized for day 1, .net core is optimized for day 1000.
- davidgl 6y agoThis 1000%. I'm both an ex-ruby dev, and a current C# / F# guy. Ruby is great for throwing things together and installing a load of functionality through Gems. It's 3 years later when your trying to maintain and refactor that it all comes back to bite. RubyMine does help so you can at least do rename refactorings most of the time.
- dragonwriter 6y ago> Rails is optimized for day 1, .net core is optimized for day 1000. Sure, that’s a standard argument for statically-typed kitchen-sink enterprise-marketed languages and platforms like Java/JVM and C#/.NET. But having come in to maintain things on day 1000 (or, in some cases 5000) for projects in such languages and, also, languages that are far less strict and have less features designed to require/support tooling, it's not been my experience that there's really that much of an advantage in practice.
- nullsense 6y agoSadly, that's been my experience too.
- borland 6y agoI’m an ex rails dev (from about 2010, so a while back, but still) ASP.NET MVC (which is now ASP.NET Core) is a fairly carbon copy ripoff of what rails was back then. Initially I was annoyed about this; there were efforts to run Ruby on .NET via IronRuby and thus get a nice rails-on-windows environment, and ASP.NET MVC came along and sucked all the wind out of that like a tent collapsing. Controllers, Views, Routing are all the same, and like rails can be reconfigured if you prefer. Later on though, I’m happy with it. A new blank project doesn’t quite have all that stuff, but you can add the postgres driver, migrations, etc with a few lines of code. You do lose out on all the more advanced Ruby meta-magic things that rails does like with_scope on ActiveRecord, but in exchange you get a 1000x performance boost, and static typing - especially now with null safety in C#8 is really helpful as your codebase grows. The productivity hit you take compared to rails is actually pretty minimal I think, and those other benefits outweigh that and some. I would chose ASP.NET core over rails for any web project at any time these days Good luck!
- pjmlp 6y agoRails 1.0 was pretty much a fairly carbon copy of stuff like AOLServer, Zope and similar stacks. I never got the point of Active Record amazement, having used similar teach like 5 years before Rails happened, we just weren't on Silicon Valley.