views:

58

answers:

4

Can all JavaScript functionalities be theoretically replaced with Silverlight? If yes, I can save my time and just learn Silverlight.

+2  A: 

I recommend that you learn JavaScript as well as Silverlight.

Silverlight is a product of Microsoft. Being proprietary, it may or may not be popular or even exist a few years down the road. JavaScript (ECMAScript) is an open standard and is supported natively by all browsers. Knowledge of JavaScript will be useful for any web site project.

Mark Eirich
A: 

Theoretically, yes, Sliverlight could replace JavaScript, as could Flash.

But you have to remember that JavaScript is always faster than Silverlight (or Flash), and therefor better for most tasks.

Alexander
What is the reason that JavaScript runs faster than Silverlight? In my understanding JavaScript is interpreted while Silverlight gets compiled. Maybe I am wrong. :D
xport
-1: JavaScript is not faster than Silverlight or Flash.
musicfreak
what @musicfreak says.
Jaanus
JavaScript engine in most browsers is HIGHLY optimized for speed and efficiency. Having other browsers engines improve also helps with this, as it breeds friendly competition on who can make the fastest engine.With Silverlight, it's a single environment built by Microsoft (who isn't know for fast programs). Compiling the code doesn't make much difference, as it still needs to download and initialize (in the case of JavaScript, the code is executed immediately after it's downloaded).
Alexander
@TheLifelessOne: "Compiling the code doesn't make much difference" -- You obviously don't know much about compilers and virtual machines. Statically-typed and compiled code will run loads faster than JavaScript, no matter how well the JavaScript virtual machine is written. And, for your information, Microsoft's compilers actually produce pretty fast programs. Have you actually done a benchmark comparing JS performance to Silverlight?
musicfreak
+1  A: 

Theoretically yes. Just remember that only about 60% of internet-enabled computers have it installed. And don't forget all the accessibility issues associated with using a plugin instead of using native browser functionality.

Only use it if you absolutely need a feature of Silverlight that HTML/JavaScript cannot provide, and even then, it would probably be better to use Flash because of its install base.

musicfreak
Learning Flash Action script will need extra time to spend. It is what I want to avoid. The benefit of learning Silverlight is the ease to migrate to WPF--because Silverlight is "derived" from the model of WPF.
xport
@xport: I still wouldn't recommend it unless you plan to use features specific to Silverlight, and even then it should gracefully degrade if possible. Read my answer here: http://stackoverflow.com/questions/2824343/why-shouldnt-i-use-flash/2824567#2824567 (it applies to Silverlight as well).
musicfreak