• Post Reply Bookmark Topic Watch Topic
  • New Topic

static language versus dynamic language  RSS feed

 
Dan Bromberg
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In a Java book I am reading, the following statement was made which I don't understand:

"Java is a pretty good statically bound language. It is a lousy dynamic language".

My understanding is that static pertains to 'something that belongs to a class - not an instance of that class', but I'm not making the connection why it's dynamic property (opposite of static?) is "lousy".
Also, I see the word 'bound/bind' tossed around a lot but never saw a clear definition - any interpretations?

Thanks in advance to all who reply,
Dan
 
Campbell Ritchie
Marshal
Posts: 56545
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does it mean statically‑typed? Java® checks the types of all variables at compile time; that is static typing.

And which book is it?
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dan Bromberg wrote:My understanding is that static pertains to 'something that belongs to a class - not an instance of that class'

And you're quite right when describing the Java keyword 'static'; this is another meaning (as Campbell described).

Sometimes there just aren't enough adjectives to go around.

Winston
 
Dan Bromberg
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell,
The quote is on page 60 from O'Reilly's Programming Android, 2nd edition, under their Type Safety in Java section.
I'm still unclear what their point was but suspect it was an important one.
Dan
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66306
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From Wikipedia:

Wikipedia wrote:Dynamic programming language is a term used in computer science to describe a class of high-level programming languages which, at runtime, execute many common programming behaviors that static programming languages perform during compilation.


Nothing at all to do with the static keyword as used by Java.
 
Dan Bromberg
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmm... Wikipedia seemed particularly vague in their statement, "execute many common programming behaviors"...huh?!?
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suspect that what that statement means is that -due to Java's static nature- many checks are done at compile time, so the resulting JVM code need not perform them again. That becomes a problem if you add dynamic features (maybe via the use of a scripting language) that depend on certain checks to keep things from blowing up. The JVM does not normally need to check types at runtime, because the compiler does that. But in a dynamic language an array (for example) could contain wildly different types, so if you run that on a JVM along with "normal" Java code, things start to get tricky.

While we don't know the context, the statement as such strikes me as wrong. Java is a statically typed language, not a dynamic one, so it isn't a "lousy" dynamic language, it isn't one at all. The JVM can run lots of different languages though, dynamic and static, so maybe that's what he meant to say.
 
Dan Bromberg
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf,
Thanks for your thoughts.
Sorry that I am unable to provide a more in depth context in which the authors made the statement that I am confused by.
Dan
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!