Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Why does JavaScript syntax have some similarity with java?

 
Ranch Hand
Posts: 1527
8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why does java script syntax have some similarity with java? Example creation of String or ending statements with semicolon?

java script syntax as:


and in java as:
 
Saloon Keeper
Posts: 12157
258
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pretty much all programming languages evolved out of older languages. Java and JavaScript were both greatly inspired by the C/C++ language family, which in turn has its roots in Algol. You will find that many modern imperative programming languages look similar to Algol programs.

Usually a language appears because users of another language were happy with some features and not so happy with others. Things from Algol that were kept include assignment to a variable and string literals. BCPL (a precursor of C) changed the assignment operator from := to =.
 
Marshal
Posts: 67424
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JavaScript not "java script"
 
Monica Shiralkar
Ranch Hand
Posts: 1527
8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

You will find that many modern imperative programming languages look similar to Algol programs.



Thanks. Python looks different from such syntax of java and java script. Does it follow something else?
 
Bartender
Posts: 1868
81
Android IntelliJ IDE MySQL Database Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Some languages may borrow elements/ides from older languages like BASIC or COBOL aside from C. Then again they may not. Most of the times the language web site will have some historical information which can be very interesting.
 
Being a smart alec beats the alternative. This tiny ad knows what I'm talking about:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic