Skip to content

An adaptation of classical programming languages (PHP, C#, C++, Java) behaviours in JavaScript, without any emulation, parsing or compiling.

License

Notifications You must be signed in to change notification settings

rodyhaddad/classicaljs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Classical.js

Classical.js is an adaptation of the OOP concepts of classical programming languages (PHP, C#, C++, Java) behaviours in JavaScript, without any emulation, parsing or compiling.

Usage

var Person = Class("Person", function () {

  Private ("firstName");
  Private ("LastName");
  
  Public (function setFirstName(firstName){
    this.firstName = firstName;
  });

  Public (function setLastName(lastName){
    this.lastName = lastName;
  });
  
  Public(function getFullName(){
    return this.firstName + " " + this.lastName;
  });
  
})


var Programmer = Class("Programmer").Extends("Person")

  Private ("knownProgrammingLanguages");
  
  Constructor (function(){
      this.knownProgrammingLanguages = [];
  })
  
  Public (function addKnownLanguage(languageName){
    this.knownProgrammingLanguages.push(languageName);
  })
  
  Public (function summary(){
      return this.getFullName() + " knows the following languages: " + this.knownProgrammingLanguages.join(", ");
  })
  
End()

var me = new Programmer();

me.setFirstName("Rody");
me.setLastName("Haddad");

me.addKnownLanguage("HTML");
me.addKnownLanguage("CSS");
me.addKnownLanguage("JavaScript");
me.addKnownLanguage("PHP");

console.log(me.summary()); //Rody Haddad knows the following languages: HTML, CSS, JavaScript, PHP 

##Notes

I'm currently working on writing the complete documentation in this Repository's Wiki (just click above on "Wiki" to see the progress :) )

Many new features have been added (Plugins, Imports, etc.), but they're not 100% stable.
They are being developed in the dev branch.
Once they're stable and test proof, they will be merged to the master branch.

About

An adaptation of classical programming languages (PHP, C#, C++, Java) behaviours in JavaScript, without any emulation, parsing or compiling.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published