Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #32521

Re: questions re Javascript

From Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid>
Newsgroups comp.lang.javascript, comp.lang.java.programmer
Subject Re: questions re Javascript
Date 2015-09-04 10:09 -0500
Organization A noiseless patient Spider
Message-ID <mscc3f$apc$1@dont-email.me> (permalink)
References <2b531f48-fff9-4c73-a116-22a3f110e919@googlegroups.com> <020920150828500988%timstreater@greenbee.net> <java-and-javascript-20150902121750@ram.dialup.fu-berlin.de>

Cross-posted to 2 groups.

Show all headers | View raw


On 9/2/2015 6:20 AM, Stefan Ram wrote:
>    There are so many similiarities between the two languages,
>    that I can't name them all.

Really? I can:

* Java and JS share the same core C-ish syntax (but not necessarily 
semantics) for expressions and statements.
* They both use a strictly-defined evaluation order instead of C's 
undefined evaluation order.
* A few method names (e.g., toString, or Math.sin) are the same.
* The JS Date object is explicitly modelled on Java's Date object 
(unfortunately).
* Their names start with the same first four letters.

That's really about it. Java and JS use hugely different internal 
representations, and the semantics are often vastly different. Most 
notably, JS has no integers, only IEEE754 doubles, and the == operator 
in Java corresponds to === in JS where == in JS is .equals() in Java.

For my part, calling the languages similar when semantics are so 
different does a disservice to neophytes attempting to learn one or the 
other. It's like saying English and French are similar, because they 
share the same grammatical constructs and many words are cognates. 
Peut-être il est vrai, mais on ne peut pas converser avec un autre sans 
apprendre à parler l'autre langue.

-- 
Beware of bugs in the above code; I have only proved it correct, not 
tried it. -- Donald E. Knuth

Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Re: questions re Javascript Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid> - 2015-09-04 10:09 -0500
  Re: questions re Javascript Tim Streater <timstreater@greenbee.net> - 2015-09-04 16:37 +0100
    Re: questions re Javascript Tim Streater <timstreater@greenbee.net> - 2015-09-04 22:51 +0100
      Re: questions re Javascript Eternal Hope <laughingspam99@gmail.com> - 2015-09-05 20:29 +0100
  Re: questions re Javascript "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-09-04 18:17 +0200
  Re: questions re Javascript Arne Vajhøj <arne@vajhoej.dk> - 2015-09-04 19:40 -0400
    Re: questions re Javascript Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-09-05 09:47 +0200
      Re: questions re Javascript Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-09-05 22:16 +0200

csiph-web