首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2SE开发 >

What's the difference between a programming language, a scripting language, and

2012-01-30 
Whats the difference between a programming language, a scripting language, and a markup language?

What's the difference between a programming language, a scripting language, and a markup language?
不好意思,没有找到法帖的地方。
借个地方哈!
this   artical   is   from:
http://www.answerbag.com/q_view/948
-----------------------------
Top   Answer   out   of   3  

The   primary   difference   between   a   "programming   language "   (C,   C++,   VB   etc.)   and   a   "scripting   language "   (PHP,   ASP,   JSP,   JavaScript,   VBScript)is   that   code   written   in   a   programming   language   needs   to   be   compiled   before   it   is   run.   Once   it   is   compiled,   it   can   be   run   any   number   of   times.

Scripting   languages,   on   the   other   hand,   are   interpreted   at   run-time.   This   means   that   every   time   you   want   to   run   the   program,   a   separate   program   needs   to   read   the   code,   interpret   it,   and   then   follow   the   instructions   in   the   code.   Compiled   code   has   already   been   interpreted   into   machine   language,   so   it   is   will   typically   execute   faster   because   the   conversion   into   machine   language   has   already   been   done.  

Markup   languages   (HTML,   XML)   are   somewhat   different   from   both   of   the   others.   A   markup   language   is   simply   a   set   of   tags   that   are   used   to   "mark   up "   text   documents   so   that   sections   of   text   can   be   logically   arranged   and   labeled.   These   documents   can   be   viewed   as   plain   text,   or,   more   commonly,   are   viewed   through   a   browser.   The   browser   parses   the   document,   looking   for   markup   tags,   and   it   then   arranges   the   text   and/or   formats   it   according   to   the   values   in   the   tags.
-----------------
Answer   2   out   of   3  

The   answer   is   basically   correct,   but   here   are   a   few   modifications:

Not   all   programming   languages   are   compiled   the   same.   C/C++   and   VB   are   compiled   languages,   Java   can   be   considered   compiled   or   not   depending   on   your   definition   of   compiled.   Perl   is   interpretted   and   very   much   considered   a   language...   there   are   others   that   fall   into   this   category   as   well.

ASP   is   a   construct   of   JScript,   VBScript   or   C#   and   is   not   really   a   language   as   much   as   a   way   of   using   a   language   for   server   side   development.
JSP   is   a   shortcut   method   for   developing   servlets.   JSP   pages   are   converted   to   Java   source   code   and   then   compiled   into   servlets.



The   markup   language   information   is   a   little   out-dated.   HTML   is   used   for   web   page   development   and   is   viewed   in   a   browser,   while   XML   is   used   for   any   kind   of   data.   It   is   "human-readable "   in   that   you   can   view   the   text   it   is   constructed   from,   though   it   may   mean   little   to   you.   XML   can   be   used   to   create   and   define   other   MLs   such   as   MathML,   SMIL,   SVG,   or   XML-RPC.   None   of   these   represent   text   documents,   they   represent   mathematical   equations,   multimedia   content,   vector   graphics   and   remote   procedure   callls   respectively.
-----------------------
Answer   1   out   of   3  
While   the   previous   descriptions   of   the   three   "languages "   explain   them,   and   distinguish   between   the   two   "procedural "   languages   that   describe   procedures   to   run,   and   the   "formatting "   languages   that   "mark   up "   data,   a   simple   nuance   can   be   used   to   distinguish   between   "programming "   and   "scripting "   languages,   especially   those   in   the   fringe   areas.

Using   the   question   of   compilation   versus   interpretation   to   define   languages   gives   a   "fuzzy "   definition   for   languages   like   Java,   which   can   be   compiled   to   a   byte   code   which   is   then   interpreted   at   runtime.   And   there   have   long   been   programming   tools   such   as   Borland 's   Turbo   C   /   Pascal   which   would   interpret   languages   that   were   normally   compiled,   to   allow   more   rapid   development.

The   difference   between   "programming "   and   "scripting "   is   better   defined   by   usage,   or   application,   as   well   as   scope   and   purpose.   A   programming   language   is   used   for   building   standalone   projects,   or   "applications ";   a   scripting   language   is   used   to   write   "scripts "   that   interact   with   other   data   or   systems   to   perform   parts   of   a   task   rather   than   an   entire   workflow.

An   example   might   make   this   clearer.   Imagine   an   accounting   application   program   used   in   a   large   corporation.   The   program   would   be   written   in   a   programming   language   by   a   team   of   developers,   probably   at   some   other   company,   a   software   house.   It   would   have   a   long   lifecycle,   and   have   many   features.   One   of   them   might   be   to   generate   a   series   of   invoices.   This   would   be   one   of   many   tasks   done   with   the   program,   which   runs   for   extended   periods   of   time.   But   it   might   be   necessary   to   separate   the   invoices,   sending   some   to   a   printer   in   the   mail   room,   others   to   a   fax   machine,   and   still   others   to   be   sent   via   email.   This   task   might   be   accomplished   by   a   local   programmer,   who   writes   a   simple   "script "   that   sorts   through   the   accounting   program 's   output   files   and   dispatches   them   appropriately.   That   little   snippet   of   local,   customized   programming   would   be   a   script,   written   in   a   scripting   language.   The   script   would   be   started,   perform   its   one   task,   and   stop.



Programming   languages   are   used   to   write   programs,   which   can   run   for   a   while   and   do   multiple   things.
Scripting   languages   are   used   to   write   scripts,   which   run   for   a   short   duration   to   perform   a   single,   simple   task.

Of   course,   there   are   applications   programs   that   have   been   cobbled   together   out   of   collections   of   scripts,   and   there   are   programmers   who   use   a   traditional   programming   language   to   write   a   full-blown   program   to   erase   a   file,   but   the   general   sense   of   the   range   of   usages   should   now   be   clear.

Some   languagees   such   as   Perl   or   Visual   Basic   can   be   used   for   both   kinds   of   task,   and   therefor   can   be   characterized   as   one   or   the   other.

[解决办法]
This discuss is pointless just like what 's the different between a apple,a banana and a orange!Just eating~

热点排行