Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

What is the exact border between the static and dynamic languages? I mean I am told the following parameters are the deciding factors:

  1. Compilation or interpretation
  2. Typing
  3. Runtime generation
  4. Dynamic evaluation

But when I see these parameters, I can find most of them (upto a major extent) in static languages too like late binding of C++, reflection in Java and C#, void or Object types etc. My question is,

  • with so much of dynamicness in these static languages, is it necessary to actually learn the dynamic languages?
  • I know C++, Java and C#. On the other hand, I know PHP and Javascript. My teacher recommends me to learn more dynamic languages like Python and Ruby. Is it really necessary to do so?
  • What is the commercial preference between these languages?

Thank you.

share

migration rejected from stackoverflow.com Mar 18 at 12:22

This question came from our site for professional and enthusiast programmers. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

closed as too broad by gnat, Kilian Foth, World Engineer Mar 18 at 12:22

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

To a programing language academic, dynamic and static languages pretty much exclusively refers to the type systems. This is often shorthand for statically typed or dynamically typed. It is also often mentioned, especially in classes, that a more correct term is statically checked types or dynamically checked types.

Static vs. dynamic type checking has nothing to do with the orthogonal concept of compiled vs. interpreted. I don't think anyone who is well educated on the topic believes the words dynamic / static to have anything to do with this. As for meta-programming (what you're calling runtime-generation) and eval, I can see why someone would consider that to be the meaning of dynamic. But in my years spent in a programming languages lab static vs. dynamic always meant types.

It is important to note that it is, in fact, possible to have both in a language, though it is rare, and often not very noticeable if a language has both static and dynamic checking. Java is an example of a language with both. Most people would consider Java a statically typed language, and I agree. But there is dynamic type checking done on method dispatch since it is possible to downcast objects to subclasses. Java's static type system is not sound and therefor dynamic checks are done. OCaml is a good example of an object-oriented language with a no dynamic checks because OCaml does not allow down casting.

share

Not the answer you're looking for? Browse other questions tagged or ask your own question.