A Brief Comparison of Server-side Scripting Langauges

  • spork
  • HB
  • Silver Member
  • User avatar
  • Joined: Sep 22, 2003
  • Posts: 5474
  • Loc: Rochester, NY
  • Status: Offline

Post July 28th, 2008, 10:31 am

I've noticed that quite a few people come to Ozzu asking about the best way to create dynamic, content-driven websites. After being told to use a server-side scripting language, their next question is almost always about which one to use.

Hopefully this will help clear up a few things and help people to make a choice.

PHP
Website: http://www.php.net
Cost: Free (Open Source)
License: PHP License
Syntax: C-like, similar to Perl
API: PHP Manual

PHP is one of the most widely-used scripting languages because a) it is free, and b) it is easy to learn. PHP has extensive API documentation and built-in functionality for many common tasks.

A simple Hello World script in PHP might look like this:
Code: [ Download ] [ Select ]
<html>
<head>
<title>PHP Hello World Demo</title>
</head>
<body>
 
<?php
    $greeting = "Hello World!";
    echo $greeting;
?>
 
</body>
</html>
  1. <html>
  2. <head>
  3. <title>PHP Hello World Demo</title>
  4. </head>
  5. <body>
  6.  
  7. <?php
  8.     $greeting = "Hello World!";
  9.     echo $greeting;
  10. ?>
  11.  
  12. </body>
  13. </html>

Most Linux-based hosting packages provide PHP support as a basic part of any plan. To set up PHP on your own computer for development purposes, you can either install PHP itself, available here, or use an all-in-one package that sets up a complete Apache, PHP, and MySQL environment, such as WAMP.

To begin learning PHP, check out the following:
PHP Resources for Tutorials, Books, Script Archives, etc.
PHP Tutorials


ASP.NET
Website: http://www.asp.net
Cost: Free
License: Microsoft
Syntax: Varies
API: MSDN

ASP.NET is also relatively easy to learn and costs nothing to run on a server.

A simple Hello World script in ASP.NET might look like this:
Code: [ Download ] [ Select ]
<html>
<head>
<title>ASP.NET Hello World Demo</title>
</head>
<body>
 
<% Response.Write("Hello World!") %>
 
</body>
</html>
  1. <html>
  2. <head>
  3. <title>ASP.NET Hello World Demo</title>
  4. </head>
  5. <body>
  6.  
  7. <% Response.Write("Hello World!") %>
  8.  
  9. </body>
  10. </html>

ASP.NET is used widely on Windows-based hosting packages. ASP.NET uses (and thus requires) the .NET framework. To set up ASP.NET on your own computer for development purposes, you can install the .NET framework and ASP.NET, available here.

To begin learning ASP.NET, check out the following:
ASP.NET Tutorials
ASP.NET: Getting Started
QuickStart Tutorial
ASP.NET tutorial at W3Schools


ColdFusion
Website: http://www.adobe.com/products/coldfusion/
Cost: $1,299 USD (developer's edition is free)
License: Adobe
Syntax: XML-based
API: CFML Reference

ColdFusion is used in many enterprise-level web applications. It integrates tightly with other Adobe technologies and platforms such as Flex and AIR. To install and run ColdFusion on your own server, you'll need to purchase a ColdFusion license from Adobe. A good number of hosting providers, however, provide ColdFusion support, often for only a few dollars extra on any hosting plan. Some even offer it free of charge.

Although a full-fledged ColdFusion license can be pricey, you'll likely only need the Developer Edition, which is free and allows you to develop ColdFusion applications locally.

A simple Hello World script in ColdFusion might look like this:
Code: [ Download ] [ Select ]
<html>
<head>
<title>ColdFusion Hello World Demo</title>
</head>
<body>
 
<cfset var greeting = "Hello World">
<cfoutput>#greeting#</cfoutput>
 
</body>
</html>
  1. <html>
  2. <head>
  3. <title>ColdFusion Hello World Demo</title>
  4. </head>
  5. <body>
  6.  
  7. <cfset var greeting = "Hello World">
  8. <cfoutput>#greeting#</cfoutput>
  9.  
  10. </body>
  11. </html>

To set up Coldfusion on your own computer for development purposes, you can install the ColdFusion Developer Edition, available here. (Adobe account required, free to signup)

To begin learning ColdFusion, check out the following:
ColdFusion Developer Center
ColdFusion Tutorial and Article Index


Python
Website: http://www.python.org
Cost: Free (Open Source)
License: Python License
Syntax: C-like
API: Python Language Reference

Python is a general purpose scripting language often used to develop web applications. Python is arguably a more powerful object-oriented language than PHP, but the two languages are very similar, and learning one making learning the other easy.

A simple Hello World script in Python might look like this:
Code: [ Download ] [ Select ]
greeting = "Hello World!"
print greeting
  1. greeting = "Hello World!"
  2. print greeting

Note that on shared hosting, Python scripts are usually run as CGI programs. To set up Python on your own computer for development purposes, you can install the Python libraries, available here.

To begin learning Python, check out the following:
Python Documentation
Python Tutorial
A Beginner's Python Tutorial
Dive Into Python


Ruby
Website: http://www.ruby-lang.org/
Cost: Free (Open Source)
License: Ruby License
Syntax: Unique
API: Ruby Core Reference

Ruby is a newer scripting language that aims to focus on simplicity and rapid development. Ruby is often seen paired with the Rails framework, an MVC framework built on Ruby for rapid application development.

A simple Hello World script in Ruby might look like this:
Code: [ Download ] [ Select ]
<html>
<head>
<title>Ruby Hello World Demo</title>
</head>
<body>
 
<%
    greeting = "Hello World!"
    puts greeting
%>
 
</body>
</html>
  1. <html>
  2. <head>
  3. <title>Ruby Hello World Demo</title>
  4. </head>
  5. <body>
  6.  
  7. <%
  8.     greeting = "Hello World!"
  9.     puts greeting
  10. %>
  11.  
  12. </body>
  13. </html>

Ruby is not always available on hosting packages, so be sure to check with your hosting provider and ask for Ruby support if necessary. To set up Ruby on your own computer for development purposes, you can install the Ruby libraries, available here.

To begin learning Ruby, check out the following:
Ruby Documentation
Basic Ruby Tutorial


There are many other scripting languages that can be used to create dynamic websites. I've only listed some of the most common ones here. In addition to the languages themselves, many people often use a framework to aid in the development process. Popular MVC frameworks include Rails (for Ruby) and Cake (for PHP).
How to Maintain Simple, Static Pages in a CakePHP Application
EEEEEEEEE! It's here!!
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post July 28th, 2008, 10:31 am

Post July 28th, 2008, 10:43 am

Very nice, sir! Thanks goodness for the new front page, I might have missed this.
- dM
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 22454
  • Loc: Pittsburgh PA
  • Status: Offline

Post July 28th, 2008, 10:45 am

*smiles @ dM

Nice work spork. This is definitely helpful info.
"The web is a dominatrix. Every where I turn, I see little buttons ordering me to Submit."
Play sports pools and discuss sports topics at Boasting Rights Sports Forum
Get paid to write articles - www.associatedcontent.com

Post July 28th, 2008, 11:20 am

Is there a chance we might be able to sticky this so that it is easy to find when referring to?
RewriteEngine On

RewriteRule ^(awesome|excellent|extraordinary)$ RT
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 22454
  • Loc: Pittsburgh PA
  • Status: Offline

Post July 28th, 2008, 11:21 am

done
"The web is a dominatrix. Every where I turn, I see little buttons ordering me to Submit."
Play sports pools and discuss sports topics at Boasting Rights Sports Forum
Get paid to write articles - www.associatedcontent.com

Post July 28th, 2008, 11:25 am

Thanks ATNO, that was real quick. WooHoo!
RewriteEngine On

RewriteRule ^(awesome|excellent|extraordinary)$ RT
  • spork
  • HB
  • Silver Member
  • User avatar
  • Joined: Sep 22, 2003
  • Posts: 5474
  • Loc: Rochester, NY
  • Status: Offline

Post July 29th, 2008, 10:28 am

Added a fantastic Python resource I just came across:
http://www.diveintopython.org/toc/
How to Maintain Simple, Static Pages in a CakePHP Application
EEEEEEEEE! It's here!!
  • Rabid Dog
  • Cheese Monkey
  • Web Master
  • User avatar
  • Joined: May 21, 2004
  • Posts: 3187
  • Loc: South Africa
  • Status: Offline

Post July 29th, 2008, 12:43 pm

Just as a note. The syntax for ASP.NET is not VB like as it supports three different language sets. Namely VB.NET, C# and then Microsofts attempt at Java.

As for the <% Response.Write %> scenario you hardly use that in ASP.NET. What you are more likely to do is create an <asp:label ID="myLabel" runat="server" /> and then in your code behind page myLabel.Text = "Hello World"

As for the MS specific comment there is also the Mono project with adapters for Apache that run the ASPX pages.
My Software Development Company
Music I have recorded (fixed now :))
Image
  • spork
  • HB
  • Silver Member
  • User avatar
  • Joined: Sep 22, 2003
  • Posts: 5474
  • Loc: Rochester, NY
  • Status: Offline

Post July 29th, 2008, 1:04 pm

Thanks. I have zero experience with ASP.NET so I was basing that on examples I found online.

I'll update the description soon.
How to Maintain Simple, Static Pages in a CakePHP Application
EEEEEEEEE! It's here!!
  • joebert
  • Weathered
  • Genius
  • User avatar
  • Joined: Feb 10, 2004
  • Posts: 11817
  • Loc: Clearwater, FL
  • Status: Offline

Post July 29th, 2008, 1:07 pm

So ASP.NET is like Coldfusion with namespaces ? :scratchhead:
Why yes, yes I am.
  • Rabid Dog
  • Cheese Monkey
  • Web Master
  • User avatar
  • Joined: May 21, 2004
  • Posts: 3187
  • Loc: South Africa
  • Status: Offline

Post July 29th, 2008, 1:11 pm

Coldfusion was an attempt at processing jsp in a propretory engine :)

The framework is far more powerful though plus the AJAX extensions.

I still hate web though but I must say in terms of fast fancy development, ASP.NET is way ahead
My Software Development Company
Music I have recorded (fixed now :))
Image
  • ozilion
  • Newbie
  • Newbie
  • User avatar
  • Joined: Aug 05, 2008
  • Posts: 9
  • Loc: Dallas,TX
  • Status: Offline

Post August 5th, 2008, 8:52 am

So people don't do much in Perl anymore..
  • spork
  • HB
  • Silver Member
  • User avatar
  • Joined: Sep 22, 2003
  • Posts: 5474
  • Loc: Rochester, NY
  • Status: Offline

Post August 5th, 2008, 10:11 am

Perl is more like the Swiss Army Knife of scripting languages. It's still widely used for a lot of things, but other languages are far more popular when it comes to web development.
How to Maintain Simple, Static Pages in a CakePHP Application
EEEEEEEEE! It's here!!
  • joebert
  • Weathered
  • Genius
  • User avatar
  • Joined: Feb 10, 2004
  • Posts: 11817
  • Loc: Clearwater, FL
  • Status: Offline

Post August 5th, 2008, 12:09 pm

Perl has more of a place in general shell scripting doesn't it ? :scratchhead:

I'd like to get a better grasp of it, if even only for its' regular expression functionality. :D
Why yes, yes I am.
  • spork
  • HB
  • Silver Member
  • User avatar
  • Joined: Sep 22, 2003
  • Posts: 5474
  • Loc: Rochester, NY
  • Status: Offline

Post August 5th, 2008, 12:18 pm

Yeah, Perl is much more common -- and arguably much more useful -- in the shell scripting arena. There are some web applications such as YaBB that are written entirely in Perl, but you don't see them as often as web apps written in other languages.

joebert wrote:
I'd like to get a better grasp of it, if even only for its' regular expression functionality. :D

Of course, because then you could save the day!
How to Maintain Simple, Static Pages in a CakePHP Application
EEEEEEEEE! It's here!!
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post August 5th, 2008, 12:18 pm

Post Information

  • Total Posts in this topic: 22 posts
  • Users browsing this forum: No registered users and 182 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© Unmelted Enterprises 1998-2009. Driven by phpBB © 2001-2009 phpBB Group.