Pregunta

I currently work for a company who builds web applications for businesses and entrepreneurs, typically 4-6 projects per year. We currently use Laravel/PHP which allows us to build apps relatively quickly with reasonable scalability, maintainability, security, etc.

I dislike PHP as a language and since I have a strong influence on the direction of the company, I've made it clear to my boss that we should eventually move away from PHP on new projects and adopt a better language/framework (which he has agreed to).

My suggestion was ASP.NET Core which my boss was OK with. I started developing our latest project on the platform but after a week and a couple of hurdles that were slowing down development, I decided to go back to PHP in order to make deadlines.

I was following a fairly standard layered architecture in the .NET world (MVC, Service layer, Repository layer) which obviously adds time because each entity now requires several components for each layer (and multiple view models) where as Laravel you can just pass arbitrary data to the view and read arbitrary data from the request. We don't use any sort of service/repository layers and just work with the ORM at the controller level which works for our purpose.

My initial thought it to just dial back on the layered architecture (afterall, we don't even do that on PHP/Laravel), but my concern is that .NET Core is simply not suitable for rapid development due to the verbosity required by a statically typed language. It seems like Ruby/Rails, Python/Django, JS/Node are more suitable for rapid prototyping and you don't often hear (if ever) of ASP in that mix.

Is .NET ASP MVC core suitable for rapid development and prototyping? Is it feasible to build apps in .NET Core that don't follow a layered approach or will it quickly become unmanageable faster than something like one of the aforementioned languages/frameworks?

¿Fue útil?

Solución

Yes .Net Core although still very new, is suitable for rapid web development.

Caveat #1 : Asp.Net MVC/WebApi is the more mature technology. You may find it more compatible if you are doing lower level type operations.

Caveat #2 : You are always faster programming in the way you know.

It sounds to me like you were making too big a jump on a project with tight deadlines

which obviously adds time because each entity now requires several components for each layer (and multiple view models)

Normally you would only need a view model per view, and the time taken to write it would be a couple of minutes max

where as Laravel you can just pass arbitrary data to the view and read arbitrary data from the request

You can program this way in .net, but obviously you lose the strong type benefits, which lead to faster development and less bugs once you are used to them.

We don't use any sort of service/repository layers and just work with the ORM at the controller level which works for our purpose.

Again, you can go straight to the DB in your controllers in .net. It's not recommended.

I would say that its not so much the language which is causing your slow down, its trying to on board a whole chunk of best practices all at the same time.

Strong Typing, Separation of Layers, Dependency Injection, Unit and Integration Testing DO make you faster overall.

The extra typing isn't a problem once you are used to it, but the benefits only really become apparent when you are picking up bugs early due compile time checking and unit tests.

Start with a smaller, less important project and take it a step at a time.

Licenciado bajo: CC-BY-SA con atribución
scroll top