PDA

View Full Version : Software Coding And Scripting Faq



NightStalker
01-31-2004, 04:20 AM
What programming language should I learn?
That depends on what kind of programming you want to do:
Client-side (windows applications, linux applications)
The easiest language to learn if you want to do client-side programming is probably Visual Basic or Delphi. Some argue Visual Basic is for newbies only, and they might be right. Software like Word and Windows are written in C and C++ which are a lot harder to learn. If you want to write applications which run on any platform (Windows, Macintosh, Linux) Java (http://java.sun.com) is the best language to learn.
Server-side programming (forums, guestbooks, content managing systems)
If you want to write a guestbook, newsscript or content managing software you'll need to learn a language that runs on your webhost. Traditionally the most used is Perl (http://www.perl.com), a language that is becoming more and more popular today is PHP, merely because it's incredibly easy to learn and comes with a large set of functions which makes programming easier. And of course there's VBScript if you want to code using Microsoft's ASP.
If you intend to do programming for big businesses or sites generating major traffic you might want to look into more scalable solutions such as JSP, Servlets (http://java.sun.com) or Coldfusion (http://www.macromedia.com/software/coldfusion/).
General purpose (both client- and server-side)
If you want to learn one language that can do both server and clientside programming you have a couple of options. Most suitable are Perl (http://www.perl.com) and Java (http://java.sun.com). But of course running C programs through CGI is possible so you could learn C too.
What's the difference between CGI and Perl?
People tend to confuse CGI and Perl. Now what exactly is CGI and what exactly is Perl? They're completely different things and technically they have nothing to do with eachother. CGI (Common Gateway Interface) is a protocol which allows interaction between webserver and programs on the server. It's most commonly used to forward perl script output to your webbrowser. So here's how it works. You, using your browser send a request to the webserver to run some kind of perl script. The webserver therefor runs perl to execute the script, waits until it's done, then sends the output back to the browser. That's all, nothing more nothing less. So CGI is the protocol, Perl is the programming language.
What's mod_perl, mod_gzip and mod_php?
Apache, the most used webserver on the internet, allows you to write plugins or MODules. Two of them are mod_perl and mod_php, but another well known one is mod_gzip.
mod_perl
mod_perl integrates Perl into Apache. That means scripts no longer run through CGI but are handled by the webserver itself. That also means perl does not have to be started each time someone requests a perlscript generated page. Making the server respond a lot faster. mod_perl also allows kinds of caching, persistent database connections and a few things more. Not many hosts have mod_perl installed because not just any perl script runs using it. There are a couple of things the coder has to take into account, and not many did.
mod_php
mod_php is the module that integrates PHP into Apache. Nearly all hosts supporting PHP have this one installed. It works just the same as the CGI version does. It also allows persisitent database connections (and if they compiled using the shared memory directive you can use shared memory, ie caching too, though not many did).
mod_gzip
For many, many years, browsers have been able to unzip gzipped html pages. Though no site really took that opportunity to make sites faster and consume less bandwidth. If you have mod_gzip installed you can easily take advantage of gzip compression. Which as I said will send your html pages to the user in a compressed (smaller) format.
Which one is faster, PHP or Perl?
People tend to confuse the way these scripts are being run and the speed of the compiler itself. Their compilers and interpreters are nearly as fast, there's no noticable difference. The main bottleneck that seems to make Perl slower is that it is being run through CGI most of the time, and if we're talking about PHP, we nearly always mean PHP as an Apache module. To tease the PHP advocates: Since mod_perl allows more optimization you probably could write way faster perl scripts than php scripts :P
Where can I learn language X?
Since there are always people who don't know the God of all search engines Google, here's a list of tutorials/interesting sites for each of the major programming languages:
PHP
PHP Manual (http://www.php.net/manual) Still unbeatable, not just the best reference for PHP there is, but also contains a nice starters tutorial
PHP Builder (http://www.phpbuilder.com) Has a lot of interesting PHP articles
Devshed PHP (http://www.devshed.com/Server_Side/PHP) Has some nice tutorials
Perl
Perl (http://www.perl.com) Contains a lot of articles
Perldoc (http://www.perldoc.com) A very nice reference
Devshed Perl (http://www.devshed.com/Server_Side/Perl) Perl tutorials
Perl tutorial (http://www.wdvl.com/Authoring/Languages/Perl/PerlfortheWeb/toc.html) Said to be good
CGI.pm tutorial (http://stein.cshl.org/WWW/software/CGI/)
Perl with DBs (http://perlguy.net/sql/index.html)
A pretty good DBI (DataBase Interface) tutorial (http://www.perl.com/pub/a/1999/10/DBI.html)
Python
Python.org (http://www.python.org) Contains articles and tutorials
Devshed Python (http://www.devshed.com/Server_Side/Python) Python tutorials
Introductory Material on Python (http://www.python.org/doc/Intros.html)
The official python tutorial (http://www.python.org/doc/current/tut/tut.html) (written by Guido van Rossum himself).
Dive into python (http://diveintopython.org/) an advanced tutorial (as the name indicates) for people with programming experience.
python.faqts (http://www.faqts.com/knowledge_base/index.phtml/fid/199/) frequently asked questions
Global Module Index (http://python.org/doc/current/modindex.html) don't code python without it
Python quick reference (http://www.brunningonline.net/simon/python/PQR.html) needs a little updating
The Vaults of Parnassus (http://www.vex.net/parnassus/) Python Resources
Python library reference (http://www.python.org/doc/current/lib/lib.html)
The python cookbook (http://aspn.activestate.com/ASPN/Cookbook/Python)
The "daily" python url (http://www.pythonware.com/daily/) if you want to know what's happening
Python performance tips (http://manatee.mojam.com/~skip/python/fastpython.html)
More python links (http://p-nand-q.com/python.htm)
Java
Java Tutorials (http://java.sun.com/docs/books/tutorial/index.html) Learn the Java Basics
Devshed Java (http://www.devshed.com/Server_Side/Java) Java tutorials
JavaWorld (http://www.javaworld.com) The best source for all kinds of Java articles
Regular Expressions
Nice (perl)regex tutorial (http://tlc.perlarchive.com/articles/perl/pm0001_perlretut.shtml)
Perl regex examples (http://www.blazonry.com/perl/regexp_exs.php)
General
Tutorialsearch (http://www.tutorialsearch.com)
I'm looking for a script that can do X
Before you ask, make sure you first checked out the following script archives:
CGI ResourceIndex (http://cgi.resourceindex.com)
PHP ResourceIndex (http://php.resourceindex.com)
HotScripts (http://www.hotscripts.com)
Perl archive (http://www.perlarchive.com)
Google (just search ;)) (http://www.google.com)
Which editor should I use?
HTML
1st page 2000 (http://www.evrsoft.com/)
PHP
Check out one of these topics: click (http://forums.invisionpower.com/index.php?act=ST&f=7&t=42949) click (http://forums.invisionpower.com/index.php?act=ST&f=7&t=42307) click (http://forums.invisionpower.com/index.php?act=ST&f=7&t=40402) click (http://forums.invisionpower.com/index.php?act=ST&f=7&t=25690) click (http://forums.invisionpower.com/index.php?act=ST&f=7&t=12290) click (http://forums.invisionpower.com/index.php?act=ST&f=7&t=11515)
Phpide (http://www.phpide.de) (now registrations required)
PHP edit (http://www.phpedit.com) (registraton required)
KPHPDevelop (http://kphpdev.sourceforge.net) (Linux)
Zend Studio Personal (http://www.zend.com/)
Perl
DZ Soft Perl Editor (http://www.dzsoft.com/dzperl.htm) (commercial)
(commercial)
Optiperl (http://www.xarka.com/optiperl/) (commercial)
Perl Code Editor (http://www.perlvision.com/pce/) (free)
Xemacs + Cperl-Mode (http://xemacs.org) (especially in the Cygwin version for Windows and the native version for Linux a great editor - yes it can do other things to)
Multi-purpose
EditPlus (http://www.editplus.com) (commercial)
Synedit (http://synedit.sourceforge.net)
Xemacs (http://xemacs.org)
Vim (http://vim.sf.net)
Jedit (http://www.jedit.org) (java based and many plugins)
Context (http://www.fixedsys.com/context/)
Ed for Windows (http://www.getsoft.com) (commercial)
Ultraedit (http://www.getsoft.com) (commercial)
Textpad (http://www.textpad.com) (commercial)
EditPad Pro (http://www.editpadpro.com) (commercial)
BBEdit (http://www.bbedit.com) (lite version is free)
Omnipad (http://godfather.arsware.org/OmniPad/) written by Josh (and he forced me to put it here, honestly ;) )
and not to forget
Notepad - (bundled with Windows)
How to test my scripts locally?
A excelent guide on installing the Apache web server locally can be found here: Apache Win32 Install Guide (http://www.platoon.dk/guide/). Or this exelent one (http://lameindustries.org/tutorials/guides/apache.shtml), or this one (http://www.dslwebserver.com/), if you want to setup PHP on IIS, check this tutorial out (http://lennon-fan.com/tutz/PHP_n_IIS.htm). Bundles that do this automatically for you:
Easy PHP (http://www.easyphp.org/)
Firepages (http://firepages.com.au/)
Foxserv (http://www.foxserv.net/)
AppServ (http://appserv.sourceforge.net/)
Where can I learn regular expressions
Check these sites out:
http://www.webreference.com/programming/php/regexps/
http://www.phpbuilder.com/columns/dario19990616.php3
http://www.devarticles.com/art/1/106
What's the difference between Javascript and Java?
Well actually, they have nothing to do with eachother. The new name of Javascript is ecmascript which is a better name, though rarely used. The syntax of Javascript and Java look a bit the same, they're both object oriented. The difference is that typically you use javascript for simple client side scripts that you put into your html pages for validating forms etc. Java can be used for many purposes. It can do client side applications (word processors, editors, administration software etc.), server side processing (JSP, servlets) and you can create so called applets with it (small applications being run on a website, client side).
With many thanks to Chris_s, Dagur, Paolo, -Justin-, wehttham, rct2dotcom and all others


Source: IPB Coding and Scripting Chat

h1
01-31-2004, 05:37 AM
Excellent.

DWk
01-31-2004, 02:24 PM
Oh that's REALLY good, specially the links :)

NightStalker
02-06-2004, 03:43 PM
Yep. :)

Lots of great software and tutorials for everyone! :D

kAb
02-19-2004, 06:21 AM
This deserves a PIN.

Thanks :)

zdr
08-03-2005, 08:52 PM
a good freeware text editor designed for programmers:conTEXt
find it at: hxxp://www.fixedsys.com/context/

ssj4gogeta
05-30-2006, 06:53 PM
Some Interesting Looking Stuff Thanks.

DKre8ive1
08-19-2006, 07:08 AM
Thats a great guide thanks for this. :D

enjoy_with_me
08-20-2006, 01:36 AM
gr8 many thnx