Report: PHP and Dart (Dan)
Contents
PHP
PHP, now known as PHP: Hypertext Preprocessor and originally standing for Personal Home Page, is a server-side scripting language created for web development. PHP is an open source HTML embedded scripting language created in 1994 by Rasmus Lerdorf. The syntax of PHP is similar to that of C or Perl due to the fact that Rasmus wrote Common Gateway Interface (CGI) Perl scripts to help maintain his own personal homepage in C. PHP can be directly embedded into HTML instead of being called from another file, and also includes command-line interface capabilities, and is compatible on almost every operating system and platform.
Requirements
While there are no requirements for PHP use in HTML source, the following are attributes/ addition requirements that are worth mentioning:
- Module web support
- example: Server Application Programming Interface (SAPI)
OR
- Non-Module web support
- example: Common Gateway Interface (CGI)
- web server is configured to use CGI executables of PHP
If being used for a command-line script:
- A command-line interface (CLI) executable is necessary
If being used for a graphical user interface:
- Must use the PHP-GTK extension for PHP
- Not included in official PHP distribution
- Must have PHP version 5.1.0 or newer
Pros
- Widely used server side script language
- Open source (it's free!)
- Can be written right into HTML source (no extended files necessary)
- Free support (and lots of it)
- Online manual is considered the best of any programming language
- Large body of built-in functions
- Extension repository for more built-in functions
- Works well with different operating systems with little change
- Works well with databases
- Simple to learn
Cons
- Generally looked to be less secure than Java
- Possible unreliability of information (due to large quantity)
- Lacks named parameters
- Lack of global variables makes it difficult to nest functions
- Under constant change
Related Languages / Projects
- PEAR – PHP's Extension and Application Repository
- PHP GTK – PHP's Client-side GUI
- C++
- Python
- Perl
I personally would use PHP when constructing a web page. PHP is one of the most commonly used server script languages, and there is easy access to multiple libraries of information and help. PHP can also be used within HTML source, and does not require extended files from outside of the source. PHP is also simple to learn, and works well with databases, files, etc. In total, PHP would be a good quality server-side scripting language with easy access to additional information and help if necessary.
Work Cited
- http://en.wikipedia.org/wiki/PHP
- http://www.webopedia.com/TERM/P/PHP.html
- http://c2.com/cgi/wiki?PhpProsAndCons
- http://talener.com/php-the-ins-and-outs-the-pros-and-cons/
- http://www.php.net/manual/en/history.php.related.php
- http://stackoverflow.com/questions/8199632/which-programming-language-is-similar-to-php
Dart
Dart was unveiled back in October 2011 and was created by Google. Dart is an open-sourced, client based, object-oriented programming language created with C syntax. Google's hope is to one day have Dart replace JavaScript in web development. Currently, Dart supports three main ways to run its code: directly through JavaScript, in a Dart virtual machine (or Dartium Browser), or within a command-line environment. Dart was created to fix problems with JavaScript that were thought could not be resolved through enhancing the current language, and to offer better performance.
Requirements
While there are no real requirements for using Dart here are some specs to keep in mind:
- Dart is compiled in JavaScript
- There is a Chromium web browser that offers a Dart virtual machine that you can code out of
- Command-line use of Dart is available with the Dart SDK
Pros
- The Dart Virtual Machine uses source code so there is no compiling between execution and run time
- Dart allows you to run programs without being type-specific
- Easy to create lists/ arrays
- Syntax is based off of/ similar to C# and JavaScript
- Object oriented scripting language
- You can put more than one class into a file – don't have to be separate
Cons
- New scripting language – Java has been around longer
- Not as much online help as compared to Java
- Still a work in progress
- Currently needs to be compiled through JavaScript to run
- Booleans only hold the literal value of true/false, and not also 1/0
Related Languages
- JavaScript
- C#
- C++
Conclusion
Personally, I would be a bit hesitant to use Dart. It has nothing to do with the language itself so much that it is still a work in progress and it is a young, new scripting language. It has only been around for 2 years, and there doesn't seem to be a whole lot of information/ help for it like there is with JavaScript. However, it's syntax is relatively easy and similar to JavaScript so it shouldn't be too hard to understand if you want to give it a try. I would just prefer to have places to resource when I'm trouble-shooting a problem.
(Back to top)