views:

191

answers:

5

I'm working with C# and WPF and I would like to study something related to web programming. I already know HTML and CSS, and since I'm working with WPF, I am wondering if going into Silverlight is a good choice to start web developing. Can it be a substitute of server-side programming languages, like PHP or ASP .NET?
What do you suggest?
Thank you very much

+4  A: 

Silverlight is a plugin, similar to Flash. It doesn't replace ASP.NET, but certainly compliments it.

As for it being a logical step from WPF - YES! Silverlight is actually a subset of WPF and most of what you've learned from WPF will directly transfer to Silverlight. You would just need to learn a little bit about putting up a page to imbed your Silverlight app onto, which if you are using Visual Studio would just be a very simple ASP.NET page.

Ryan Hayes
What about dynamic content management? For example, if I want to add a forum to my web site, can it be managed from the silverlight plugin? If I correctly understand your answer, I need to know server-side languages only to embed the silverlight app into a web page. Right? Thank you again.
Maurizio Reginelli
Well, silverlight is a web client, which just happens to be almost identical to a desktop client, just presented in the browser. Data is still transferred across the web and an html page (or the like) is still sent and rendered. So, the C# is server code and the XAML is client code. It just happens happens that with Silverlight the client is on the web and not on a local machine. Does that make sense? You will need to know both client and server pieces of the web app, but they will look very, very similar and code very, very similar to the desktop version - by design.
Ryan Hayes
+1  A: 

When I consider use cases for Silverlight, I generally try to think of a few things:

  • Does the application I'm trying to develop require easy cross-platform deployment via the web browser?
    • Silverlight is more accessible than WPF in that it is available in multiple browsers on multiple platforms.
  • Is the application that I need to develop complex enough (or "rich enough") that I would benefit from the streamlined approach of developing for the Silvelright client?
    • Writing web applications that look great in multiple browsers can be a real challenge. In general, an html-based solution (as in ASP.NET, PHP, Ruby-on-rails, pick your poison) is going to be most accessible to the widest audience, but it might take longer to build because of having to deploy to multiple browsers.
    • However, if the solution you're developing is a complex client application akin to what you would find on the desktop, Silverlight should offer your end user a richer experience and the developer a more streamlined approach.

We've all seen both good and bad implementations of Silverlight applications.

The best Silverlight applications provide a rich user experience and should easily justify to the user why Silverlight was needed. For example, I think a great use case for Silverlight is a company writing a "business-to-business" application that their customers, vendors, and/or other business partners can use to interact with data in their domain. It's not the ideal solution for replacing a public-facing website, but it should be considerably less expensive to develop a Silverlight "business solution" than writing it in purely html-related technologies.

On the flip side, the worst implementations of Silverlight are ones that could easily be replaced by html with some javascript thrown in for UI support. I'm thinking of sites that are thrown together entirely in Silverlight with no styling that simply are trying to present blog content. What in this type of application tells the user that it was worth it for them to download Silverlight to use their application?

I hope this helps to answer your question.

Ben McCormack
+6  A: 

It lets you write .net code in an extremely rich, cross-platform environment.

Silverlight not only works in and out-of-browser on the PC and the Mac, but it's the primary tool for creating apps on the upcoming Phone 7 (which I believe will become the enterprise mobile platform of choice). Soon you will even be able to work against the xbox!

A lot of the top industry guys seem to be saying that a huge chunk of line-of-business apps will be written in Silverlight in coming years. It's a very exciting platform, and now that Silverlight 4 is out, it finally appears to be ready for primetime.

There is a learning curve. Xaml, data access (not only is there a tricky asychronous aspect to it, unlike PHP and ASP.NET you have to use RIA or something like Web Services to get at your data), a more involved event system, and other new concepts conspire to make it a bit complicated.

Brian MacKay
+1 for cross platform and essentially learning about Windows Phone 7, Xbox, and Web all at the same time.
Ryan Hayes
A: 

Silverlight is not a good choice to start web development.

It doesn't and will never substitute a server side web language such as ASP.NET. But it does a good job by offering a good RIA interface and fancy animation for the client side.

When it comes to database communication, especially for large dynamic applications with a lot of stress, Silverlight becomes a weak choice compared to ASP.NET

So you should definitely start your venture into the world of Web with ASP.NET, and maybe use Silverlight for certain purposes, mostly related to animation and high quality client side interfaces.

As a matter of fact, if something might get substituted in the future, it's both Flash and Silverlight by nothing else than HTML 5.

SiN
Your facts are wrong. 1. There are several frameworks that allow a complex application to be developed entirely in Silverlight with no ASP.NET, just a very simple data layer on the server side. So Silverlight **can and does** "substitute for a server side web language such as ASP.NET." Today. 2. With the right data layer, Silverlight is a **stronger** choice than ASP.NET for database communications in large dynamic applications. This is because a. the data fetch can proceed in the background and b. the data stream can be customized to precisely what the user is doing.
Ray Burns
Data fetch can proceed in the background with AJAX on any server side language, server side logic is a lot faster than Web Services that client side platforms like Flash and Silverlight use.Anyway don't have the time to argue, and don't care about reputation scores. And my facts are true.
SiN
Your opinions are your own, but I have no doubt that HTML5 and its successors will always be 10+ years behind the likes of Silverlight, and thus will ever only be used by those forced by politics or ignorance to use them. I loved a comment I saw here on StackOverflow that went something like this: "I agree that ASP.NET web applications are now on a par with desktop applications ... of 10 years ago." True? True.
Ray Burns
Data fetch can proceed in the background with AJAX, **but** to make it as efficient as Silverlight you have to hand-code the prefetch and caching algorithms in JavaScript. Painful.
Ray Burns
It is silly to claim that ASP.NET code is faster than Web Services for retrieving data: Both retrieve the same data and implement server-side logic, but ASP.NET also has to construct and render HTML and the web service doesn't. So Web Services will always beat ASP.NET performance-wise.
Ray Burns
A: 

You could also just start out with WPF in XBAP's - as many of the other answeres say, it really depends on what you wish to do. Partial trust XBAP's combined with WCF for data really works for me.

Goblin