PHP, Java or ASP?

Você pode ler este post em português também.

Recently a friend asked me about PHP. What you will read here is the reply that I sent to him.

=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
Each language has its good and bad sides. It depends of “where” you will use them, and ’cause this I make the comparison as web developer. And I will do it comparing the ASP (not ASP.NET), PHP and Java languages.

The factors that I use to make a choice of a language are:

  • Typing (weak, strong or dynamic. The most common is the requirement to declare a variable / type to use it);
  • Portability (how it can run in heterogeneous environments);
  • Scalability (how difficult is to increase / improve the environment for running the application);
  • Development tools (What exists to improve the development experience);
  • Readability (the learning curve of its syntax);
  • OOP compliance (as provided by the OO pattern);
  • Bureaucracy (How much you’re MUST to follow to use it).

Based on the topics above:

  1. Typing: PHP and ASP have weak typing. Java has strong typing. PHP/ASP therefore tends to give more freedom to develop. Java to be more orthodox, it’s more organized. As I prefer the freedom, point to the PHP and ASP.
  2. Portability: Point to PHP. For web applications, it supports more environments than Java. And if none of available binaries work for you, you can download the source code of PHP and recompile it on the freak environment that you’re building. ASP here, joke.
  3. Scalability: Here, less is more. Less work to scale an application, turns it to be better to scale. Ignoring the design pattern factors that should be followed to allow rise the environment, I think that PHP is the best. Unfortunately I have no facts to prove it. So, point to the three languages.
  4. Development tools: Point to PHP. This language has almost everything that you can imagine to help or give base for development: the Internet there are giants repositories of projects/classes/functions where you can get almost everything for not to start from scratch.
  5. Readability: Point to PHP. As a language with weak typing and low bureaucracy, the learning curve of the language is very low. There are several kits on the Internet ready to start developing, and indeed, many of them don’t need to be installed (running directly from a pendrive, by example). ASP in the second, and because of its complexity/bureaucracy, Java last.
  6. OO compliance: Point to Java, with PHP closest to him (especially after the new version 5.3, which support namespaces and other cool things). And yes, PHP is OO (1). ASP isn’t. Just to compare, namespaces are like packages in Java.
  7. Bureaucracy: Point to PHP. Mainly due to the items 1), 5) and 6). I say that PHP is like Delphi, which provides many OO resources, but without forcing you to use them. Java is highly bureaucratic. Search for examples on Google and you will see that the difference is obvious.

This is an excellent theme for a bar table. There are several other factors, like as maintainability, robustness, reuse, development speed. But is subject for another post.

Adding the score:
a) PHP = 6 points;
a) ASP = 2 points;
a) Java = 2 points.

Done. PHP is better. I swear that I tried to be impartial.

😉

=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*

References:

(1) – OOP manual at PHP site.

About Adriano Laranjeira

Software engineer & developer See more at http://about.me/arglbr
This entry was posted in English and tagged . Bookmark the permalink.

1 Response to PHP, Java or ASP?

  1. Pingback: Adriano Laranjeira » Blog Archive » PHP, Java ou ASP?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s