Disclaimer-mark
This is a user generated content for MyStory, a YourStory initiative to enable its community to contribute and have their voices heard. The views and writings here reflect that of the author and not of YourStory.
Disclaimer-mystory

PHP 7 vs dot net core: How to make the right choice

This article makes a humble attempt at bringing in a comparison between PHP 7 vs Dot Net Core. Let's dive in...

PHP 7 vs dot net core: How to make the right choice

Monday April 02, 2018,

7 min Read

It can sometimes be a challenge to find the right platform for your development project. This is probably why companies are plagued with the question on which one to choose - PHP or Dot Net. If you search online, you will find two camps. One supporting PHP, and other crying hoarsely on the benefits of the latter, which probably brings you to the question - PHP 7 or Dot Net Core?

image

This article makes a humble attempt at bringing in a comparison between the two, and hopefully, at the end of it, you will be able to make a choice.

PHP is short for Hypertext Preprocessor, earlier called Personal Home Page, hence the acronym. Originally created by Rasmus Lerdorf in 1994, it is more suitable for small business websites, independent software vendors, startups, billing and invoicing websites and CRM.

The .NET platform isn’t a single entity, but rather a set of platforms that are maintained independently, and probably owned by different teams. It has a compiled programming format with VB.NET C#/C# .NET F# Development languages. Visual Studio and Mono are the major development tools. ASP.NET is more suitable for Intranet, Enterprise level CRM, Enterprise level websites and ERP apps.

Scalability

PHP is scalable, and if the developer is proficient, then the process will be smooth and seamless.

Whether it is for deploying the best coding standards, or the necessity to use a solid framework to build a scalable application, you can trust ASP.NET.

Winner - PHP 7 & Dot Net Core.

Performance and Speed

Both performance and speed of a framework are complementary. It doesn’t matter which platform you are using, the time is taken by the browser to respond and the speed of communication between servers are connected.

PHP doesn’t have any limitations with speed as it works across various operating systems. It runs on Linux OS, and so has the chances of performing much better than other platforms. Also, it uses the LAMP stack.

The latest version of ASP.NET, the brand new MVC 6, works on all the three platforms – Linux, Windows, and Mac. So, the limitations that the framework had in the past are easily countered. The support of database systems like MySQL, No SQL DB, PostgreSQL, Oracle, etc. along with their rich libraries is a powerful reason why you should support Dot Net Core.

Winner: PHP

Cost

PHP is open source and hence, free to use. Additionally, PostgreSQL server MySQL server, Apache server, and Linux OS are also free. You can make free upgrades whenever needed. You don’t have to sell dollars to have another server as a backup, for load balancing, or for having multiple servers for clustering.

ASP is free, but that’s all. You have purchased the Windows OS, pay the licensing fee for Microsoft Windows Server, Microsoft SQL Server and later, to make upgrades. For example, Microsoft SQL Server 2014 Standard Edition (For Small Business) would cost approximately $3,226.

Winner: PHP

Usage Factor

While developing applications, it would good to determine who the end user would be. PHP is perfect for client facing web solutions. And it is a good solution for building applications that have strong functionalities and look good at the same time.

ASP.NET is a little tough because it gives more importance to security and functionalities. End-user requirements come second only.

On a side note, ASP.NET MVC 6 supports OAuth2-JWT-OPENID Connect, HMAC-JWT (Preferred standard for Web 2.0) the latest security protocol, which will work along with AD/LDAP. Also, we can have our own authentication and authorization system.

Winner: ASP.NET, if the security feature is more crucial

On the Job Front

There are plenty of jobs for an experienced PHP programmer. Companies are always looking for one. A freelance programmer would definitely benefit from this.

It is not that a Dot Net programmer will be out of a job, but the options for the other are definitely more. However, the skill requirements for a Dot Net programmer are definitely higher, because the requirements would always be for more than web development or system scripting.

Since Microsoft has brought in a new framework, those who are already in MS technology (bigger and smaller clients) will slowly move on to .NET Core. This will bring more jobs to the market. Any freelance programmer can get into Microsoft technology, especially ASP.NET MVC 6 because it is free and the IDE, VSCode (Visual Studio Code) is free and it can be hosted anywhere.

The developer life will be easier with ASP.NET MVC 6 as they need not worry about IOC containers (Dependency Injection), Logging mechanism, Authentication, and Authorisation mechanism. ASP.NET MVC 6 comes with EF Core (ORM) and it also supports Micro ORMs like Dapper (preferable for Microservices) from StackOverflow, NHibernate, ORMLite, etc.

Winner: ASP.NET MVC 6 has an edge here.

Learning Curve

PHP is very easy to learn, and every beginner can easily feel his way around. The documentation and syntax are simple and rookie coders can easily follow them. PHP uses C like syntax, so people who are familiar with C, can easily learn and work in PHP. It also provides plenty of functional modules such as PDF converter, File type converter, Graph, etc., which will help developers to do their task quickly.

The syntax for Dot net is similar to that of Java. So, developers who are already aware of Java and C# will find it easy to design and to write projects.

Winner: Both 

Suitable for mobile devices and business

PHP’s latest version, PHP 7 has several updated features that would contribute to providing a better user experience. Additionally, PHP 7 offers reduced memory usage and execution engine improvements. These features are suitable for mobile devices that have limited browsing features. E-commerce giant, Etsy's adoption of HHVM to run its PHP applications is a good example of its computing ability to handle millions of requests without consuming too much power.

Support

Developers need a huge community of developers that respond expertly, accurately and within the shortest time possible. In PHP, the response could be faster because developers constantly post to the innumerable support forums.

ASP.NET also has a huge pool of developers, but it is not as big as PHP.

Winner: Both are excellent, but the number of support contributors could be lower in ASP.NET.

In the end: the verdict

There is a large number of MVC frameworks built on PHP, so we need to pick the right one. It may be a difficult choice, but you’ll have to look for well-experienced architects and solution architects support on this front. If you’re planning for enterprise solutions, MVC pattern may not be the best choice. You may need to think about cloud pattern like (CQRS, Event Sourcing, and Domain Driven Design) and many other architectural patterns like MVP, MVVM, etc., especially in the era of Microservices, Serverless Computing and Cloud.

In ASP.NET MVC 6, you can plan the CRM and API by using the same code base (Controllers, Models). You just need to prefix “api/” in the URL, while calling the APIs. ASP.NET MVC 6 is component driven so it helps a lot in the reusability aspect. Newly added Tag helpers help to maintain clean DOM (minimize polluting) like Angular.

The better comparison would be between MVC 6 and PHP 7. The rest of the technologies are common JavaScript, JQuery, Angular JS 2.x/4.x/5.x, React, Vue.js (if we are looking 100% decoupled Presentation Layer), CSS 3, bootstrap 3/4, many other frameworks are common for both. MVC 6 and PHP 7 are not 100% decoupled.

Every technology has its own space in the tech world. Those who are optimistic and keen on business growth will go behind the 7 Software “-ilities”:

1. Usability

2. Maintainability (or Flexibility / Testability)

3. Scalability

4. Availability (or Reliability)

5. Extensibility

6. Security

7. Portability

To conclude, here are our suggestions.

How to Make the Right Choice? Ultimately, it would all depend on the requirement and scope of business.

Which Should You Use for Your Next Project? This choice will depend on the size of the project, and your requirement. MVC 6 is the right choice for small to medium-sized projects. For e-commerce and shopping cart, PHP 7 would be a better choice.