A Brief Comparison of Server-side Scripting Langauges

  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6252
  • Loc: Seattle, WA

Post 3+ Months Ago

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: [ 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: [ 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: [ 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: [ 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: [ 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).
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • digitalMedia
  • a.k.a. dM
  • Genius
  • User avatar
  • Posts: 5149
  • Loc: SC-USA

Post 3+ Months Ago

Very nice, sir! Thanks goodness for the new front page, I might have missed this.
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

*smiles @ dM

Nice work spork. This is definitely helpful info.
  • righteous_trespasser
  • Scuffle
  • Genius
  • User avatar
  • Posts: 6230
  • Loc: South-Africa

Post 3+ Months Ago

Is there a chance we might be able to sticky this so that it is easy to find when referring to?
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

done
  • righteous_trespasser
  • Scuffle
  • Genius
  • User avatar
  • Posts: 6230
  • Loc: South-Africa

Post 3+ Months Ago

Thanks ATNO, that was real quick. WooHoo!
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6252
  • Loc: Seattle, WA

Post 3+ Months Ago

Added a fantastic Python resource I just came across:
http://www.diveintopython.org/toc/
  • Rabid Dog
  • Web Master
  • Web Master
  • User avatar
  • Posts: 3245
  • Loc: South Africa

Post 3+ Months Ago

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.
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6252
  • Loc: Seattle, WA

Post 3+ Months Ago

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

I'll update the description soon.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

So ASP.NET is like Coldfusion with namespaces ? :scratchhead:
  • Rabid Dog
  • Web Master
  • Web Master
  • User avatar
  • Posts: 3245
  • Loc: South Africa

Post 3+ Months Ago

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
  • ozilion
  • Newbie
  • Newbie
  • User avatar
  • Posts: 9
  • Loc: Dallas,TX

Post 3+ Months Ago

So people don't do much in Perl anymore..
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6252
  • Loc: Seattle, WA

Post 3+ Months Ago

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.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

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
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6252
  • Loc: Seattle, WA

Post 3+ Months Ago

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!
  • bastones
  • Novice
  • Novice
  • bastones
  • Posts: 19

Post 3+ Months Ago

PHP is easily learnt online so there are a few resources online that may be helpful with a Google search. Moreover, the PHP.net's documentation is probably the first place to get if you're stuck on something. Their documentation is one of a kind.
  • mk27
  • Proficient
  • Proficient
  • User avatar
  • Posts: 334

Post 3+ Months Ago

ozilion wrote:
So people don't do much in Perl anymore..


Wow! Kind of surprised by this! Pretty sure a lot of web programming still done in perl. You may want to take a few steps back and look at this list:

http://www.masonhq.com/?MasonPoweredSites

Notice "Amazon.com" there under "A" on the first screenful. I haven't bothered to read all of them myself.

I just started using "Mason", but AFAICT perl has been used embedded in html a la PHP & the rest of this list for a long time:

<% my %hash %>

There's also a framework (Catalyst) which predates RonR and Python's Django...
  • Rabid Dog
  • Web Master
  • Web Master
  • User avatar
  • Posts: 3245
  • Loc: South Africa

Post 3+ Months Ago

Rabid Dog wrote:
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


After working with the Java Seam framework and the likes of JSF and RichFaces I am inclined to say that Java now has my corner on fancy interface development :) Another tool in the box thank you very much
  • spork
  • Brewmaster
  • Silver Member
  • User avatar
  • Posts: 6252
  • Loc: Seattle, WA

Post 3+ Months Ago

RD, I'm looking to pick up a new web application skill set over the next few months; would you recommend ASP.NET MVC or Java EE/Spring/JBoss, etc. (or something else?)
  • Rabid Dog
  • Web Master
  • Web Master
  • User avatar
  • Posts: 3245
  • Loc: South Africa

Post 3+ Months Ago

Java EE 5 + Seam, love them :)
  • UPSGuy
  • Lurker ಠ_ಠ
  • Web Master
  • User avatar
  • Posts: 2733
  • Loc: Nashville, TN

Post 3+ Months Ago

I've got some experience with Spring/Hibernate/JBoss. They're fun to learn, too. Definitely flexible.
  • mk27
  • Proficient
  • Proficient
  • User avatar
  • Posts: 334

Post 3+ Months Ago

spork wrote:
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.


Well, just so no one gets discouraged here, there are a couple of obvious reasons for that popularity:

1) those languages are easier to learn
2) perl is much more *nix based, hence MS users don't use it. Most servers are unix or linux servers; but most people who code at home use Windows. A lot of the "general scripting" that goes on on a server will be in perl, so in that sense it's probably "the most popular" scripting language on a server box.
3) mod_perl is something you have to ask for, hosts don't give it to you by default. Perl is a bit of a pig, memory wise, but very "fast", eg, lite on the processor, which that is causal relationship.

So it is not as if it is less "popular" because it is "not as useful", etc, since perl is almost certainly a much more "powerful" language than (eg) php. Which is the reason that it is much used for general scripting, etc. And php and ruby were both derived from perl.

Also, please don't forget that at least 75%+ (okay I'm guessing) of contemporary cgi is still done in perl. Which CGI is pretty much the original "server side scripting".
  • WIGPIP
  • Born
  • Born
  • WIGPIP
  • Posts: 4
  • Loc: Melbourne, Australia

Post 3+ Months Ago

hats off to spork on the initial article. On the topic of PHP can I say online resources are great, however I think a book somehow feels like it is written by an author, author(ity). I have to shout out about Larry Ullman in particular on PHP and also Steven Holzner on PHP as learning resources - if you decide to go with PHP as your native web site scripting language.

Post Information

  • Total Posts in this topic: 23 posts
  • Users browsing this forum: No registered users and 128 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
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.