Adventures in ASP.NET
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Adventures in ASP.NET
I took a bit of a break from PHP coding to get more comfortable with ASP.NET. I was looking into possibly using it to create a basic PBBG. However, I have come to the conclusion that it would be much more difficult to use for an RPG than PHP. 
ASP.NET is a great web platform. I was already quite familiar with C#, but if someone doesn't know how to use it, it could take a long time to first get up to speed with C# or VB.NET, and then learn the details of ASP.NET. However, it is an extremely powerful platform for enterprise applications. Master Pages is a great templating feature for webpage layouts that I wish was in PHP. The server control model can save tons of time as well, since you only have to add one ASP.NET element to the page, and it is rendered by the ASP.NET engine using one or more HTML elements, automatic Javascript code, etc. to render the element just right. ASP.NET AJAX also simplifies AJAX and Javascript development by freeing up the developer from dealing with browser differences.
With all of these pluses, I ran into some serious trouble trying to use ASP.NET for a web game. It is very hard to drop down into dynamic page writing, because ASP.NET works on a higher level. For enterprise applications where the form is static, and the data is dynamic, this works great, and really unclutters the page. I would use ASP.NET in a heartbeat over PHP for such tasks. But when both the form of the page and the data is dynamic, ASP.NET just isn't the easiest tool to use for the task. Instead of being able to make decisions in your HTML while rendering the page like PHP does, you have to create Page objects in your code, create instances of new ASP.NET elements and then use methods of the Page object to programmaticly add those ASP.NET elements to the page, and intersperse that with Placeholder objects which must be injected with text through C# code for all non-server control elements. Then it takes quite a bit more code to correctly arrange these dynamic elements on the page. This is quite a bit more work versus PHP. Making an entire PBBG (which uses tons of both dynamic page layouts and dynamic data) would be a nightmare in ASP.NET.
I hope maybe this has been helpful for anyone interested in using ASP.NET for browser-based RPGs.
			
			
									
						
							ASP.NET is a great web platform. I was already quite familiar with C#, but if someone doesn't know how to use it, it could take a long time to first get up to speed with C# or VB.NET, and then learn the details of ASP.NET. However, it is an extremely powerful platform for enterprise applications. Master Pages is a great templating feature for webpage layouts that I wish was in PHP. The server control model can save tons of time as well, since you only have to add one ASP.NET element to the page, and it is rendered by the ASP.NET engine using one or more HTML elements, automatic Javascript code, etc. to render the element just right. ASP.NET AJAX also simplifies AJAX and Javascript development by freeing up the developer from dealing with browser differences.
With all of these pluses, I ran into some serious trouble trying to use ASP.NET for a web game. It is very hard to drop down into dynamic page writing, because ASP.NET works on a higher level. For enterprise applications where the form is static, and the data is dynamic, this works great, and really unclutters the page. I would use ASP.NET in a heartbeat over PHP for such tasks. But when both the form of the page and the data is dynamic, ASP.NET just isn't the easiest tool to use for the task. Instead of being able to make decisions in your HTML while rendering the page like PHP does, you have to create Page objects in your code, create instances of new ASP.NET elements and then use methods of the Page object to programmaticly add those ASP.NET elements to the page, and intersperse that with Placeholder objects which must be injected with text through C# code for all non-server control elements. Then it takes quite a bit more code to correctly arrange these dynamic elements on the page. This is quite a bit more work versus PHP. Making an entire PBBG (which uses tons of both dynamic page layouts and dynamic data) would be a nightmare in ASP.NET.
I hope maybe this has been helpful for anyone interested in using ASP.NET for browser-based RPGs.
The indelible lord of tl;dr
			
						- hallsofvallhalla
- Site Admin
- Posts: 12026
- Joined: Wed Apr 22, 2009 11:29 pm
Re: Adventures in ASP.NET
you hit it right on the head. I did the same about 8 months ago when I started using ASP at work. Found it is not to kewl for games. They ended up making me do excel VBA coding more so I did not get a chance to get pro with it.
			
			
									
						
										
						- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Adventures in ASP.NET
Do you mean ASP or ASP.NET? They are actually completely unrelated 
			
			
									
						
							
The indelible lord of tl;dr
			
						- hallsofvallhalla
- Site Admin
- Posts: 12026
- Joined: Wed Apr 22, 2009 11:29 pm
Re: Adventures in ASP.NET
ASP.NET
			
			
									
						
										
						- 
				Baseball435
- Posts: 548
- Joined: Sun May 30, 2010 3:49 am
Re: Adventures in ASP.NET
What exactly is asp.net used for?
			
			
									
						
										
						- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Adventures in ASP.NET
Web development. Same as PHP, but it uses a different development model and has different features. It also runs on the Microsoft .NET platform.
			
			
									
						
							The indelible lord of tl;dr
			
						- 
				Baseball435
- Posts: 548
- Joined: Sun May 30, 2010 3:49 am
Re: Adventures in ASP.NET
Oohh is it a hard language to learn?
			
			
									
						
										
						- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Adventures in ASP.NET
It is much more complex than PHP or Javascript. It can be used with any .NET language, although almost all ASP.NET developers use either Visual C# or Visual Basic.NET. ASP.NET is technically much more powerful than PHP, but the power comes at a price of having 3 - 5x the learning curve. Also the underlying languages are full object-oriented, with some complex details such as generics, indexers, inheritance, delegates, events, etc. You really can't use a .NET language unless you fully understand object-oriented programming concepts such as inheritance, encapsulation and polymorphism. 
The .NET languages are easier to learn how to use well than, say, C++, but much more difficult than PHP.
			
			
									
						
							The .NET languages are easier to learn how to use well than, say, C++, but much more difficult than PHP.
The indelible lord of tl;dr
			
						- 
				Baseball435
- Posts: 548
- Joined: Sun May 30, 2010 3:49 am
Re: Adventures in ASP.NET
Ohhhh ok I see. I probably won't worry about learning that
			
			
									
						
										
						- hallsofvallhalla
- Site Admin
- Posts: 12026
- Joined: Wed Apr 22, 2009 11:29 pm
Re: Adventures in ASP.NET
also if you web server is linux you cannot use asp.net. Like all my hosting is done from a linux server so it keeps me from going very far with asp.net other than what I do at work.
			
			
									
						
										
						
