HOME ARCHIVES LINKS MAIL BANNERS MAP
francais anglais
MUSIC - MAO
2D/3D CREATION
COMPUTER SCIENCES
DOWNLOADS




PC-INFOGAME.COM: Comparative table between coding languages

Java VB.Net Delphi
C PHP Javascript

Syntax sensitive to breakage?

Java Yes
VB.NET No
C Yes
Delphi No
PHP Yes for the names of variables and functions users
JS Yes


Orientated coding possible object?

Java Yes
VB.NET Yes
C No
Delphi Yes
PHP Yes
JS No


Transtypage / compulsory Cast?

Java Yes
VB.NET Facultative (safe with options explicit and strict speeded up)
C Yes
Delphi Yes
PHP Facultative
JS Facultative


Presence of the gun-layers?

Java No
VB.NET No
C Yes
Delphi Yes
PHP No
JS No


Character of the end of education

Java Semicolon
VB.NET No
C Semicolon
Delphi Semicolon
PHP Semicolon
JS Semicolon


Statement of programme / script

Java
VB.NET
C
Delphi
PHP <? php script?>
JS <script language = "Javascript"> script </script>


Block of instructions

Java {
 instructions 
}
VB.NET
C {
 instructions 
}
Delphi begin
 instructions 
end
PHP {
 instructions 
}
JS {
 instructions 
}


Write a character chain

Java 'text ' or "text"
VB.NET "text"
C 'character ' or "text"
Delphi 'character'
PHP 'text ' or "text"
JS 'text ' or "text"


Comment on a line

Java //comment
VB.NET ' comment
C //comment
Delphi //comment
PHP //comment
JS //comment


Comment on several lines

Java /*
comment
*/
VB.NET
C /*
comment
*/
Delphi {
comment
}
PHP /*
comment
*/
JS /*
comment
*/


Special characters

Java \n, \t, \r, \b, \f, \(exhaust)
VB.NET vbCr (=Chr (13)), vbLf (=chr (10)), vbCrLf (=Chr (13) + Chr (10)), vbTab (=Chr (9)), vbBack (=Chr (8))
C \n, \t, \r, \b, \f, \(exhaust)
Delphi #13#10 (return to the line)
PHP \n, \t, \r, \b, \f, \(exhaust)
JS \n, \t, \r, \b, \f, \(exhaust)


Character string

Java G-string
VB.NET G-string
C Picture of characters: tank []
Delphi G-string
PHP G-string
JS G-string


Entirety

Java byte, tank, shorts, int, long
VB.NET byte, tank, shorts, integer, long, decimal
C tank, shorts, int, long
Delphi byte, tank, shorts, integer, long
PHP integer
JS number


Floating

Java float, doubles
VB.NET single, double
C float, doubles
Delphi single, double
PHP float
JS number


Boolean

Java boolean
VB.NET boolean
C bool (ANSI C99)
Delphi boolean
PHP boolean
JS boolean


Picture

Java array
VB.NET array
C nomType []
Delphi array
PHP array
JS array


Space

Java void
VB.NET
C void
Delphi
PHP
JS Undefined, void


No one

Java null
VB.NET nothing
C NULL
Delphi Nile
PHP null
JS NULL


Define a total variable

Java Attribute of class (see notions objects)
VB.NET Attribute of class (see notions objects) or creation of a module
C static
Delphi To declare Interface in the section
PHP total. Belong to the associative picture: $GLOBALS
JS Variable declared without key word var


Whole promotion towards type

Java int
VB.NET
C int
Delphi
PHP
JS


Floating promotion towards type

Java double
VB.NET
C
Delphi
PHP
JS


Indication of departure of a picture

Java 0
VB.NET 0
C 0
Delphi 0
PHP 0
JS 0


Value of TRUE

Java 1
VB.NET 1
C Different from 0
Delphi 1
PHP 1
JS 1


Value of FALSE

Java 0
VB.NET 0
C 0
Delphi 0
PHP 0
JS 0


Statement of a variable

Java typeVariable nomVariable
VB.NET Dim nomVariable typeVariable ace
C typeVariable nomVariable
Delphi nomVariable: typeVariable
PHP $nomVariable
settype ($nomVariable, typeVariable)
JS var typeVariable nomVariable


Statement of a constant

Java final typeConstante nomConstante
VB.NET Const nomConstante ace typeConstante
C const typeConstante nomConstante
Delphi const typeConstante nomConstante
PHP define (nomConstante, valeurConstante) (no $)
JS const typeConstante nomConstante


Statement of a function

Java typeRetour nomFonction (type var1, portrays var2...)
VB.NET Function nomFonction (var1 ace portrays, var2 ace portrays) ace typeRetour
C typeRetour nomFonction (type var1, portrays var2...)
Delphi nomFonction (var1: type; var2: type;): typeRetour
var
//Variables

begin
//Code
end;
PHP function nomFonction (var1, var2...)
function nomFonction (nomClasse objet1, objet2...)
The typage is possible (but facultative) for objects only.
JS function nomFonction (var1, var2...)


Return of value of a function

Java return value
VB.NET return value
C return value
Delphi return value
PHP return value
JS return value


Declare a procedure

Java void nomProcedure (type var1, portrays var2...)
VB.NET Sub nomProcedure (var1 ace portrays, var2 ace portrays...)
C void nomProcedure (type var1, portrays var2...)
Delphi nomFonction (var1: type; var2: type;...)
var
//Variables

begin
//Code
end;
PHP function nomFonction (var1, var2...)
function nomFonction (nomClasse objet1, objet2...)
The typage is possible (but facultative) for objects only.
JS function nomFonction (var1, var2...)


Call of a method

Java nomMethode (param1, param2)
VB.NET nomMethode (param1, param2)
C nomMethode (param1, param2)
Delphi nomMethode; (if any defines)
nomMethode (param1, param2)
PHP nomMethode (param1, param2)
JS nomMethode (param1, param2)


Declare a structure

Java
VB.NET Structure
 Dim nomVariable typeVariable Ace 
Dim nomVariable typeVariable Ace
End Structure
C struct nomStructure {
 nomChamp type; 
nomChamp type;
} [nomStructure];
Delphi type nomStructure=Record
 nomVariable: typeVariable; 
nomVariable: typeVariable;
end;
PHP
JS


Access to a field of a structure

Java
VB.NET nomStructure.nomChamp
C nomStructure.nomChamp
nomStructurePointee-> nomChamp
Delphi nomStructure.nomChamp
PHP
JS


No entrance of the programme

Java public static void hand (G-string [] args)
VB.NET Public Shared Sub Main (args Ace G-string ())
C int hand (int argc, tank ** argv)
Delphi
PHP
JS


Passage by value

Java By default for primitive types.
VB.NET By default for primitive types (mention of BYVAL).
C By default for primitive types.
Delphi By default for primitive types.
PHP By default for primitive types.
JS By default for primitive types.


Passage by address

Java By default for objects.
VB.NET By default for objects. Mention of BYREF for primitive types.
C By default for pictures, stuctures. Use of the gun-layers for primitive types.
Delphi By default for objects. Use of gun-layers or of mention var for primitive types.
PHP By default for objects.
JS By default for objects.


Condition

Java yew tree (condition) {

}
else {

}
VB.NET Yew tree condition Then

Else

End Yew tree
C yew tree (condition) {

}
else {

}
Delphi yew tree then condition
begin

end
                 else
begin

end;
PHP yew tree (condition) {

}
else {

}
JS yew tree (condition) {

}
else {

}


Numerous condition

Java switch (variable) {
 put value: instructions; station wagon; 

default: instructions; station wagon;
}
VB.NET Select variable
 Put value 
instructions
exit

Put else
instructions
exit
End Select
C switch (variable) {
 put value: instructions; station wagon; 

default: instructions; station wagon;
}
Delphi Put value of
 value: begin
instructions
end;
else: begin
instructions
end;
end;
PHP switch (variable) {
 put value: instructions; station wagon; 

default: instructions; station wagon;
}
JS switch (variable) {
 put value: instructions; station wagon; 

default: instructions; station wagon;
}


Loop of (value depart) in (arrived value)

Java for (initialization; condition; incrémentation) {

}
VB.NET For variable = valeurDepart To valeurFin

Next
C for (initialization; condition; incrémentation) {

}
Delphi for variable: =valeurDepart to valeurFin do
begin

end;
PHP for (initialization; condition; incrémentation) {

}
JS for (initialization; condition; incrémentation) {

}


As long as / Until (condition) to Make

Java while (condition) {

}
VB.NET While condition

End While


Do While / Until condition

Loop
C while (condition) {

}
Delphi while condition do
begin

end;
PHP while (condition) {

}
JS while (condition) {

}


Make so much that / Until (condition)

Java do {

}
while (condition)
VB.NET Do

While / Until condition
C do {

}
while (condition)
Delphi repeat

until condition;
PHP do {

}
while (condition)
JS do {

}
while (condition)


For every (element) in (list)

Java for (typeElement variableElement: variableListe) {

}
VB.NET For Each variableElement [Ace typeElement] In variableListe

Next
C
Delphi
PHP foreach ($variableListe ace $variableElement) {

}
JS for (variableElement in variableListe) {

}


With (object) Make

Java
VB.NET With variableObjet

End With
C
Delphi with variableObjet do
begin

end;
PHP
JS with (VariableObjet) {

}


Stop a loop

Java station wagon
VB.NET exit
C station wagon
Delphi
PHP station wagon
JS station wagon


Follow a loop

Java uninterrupted
VB.NET uninterrupted
C uninterrupted
Delphi
PHP uninterrupted
JS uninterrupted


Allocation

Java =
VB.NET =
C =
Delphi : =
PHP =
JS =


Arithmetic

Java +, -, *, / %
VB.NET +, -, / \, *, %, ^
C +, -, *, / %
Delphi +, -, / *, mod, div
PHP +, -, *, / %
JS +, -, *, / %


Compounds

Java +=, -=, *=, / =
VB.NET +=, -=, / =, \=, * =, % =, ^ =, &=
C +=, -=, *=, / =, &=, ¦ =,<<=, >> =
Delphi
PHP +=, -=, *=, / =, % =. =
JS +=, -=, *=, / =, % =


Incrémentation and décrémentation

Java ++, --
VB.NET
C ++, --
Delphi
PHP ++, --
JS ++, --


Comparison

Java ==, ! =!<, >, <=, >=
VB.NET =, <>, <, >, <=, >=
C ==, ! =!<, >, <=, >=
Delphi =, <>, <, >, <=, >=
PHP ==, ! =!<><, >, <=, >=, ===! == (types)
JS ==, ===, ! =! ==!<, >, <=, >=


Ternaire

Java (condition)? such a true code: such a wrong code
VB.NET
C (condition)? such a true code: such a wrong code
Delphi
PHP (condition)? such a true code: such a wrong code
JS (condition)? such a true code: such a wrong code


Bit with bit

Java &, |, ^, >>,<<, >>>
VB.NET <<, >>
C &, |, ^, ~, <<, >>
Delphi and, nor, and, xor, shl, shr
PHP &, |, ^, >>, <<, ~
JS &, |, ^, ~, >>,<<, >>>


Logic

Java &&, ||, !
VB.NET and, and, xor, not
C &&, ||, !
Delphi and, nor, and, xor
PHP and, and, xor! &&, ||
JS &&, ||, !


Concatenation

Java +
VB.NET &
C
Delphi +
PHP .
JS +


Group

Java
VB.NET in
C
Delphi in
PHP
JS in


Picture

Java []
VB.NET ()
C []
Delphi []
PHP []
JS []


Transtypage / Cast

Java variable (type)
VB.NET CTYPE (nomVariable, typeVariable)
DirectCast (nomVariable, typeVariable) (variable by reference)
Valley / G-string
Class Convert
C variable (type)
Delphi variable (type)
PHP variable (type)
JS


Control of error

Java
VB.NET
C
Delphi
PHP @
JS


Address (gun-layer)

Java
VB.NET
C &nomVariable
Delphi @nomVariable
PHP &nomVariable
JS


Contained (gun-layer)

Java
VB.NET
C *nomVariable
Delphi ^nomVariable
PHP
JS


Numerous inheritance?

Java No
VB.NET No
C
Delphi No
PHP No
JS


Class

Java class NomClasse {

}
VB.NET Class NomClasse

End Class
C
Delphi portray NomClasse = class

end.
PHP class NomClasse {

}
JS


Interface

Java interface NomInterface
VB.NET interface NomInterface
C
Delphi portray NomInterface = interface
PHP interface NomInterface
JS


Abstract class

Java abstract NomClasseAbstraite
VB.NET MustInherit NomClasseAbstraite
C
Delphi
PHP abstract NomClasseAbstraite
JS


Class dérivable not

Java final NomClasse
VB.NET NotInheritable NomClasse
C
Delphi
PHP final NomClasse
JS


Inheritance of a class

Java ClasseFille extends ClasseMere
VB.NET ClasseFille Inherits ClasseMere
C
Delphi portray ClasseFille = class (ClasseMere)
PHP ClasseFille extends ClasseMere
JS


Realisation of an interface

Java NomClasse implements NomInterface
VB.NET NomClasse Implements NomInterface
C
Delphi portray NomClasse = class (NomInterface)
PHP NomClasse implements NomInterface
JS


Attribute

Java typeAttribut nomAttribut
VB.NET typeAttribut Ace nomAttribut
C
Delphi nomAttribut: typeAttribut
PHP $nomAttribut
JS


Constant

Java final typeConstante nomConstante
VB.NET Const nomConstante Ace typeConstante
C
Delphi
PHP const nomConstante (not of $ coach defined in compilation)
Access by nomClasse:: nomConstante
JS


Static variable

Java static typeVariable nomVariable
Access: NomClasse.nomVariable
VB.NET Shared nomVariable typeVariable Ace
Access: NomClasse.nomVariable
C
Delphi
PHP static $nomVariable
Access: NomClasse:: nomVariable
JS


Access in attribute of the object

Java nomObjet.nomAttribut
VB.NET nomObjet.nomAttribut
C
Delphi nomObjet.nomAttribut
PHP nomObjet-> nomAttribut (no $)
JS nomObjet.nomAttribut


Abstract method

Java abstract nomMethode
VB.NET MustOverride nomMethode
C
Delphi abstract nomMethode
PHP abstract nomMethode
JS


Static method

Java static nomMethode
VB.NET Shared nomMethode
C
Delphi
PHP static nomMethode
JS


Rédéfinition possible of a method

Java
VB.NET Overridable nomMethode
C
Delphi virtual nomMethode
PHP
JS


Impossible Rédéfinition of a method

Java final nomMethode
VB.NET NotOverridable nomMethode
C
Delphi
PHP final nomMethode
JS


Rédéfinition of a method

Java
VB.NET Overrides nomMethode
C
Delphi override nomMethode
PHP
JS


Surchage of a method

Java
VB.NET Overloads nomMethode
C
Delphi overload nomMethode
PHP
JS


Synchronisation

Java synchronised nomMethode
VB.NET synclock nomMethode
C
Delphi
PHP
JS


Call of an inherited method

Java nomObjet.nomMethode (param1, param2...)
VB.NET nomObjet.nomMethode (param1, param2...)
C
Delphi inherited [NomMethode] (definite method otherwise it is that ongoing)
PHP nomObjet-> nomMethode (param1, param2...)
JS


Accèx methods of an object

Java nomObjet.nomMethode (param1, param2...)
VB.NET nomObjet.nomMethode (param1, param2...)
C
Delphi nomObjet.nomMethode (param1, param2...)
PHP nomObjet-> nomMethode (param1, param2...)
JS nomObjet.nomMethode (param1, param2...)


Definition of the constructor

Java public NomClasse (type param1, portrays param2...)
VB.NET public Sub New (param1 Ace portrays, param2 Ace portrays...)
C
Delphi constructor nomConstructeur (param1: type, param2: type...)
PHP public function __ construct (param1, param2...)
JS


Definition of the destroyer

Java public finalise ()
VB.NET Public Overloads Sub Dispose ()
C
Delphi destructor nomDestructeur ()
PHP public function __ destruct ()
JS


Accesseurs: get / jeu

Java No methods peculiar to language.

Recover an attribute:

getNomAttribut public () {
 return nomAttribut;  
}

Give information to an attribute:

public setNomAttribut (typeAttribut valeurAttribut) {
    nomAttribut=valeurAttribut; 
}
VB.NET Public Property nomPropriete Ace () typePropriete
    Get 
        Return valeurAttribut 
    End Get
Jeu (BYVAL VALEURATTRIBUT ACE TYPEATTRIBUT) nomAttribut = valeurAttribut End Jeu
End Property
C
Delphi property nomPropriete: typePropriete
   read nomChamp;//Reading 
   write nomMethode;//Writing 
PHP No methods peculiar to language.

Recover an attribute:

getNomAttribut public () {
 return $this-> nomAttribut;  
}

Give information to an attribute:

public setNomAttribut (typeAttribut valeurAttribut) {
    $this-> nomAttribut=valeurAttribut; 
}
JS


Class of the object root

Java Object
VB.NET Object
C
Delphi TOBJECT
PHP
JS


Instanciation of an object

Java ClasseObjet nomObjet = new ClasseObjet (parametres)
VB.NET Dim nomObjet Ace New ClasseObjet (parametres)
C
Delphi nomObjet: ClasseObjet
nomObjet.create (Parametres)
PHP $nomObjet=new ClasseObjet (parametres)
JS


Destruction of u object

Java nomObjet.finalise ()
VB.NET nomObjet. Finalize () (liberalisation postponed of memory by the garbage collector)

nomObjet. Refreshed () (immediate liberalisation of memory)
C
Delphi nomObjet.free
PHP nomObjet.destruct ()
unset (NomVariable)
JS


Common object

Java this
VB.NET Miss
C
Delphi self
PHP $this
JS this


Classify mother

Java great
VB.NET MYBASE
C
Delphi
PHP parent:: nomMethode
JS


Object (class) authority?

Java nomObjet instanceof nomClasse
VB.NET Simple percentage nomClasse TypeOf nomObjet
C
Delphi simple percentage nomClasse nomObjet
PHP nomObjet instanceof nomClasse
simple percentage _ [type] for primitive types
JS nomObjet instanceof nomClasse


Public

Java public
VB.NET public
C
Delphi public
PHP public
JS


Private

Java private
VB.NET private
C
Delphi private
PHP private
JS


Protégé

Java protected
VB.NET Protected
C
Delphi protected
PHP protected
JS


Package

Java (by default)
VB.NET Friend
C
Delphi published (?)
PHP
JS


Class of exceptions

Java Exceptions
VB.NET Exception
C
Delphi Exception
PHP Exceptions
JS


Capture an exception

Java try {

}
wrestling (Exception e) {

}
finally {

}
VB.NET Try

Wrestling ex Ace Exception

Finally

End Try
C
Delphi Try

Except
  One e: Exception Do  
End;
PHP try {

}
wrestling (Exception $e) {

}
JS try {

}
wrestling (Exception e) {

}
finally {

}


Throw an exception

Java Spread of exception
throws ClasseException

Throw exception in code
throw new ClasseException ()
VB.NET throw New ClasseException ()
C
Delphi raise ClasseException. Create ()
PHP throw new ClasseException ()
JS throw new ClasseException ()


Define a pack / project

Java package nomPackage
VB.NET Namespace nomProjet

End NameSpace
C
Delphi joins nomUnite
PHP
JS


Import a pack / class

Java import nomPackage / class
VB.NET Import nomProjet / class
C #include <fichier.h>: library of C
#include "Fichier.h": personal file
Delphi employ nomUnite
PHP include / include_once nomFichier.php
require / require_once nomFichier.php

require stops script if the file is untraceable.
JS


Write in the console

Java System.out.println ()
VB.NET System. Console. WriteLine ()
System. Diagnosis. Debug. WriteLine ()
C printf ()
Delphi
PHP
JS


Summed up on classes

Java public class Information {
   //Attributes 
   private G-string draws up; 

   //Constructor 
   public Information (G-string _libelle) { 
       this.libelle = _ draws up; 
   }

   //Methods 
   public void to show () { 
       System.out.println (lampoon); 
   }

   //No entrance 
   public static void hand (G-string [] args) { 
       objetInfos=new Information ("test "); 
       objetInfos.afficher (); 
  }
}
VB.NET Public Class Infos
   'Attributes 
   Private draws Ace G-string up 

   'Constructor 
   Public Sub New (BYVAL _libelle Ace G-string)  
       Me.libelle = _ draws up 
   End Sub 

   'Methods 
   Public Sub to show ()  
       MsgBox. Show (lampoon) 
   End Sub 

   'No entrance 
   Public Shared Sub Main (args Ace G-string ())  
       Dim objetInfos Ace New Infos ("test ") 
       objetInfos.afficher () 
   End Sub 
End Class
C
Delphi type
  TINFOS = class 

  //Attributes 
  private 
    lampoon: G-string;     
  public 
    constructor Create; 
    procedure to show (); 
  end; 

  implementation 

  //Constructor 
  constructor TMACLASSE. Create (_libelle: G-string); 
   begin 
     lampoon: = _ lampoon; 
   end; 

  //Method 
  procedure TMACLASSE.AFFICHER (); 
   begin 
     MessageBox. Show (lampoon); 
   end; 
end.

//Test
TINFOS: objetInfo.create ("test) (");
objetInfo.afficher ();
PHP public class Information {
   //Attributes 
   private $ lampoon; 

   //Constructor 
   public function __ construct (G-string _libelle) { 
        $this-> lampoon = _ lampoon; 
   }

   //Methods 
   public function to show () { 
       echo lampoon; 
   }
}

//Test
$objetInfos=new Information ("test ");
$objetInfos-> show ();
JS

- COPYRIGHT 2008/2009 - ALL RIGHTS RESERVED - WEBMASTER : UDUN (GIRARD CYRIL) - DESIGN PAR : ANTYOZ