Internet Programming Languages
There are many languages that are used for Internet Programming.
Choosing one over another depends on the application you have in
mind. There are many ways to characterize an Internet
Programming Language. Here are a few:
Categorizations
- Local versus Remotely Executed (e.g. Client- versus - Server)
- MutliThreaded Capability
- Exception Handling Capability
- GUI elements built in.
- Distributed Computing Capability
- Database Access Capability
- TCP (UDP) /IP Communications
- Platform Independent
- Script versus Binary (or pseudo-binary) .......Interpreted
versus Executable
- Security Restrictions/Checking
- HW Device Access Capability.
Some Internet Programming Languages
x = feature exists
s = feature exists to some degree
nothing = feature is either
not part of standard release of the language, OR you must
create the supporting code yourself from scratch...and often
platform specific. You may be able to purchase add-in
packages commercially.
Feature |
Perl
|
Java/C#
|
JavaScript
|
PHP
|
C/C++ |
Local Execution* |
|
x
|
x
|
|
|
Remote Execution* |
x |
x
|
|
x
|
x
|
MultiThreaded Built-In |
|
x
|
|
|
x (platform-
specific)
|
Exception Handling |
x
|
x
|
x
|
x
|
x (platform specific)
|
Distributed Computing |
s
|
x (C# less forms)
|
|
x
|
|
GUI Elements Built-In |
|
x
|
x
|
s
|
|
Database Access Built-In |
|
x
|
|
x
|
|
TCP/IP Built-In |
x
|
x
|
|
x
|
x
|
Platform Independent |
x
|
x
(C# server side requirements)
|
x
|
x
|
|
Script/Interpreted |
x
|
|
x
|
x
|
|
Executable |
|
x |
|
|
x
|
Pseudo-Compiled |
|
x
|
|
|
|
Security Violoation Checking |
|
x
|
x
|
|
|
Security Restrictions |
|
s
|
s
|
|
|
HW Device Access Built-in |
|
x
|
|
|
|
Object Oriented |
|
x
|
|
|
x
|
* with regards to the User's (web -browser,etc) Machine.
|
Perl
For many WWW-based applications used as a CGI-script language
in conjunction with HTML form.
Is a server-side scripting language. Not only used
for Internet Programming, but, also commonly used for Unix or other
system (e.g. server) administration.s
- Example Simple Perl Script/Code Returing some HTML
#!/usr/sbin/perl
print "Content-type: text/html\n\n";
print "<html>\n";
print "<head>\n";
print "<title> My first CGI </title>\n";
print "</head>\n";
print "<body background="#000000" text="#ff0000">\n";
print "<h1> My First CGI </h1>\n";
print "<em> Hello Internet! </em>\n";
print "</body>\n";
print "</html>\n";
|
Java
Language sometimes called C++--. Has its structure and
basis in C++. Not only for Internet Programming including
web-based and non-web-based lagnuages, but, also used heavily for
non-Internet application development. While multi-platform,
even with Native compilers considered slower than truely complied
languages like C++. Hence for very-speed sensitive applications
C++ can be the best choice.
JavaScript
A client-side script language strictly for WWW, as interpreter
built-into the Web Browser. Written inside of the HTML of
a web-page. In the Head tag area. Mostly used
for GUI, Forms, Animation kinds of interactions.
- Example JavaScript, embedded inside of HTML, to Print out
business information of the person referenced in the Body of the
HTML by calling the JavaScript Function
<HEAD>
<TITLE>JavaScript Business Cards</TITLE>
<Script Language="JavaScript">
function PrintCard() {
document.write("<B>Name:</B>",
this.name, "<br>");
document.write("<B>Address:</B>",
this.address, "<br>");
document.write("<B>Work Phone:</B>",
this.work_phone, "<br>");
document.write("<B>Home Phone:</B>",
this.home_phone, "<br>");
document.write("<B>Job:</B>",
this.job, "<br><br><hr>");
}
function Card(name, address, work, home, job) {
this.name = name;
this.address = address;
this.work_phone = work;
this.home_phone = home;
this.job = job;
this.PrintCard = PrintCard;
}
</SCRIPT>
</HEAD>
|
- Example that brings up windows when Buttons are hit
<HTML>
<HEAD><TITLE>Alerts, Confirmations, and Prompts</TITLE>
</HEAD>
<BODY bgcolor="#9f9f9f">
<H1>Alerts, Confirmations,
and Prompts</H1>
<HR>
Use the buttons below to
test dialogs in JavaScript.
<HR>
<FORM NAME="winform">
<INPUT
TYPE="button" VALUE="Display an Alert"
onClick="window.alert('This is a test alert.'); ">
<P><INPUT
TYPE="button" VALUE="Display a Confirmation"
onClick="temp = window.confirm('Would you like to confirm?');
window.status=(temp)?'confirm: true':'confirm: false'; ">
<P><INPUT
TYPE="button" VALUE="Display a Prompt"
onClick="var temp = window.prompt('Enter some Text:','This
is the default value');
window.status=temp; ">
</FORM>
<BR>Have fun!
<HR>
</BODY>
</HTML>
|
PHP
PHP Version 3.0 is a server-side HTML-embedded scripting
language. Much of its syntax is borrowed from C, Java and Perl with
a couple of unique PHP-specific features thrown in. The goal of
the language is to allow web developers to write dynamically generated
pages quickly.
- PHP code, like Java Script can be embedded in the HTML.
<html>
<head>
<title>Example</title>
</head>
<body>
<?php echo
"Hi, I'm a PHP script!"; ?>
</body>
</html> |
- Notice how this is different from a CGI script written in
other languages like Perl or C -- instead of writing a program
with lots of commands to output HTML, you write an HTML script
with a some embedded code to do something (in this case, output
some text). The PHP code is enclosed in special start and end
tags that allow you to jump into and out of PHP mode.
- At the most basic level, PHP can do anything any other CGI
program can do, such as collect form data, generate dynamic page
content, or send and receive cookies.
- Perhaps the strongest and most significant feature in PHP
is its support for a wide range of databases.
C++
One example of a language used for CGI-bin implementation.
Can be used for non-Internet Applications. Platform-specific
and server-side only execution can limit its usefulness as
well as its lack of standard built-in database, networking,
etc. packages. Speed can be an advantage here.
|