Teen Programmers Unite  
 

  Web Programing
By taubz
The Article

So I hear you want to make dynamic web pages but don't know where to start. Here's an overview of some common web-programming terms/languages that you can use to pick the language that's right for you.

If you're looking to program in general and don't want to focus on web programming, you'll probably want to start with the Getting started with programming Quick start guide on the main page of TPU.

Just to mention... the main difference between web programming and programming in general is that programs for the web must be useful to anyone who is browsing that side - users of Windows, Linux, MacOS, etc. Client-side web-languages must be platform independent so that any client (anyone browsing the web) can run it, independent of what platform (operating system) is begin used. Java is the champion of platform-independence. Normal programs just don't cut it, because they are compiled for a particular platform and processor. The difference on the server-side is that web-based programs don't need to worry about programming a user interface -- the program gets all of its input at once (which is taken care of by the client's browser and the web server software), and spits out all of its output at once (as easy as using "print" statements).

JavaScript and VBScript
JavaScript and VBScript are client-side languages, which means its run by the web browser. That limits its functionality to only things that the WebBrowser knows about. So, you can customize forms and have neat things happen on a page, but that's its limit. These languages are primarly useful for creating menus on web pages and images that change when the mouse hovers over them. Beware, though, that VBScript will only work within Microsoft's Internet Explorer. JavaScript is therefore recommended for these tasks. See http://developer.netscape.com/docs/manuals/js/client/jsref/index.htm
DHTML
DHTML isn't a language but more of a type of programming. DHTML (dynamic HTML), which is basically making changes to the appearance of a page on the fly, could be implemented with JavaScript or VBScript.
XML
XML (eXtensible markup language) isn't a language either, but instead a way to organize data - the same way that the content of a web page is structured in tags that the browser can understand. XML is all about structure, not effect - there's no dynamic or scripted aspect to it. So if you have databases or other data to manipulate, XML might be handy. I've never found it handy myself. (It has been quite a pain, in fact, formatting this article in XML.)
C++
C or C++ is a language that could be used for server-side web programming. While some will say it's good for the web, I think most would agree that it's overly complex. Other languages are much more suited for web programming.
CGI
CGI is also not a language, but a "reason" for programming. A CGI program is any program (regardless of the language) that is run server-side. Server-side means the web server runs the program and sends the output back to the client -- the user sees whatever the program prints out. Common languages used for CGI are Perl (my personal favorite), PHP, Java (using servelets like JSP), and of course C++.
Perl and PHP
Perl and PHP aren't very similar in syntax, but are similar in complexity and power. Maybe PHP is a bit simpler. I strongly recommend learning Perl (or PHP). A good tutorial will get you started. Beware, tho, that you'll either need to have access to a UNIX-based webserver or download ActiveState Perl if you're running MS Windows on your own computer. If you're running it on your own computer to test, then you'll probably want to download a free web server to make your life easier. See perl.org, perl.com, and php.org, and OmniHTTPd. Also take a look at the Quick start guide on learning PHP on the main page of this site -- even if you decide to learn Perl.
Java
Java is yet another language for web programming. Java, however, can be used three ways: as an applet, an application, or as a servlet. As an applet, Java runs within the web browser. The web browser downloads your program and then executes it on the browser's computer. The downsides to this are 1) it's slow 2) security policies prevent applets from doing many things 3) its not very useful, despite its power. Basically, you can make games with applets. I haven't found much else that's useful. Applications on the other hand are more complex. They are generally not restricted by security policies, but they're just as slow and are difficult for the user to start, since they are independent of the web browser. Servlets are neat, but they are complicated. Basically it's a way to write server-side code in Java, but it's more complex than just Perl and PHP. In general, I happen to like Java as a language. I enjoy programming in it more than I do programming in Perl, and it's far better suited for complicated programs. But, since most web programming isn't complicated at all, Java isn't suited for most web programming. See java.sun.com.
Good luck.
 
Copyright TPU 2002. See the Credits and About TPU for more information.