loading...

Which would be better for career: Laravel or .NET Core?

dgvai profile image Jalal Uddin ・1 min read

I have been a full-stack spider and been using LaravelPHP in back-end for almost 2 years. I also know .NET Framework to create WinForms earlier.

Now my university life is going to be ended soon within 1 year, and now I want to do some career oriented programming.

I did some google research between Laravel & .NET Core, I know which one faster which one is slower, I just want to know at the current market of the software industry which is more demanding?

Discussion

pic
Editor guide
Collapse
lanzorg profile image
lanzorg

If you want to be a fullstack developer and don't want to learn new stacks every 6 months, the only choice is .NET. Laravel is cool but it is focused on artisans and freelance, maybe startups, not really for long running businesses. Learn modern .NET and its ecosystem and tooling, WinForms was decent in the early 2000s, we are in 2020 now, SPA, WASM and hybrid apps are the norm now. Go learn Blazor, MAUI and ASP.NET with GraphQL and gRPC and you should be good for twenty or more years.

Collapse
theonlybeardedbeast profile image
TheOnlyBeardedBeast

I would go with .net core, one language many uses, I came from Laravel to .net core, very similar in many places, I wont go back, never.

Collapse
dgvai profile image
Jalal Uddin Author

Can I get some opinions from you brother, since you have used both of them?

  1. Does .NET uses clean code strategy/pattern like Laravel does?

  2. Does .NET have ORM like Eloquent ORM in laravel? So far I have known something like Entity framework, is it same one like Eloquent?

  3. Does .NET has DB migration builders like Laravel has, which will be compatible for any DB which I will define in config?

I would be pleased if you reply :) Thanks.

Collapse
lanzorg profile image
lanzorg

The webapi template of ASP.NET uses OpenAPI and the HATEOAS pattern by default now for really clean architecture, Laravel and Lumen don't and it's kinda a pain to do GraphQL or gRPC APIs. Laravel has recently created Jetstream for seamless frontend development but it's still pretty young. Furthermore, ASP.NET Blazor with SSR and WebAssembly is so productive and don't think we can do better.

The coolest stuffs in Eloquent are practically all built in the C# language itself. Migrations exist since the first ASP.NET releases. There are interactive CLI tools like Laravel too, but a lot of devs create them inside Visual Studio because managing thousands of models/entities and their relations is much easier graphically.

I think Taylor created Laravel because .NET was closed source and Symfony was too corporate for him, but now that .NET is fully open source... Moreover, VSCode that is FOSS has an amazing .NET support, most of the time better than the expensive PhpStorm + Laravel Idea combo for PHP/Laravel.

Thread Thread
dgvai profile image
Jalal Uddin Author

My day 2 of learning .NET Core,
*. I have been creating Models like a normal class and defining its props, then adding the repository and it's interface class, that's ok until you go into multiple model and you see code duplication.
*. I wanted to know, that, all models do have some default props like ID, created_at, updated_at and some CRUD ops, like create, find, update, delete, etc, and those I have to implement here (in my beginner case) manually by creating classes. Isn't there any NuGet Packages that does handle this ORM so it saves production time?

Thread Thread
theonlybeardedbeast profile image
TheOnlyBeardedBeast

crate a base class which has all these properties you need everywhere, then all the new models should extend this base class. You can create a base generic repository using generics. But basically the entity framework contains all these operations if you succesfully created a databasecontext, you can easily do all the things.

I created a snippet for you with these things: github.com/TheOnlyBeardedBeast/sni...

You just need to update the generic repository so it should be based on the BaseEntity class, and then you can add additional logic to the update methods (updating updatedAt property) or you can add a findById method

Collapse
theonlybeardedbeast profile image
TheOnlyBeardedBeast

I think lanzorg answered a lot, regarding to the migrations it is even easier for .neg you just change the model and call a cli command, it automatically generates migrations. Entity framework is amazing, really EZ to do complex queries. There are a lot of adapters for different databases to use width entity framework.

Collapse
tunaxor profile image
Angel D. Munoz

Learn what you feel attracted to, then move to the next stack and so on, I started on PHP, then moved to node and I'm now looking even more into dotnet, explore the ecosystems every ecosystem has solutions to problems, I saw you asked for stuff like orms, patterns, DB migrators and such
Yeah repodb, MVVM MVC etc, one thing I'd advice you would be to be open minded of the ecosystem you get into, don't expect to translate concepts 1-1, there are always differences and reasons for them, but I find that exciting every time I look into something new

Collapse
sven5 profile image
Sven Glöckner

I suggest go the .NET way. I've been working as a C#/.NET specialist for almost 15 years now.
At first, I started with VB6 and later switched to Visual Studio 2005 and .NET Framework 2.0 (The Beta Experience 😏).
What I really like about .NET: it is a large community with uncounted code samples, Nuget packages and extensions and tooling, etc. There are also many 3rd party library providers and vendors that makes your life easier. We're using DevExpress DevExtreme and Blazor widgets for our web apps.
I mean .NET is really a coherent environment. Visual Studio is mature and full of features, I like it.

You could get in touch with the .NET guys on GitHub. Not even is .NET backed by one of the largest software companies in the world it's also wide-spread. I mean, how many businesses are out there that use and rely on .NET?
I'm working as a contractor (or called freelancer) for over 10 years now. I only focus on C# and .NET - I've gone through all flavors of .NET: WinForms, Silverlight, WPF, ASP.NET, Compact Framework.
Currently, I use .NET Core and Blazor.

In addition, we're using the Azure platform for application lifecycle management (Azure DevOps) and also hosting our customer apps.
Did you know that you can deploy your new web app to Azure in only some minutes directly out of Visual Studio? This is hassle-free and really cool. 😏
Azure DevOps is the perfect environment for CI/CD I ever have dreamed about. We used to have TFS instances that were not running good enough, or even had no CI in the past. Sometimes, this was a nightmare with broken builds and so on.

I would say that I am most productive with .NET (Core).

Collapse
loftwah profile image
Dean W Lofts

.NET is going to give you better access to Microsoft houses and PHP is going to give you a huge percentage of the web. I chose PHP and don't regret it.

Collapse
lanzorg profile image
lanzorg

Maybe you should ask the Laravel's author why he dropped .NET for PHP too.

Collapse
dgvai profile image
Jalal Uddin Author

Taylor is a senior programmer and owns Laravel, indeed he would support PHP, on the other hand if I ask any senior .NET programmer who builds the .NET he would definiately support C#. So asking them directly might get biased answer, isn't it?

Collapse
ca0v profile image
Collapse
dgvai profile image
Jalal Uddin Author

On your stats, that you have suggested , PHP undoubtly wins, and since Laravel is very new as a framework of PHP, it has lower usage number. Where ASP.NET places second directly, since C# directly can't be used for web-stacks. And also the statistic, includes websites of 90s, 20s, but the suggestion I need, the most demanded one in 21s.

Thanks a lot for the statistics, it made be very proud to be a PHP dev :)

Collapse
ca0v profile image
Corey Alix

If you prefer PHP then pursue PHP. I worked in Java for a while and for whatever reason (Eclipse) did not enjoy it so I learned VB6 and then VB.NET and then C# and moved in that direction. I later got deep into large javascript projects and when typescript came out I was an early adopter because it was more fun. I am now looking closely at Svelte and Sapper. They are fun and so I will learn them and see where it goes. I will say that I really enjoy C# and .NET (no core experience) and think you could learn the basics in a couple weeks. The runtime is huge, though. PHP probably requires more discipline to build large projects but I do not actually know that to be true.