Re: Does anyone know how to make a chatroom for free?

From: Richard Cornford (Richard_at_litotes.demon.co.uk)
Date: 07/26/04


Date: Mon, 26 Jul 2004 15:09:50 +0100

Simon Egginton wrote:
<snip>
> OH that's another thing you pedantic old fart Java and
> Java script is virtually the same. I don't know why in hells
> name you keep on saying there not? what's the difference?
> Tell me that ehh?
<snip>

Java and javascript are a very long way form being the same. Beyond the
fact that they both use a syntax reminiscent of C they are not even that
similar. Off the top of my head, some differences include:-

Java | Javascript
-----------------------------------------------------------------------
Strongly type language with an | Loosely typed language with
infinitely extendable number of | exactly 6 distinct types (7 if you
type definitions. | want to consider Function objects
                                   | separately form Object objects).
                                   |
Type casting/converting is | All types may be converted to all
restricted to what makes sense (in | other types without restriction
terms of inheritance | (but with potential data loss),
relationships, the implementation | and automatic type-conversion
of interfaces and (with | follows form the context of
primitives) the nature of the date | use/reference.
they represent and how it would be |
changed by the modification.) |
                                   |
Pre-compiled to, and distributed | Distributed as source text and
as, byte code. | re-interpreted prior to each
                                   | execution.
                                   |
Exclusively Object Orientated | Scripts may be Object Orientated,
language. | procedural or functional (or any
                                   | combination).
                                   |
Class-based language in which | Dynamic language in which all
class definitions are fixed at the | definitions and structures are
point of compilation. | amenable to unlimited run-time
                                   | modification (precluding any
                                   | directly analogous "class"
                                   | concept).
                                   |
Class-based inheritance. | Prototype-based inheritance.
                                   |
No global variables. | Global variables are properties of
                                   | the global object and all scripts
                                   | share the global object with each
                                   | other and the host environment.
                                   |
Block scoped local variables. | Lexically scoped variables (at
                                   | function intervals), with
                                   | function nesting and closures.
                                   |
Built in support for access | Unrestricted access to all object
modifiers (public, private, | properties (unless restrictions
protected, etc). | are actively implemented using
                                   | closures).
                                   |
Functions can only exist as | Functions are objects and may be
methods of an instance or a class. | passed by reference, assigned
                                   | properties/methods, and may be
                                   | executed as method of objects or
                                   | not, depending on the context of
                                   | their use.
                                   |
Methods take strictly defined | Functions take any arguments list
numbers and types of argument. | used when they are called.
                                   |
Many packages included in the | All facilities beyond the basic
language for things like GUI | language are expected to be
construction, networking and file | provided by the host environment
handling. | (or are unavailable).

Richard.



Relevant Pages

  • Re: Garbage collection problems
    ... Many Desktop programmers don't ... of the higher level language constructs and facilities of platforms ... like Java and .NET. ...
    (comp.lang.c)
  • Re: Garbage collection problems
    ... Many Desktop programmers don't ... Java apps are a minority (actually, afaik, more people use Java on embedded ... of the higher level language constructs and facilities of platforms ...
    (comp.lang.c)
  • OK I goofed!
    ... At the posting I did not know there was a difference between Java ... What is the difference between a Java Applet and a Java Script? ... Java Script is raw code language that is placed in the html of the web page. ... Java Applets, on the other hand, are small ...
    (comp.lang.java.help)
  • Re: Why not develop new language
    ... > then Java is a similar alternative. ... > better marketed language. ... and how good the respective compilers are at ...
    (comp.lang.cpp)
  • Re: XML Document. Node vs Elements, and more
    ... > I am relatively new to java (have always been a C language guy), ... not much different from other common Java code. ...
    (comp.lang.java.programmer)