<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Making the Complex Simple &#187; ASP.NET</title>
	<atom:link href="http://simpleprogrammer.com/category/asp-net/feed/" rel="self" type="application/rss+xml" />
	<link>http://simpleprogrammer.com</link>
	<description>Software Development from John Sonmez&#039;s Perspective</description>
	<lastBuildDate>Tue, 07 Feb 2012 17:47:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='simpleprogrammer.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Making the Complex Simple &#187; ASP.NET</title>
		<link>http://simpleprogrammer.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://simpleprogrammer.com/osd.xml" title="Making the Complex Simple" />
	<atom:link rel='hub' href='http://simpleprogrammer.com/?pushpress=hub'/>
		<item>
		<title>Late to the JQuery Party</title>
		<link>http://simpleprogrammer.com/2010/07/14/late-to-the-jquery-party/</link>
		<comments>http://simpleprogrammer.com/2010/07/14/late-to-the-jquery-party/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 00:24:24 +0000</pubDate>
		<dc:creator>jsonmez</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Learning]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">https://complextosimple.wordpress.com/2010/07/14/late-to-the-jquery-party/</guid>
		<description><![CDATA[You may be wondering what happened to my usual Monday post. Well, I was having my head rearranged by JQuery.&#160; I have to admit, I am pretty late to the party.&#160; I haven’t really been using JQuery at all the past few years. I missed a lot. Goodbye type safety This part scares me a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=simpleprogrammer.com&amp;blog=10597120&amp;post=999&amp;subd=complextosimple&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>You may be wondering what happened to my usual Monday post.</p>
<p>Well, I was having my head rearranged by <a href="http://jquery.com/">JQuery</a>.&#160; I have to admit, I am pretty late to the party.&#160; I haven’t really been using JQuery at all the past few years.</p>
<p>I missed a lot.</p>
<p><a href="http://complextosimple.files.wordpress.com/2010/07/jquerylogo_png.png"><img style="display:inline;border-width:0;" title="jquery-logo_png" border="0" alt="jquery-logo_png" src="http://complextosimple.files.wordpress.com/2010/07/jquerylogo_png_thumb.png?w=302&#038;h=302" width="302" height="302" /></a> </p>
<h2></h2>
<h2>Goodbye type safety</h2>
<p>This part scares me a little bit.&#160; I already made a few typos that were pretty hard to detect.</p>
<p>Debugging javascript is not much fun considering that data and methods are both first class citizens.</p>
<p>But, the trade-off just might be worth it.</p>
<p>What we are losing in type safety, we are making up for in productivity and speed.&#160; It is really fast to manipulate a page using JQuery and to hook up events.</p>
<p>I still wish there was some way to have some sort of type safety when using JQuery or Javascript in general, but it really hurts my brain to try and think about how that would be possible.</p>
<p>Perhaps some kind of <a href="http://projects.nikhilk.net/ScriptSharp">Script#</a> / JQuery bastard child?</p>
<p>I know some people are doing Javascript unit testing.&#160; That would certainly make me feel safer not having type safety.</p>
<h2></h2>
<h2>Functional thinking</h2>
<p>I like the functional thinking paradigm.&#160; One of my <a href="http://trycatchfail.com/blog/">co-workers</a> was saying that he likes JQuery because it helps him to write Lamba expressions and LINQ queries.&#160; I tend to agree with him.</p>
<p>I’ve said it before, but I believe the next high abstraction of programming is thinking functionally.</p>
<p>So many pieces of code that I would have used code generation to produce in the past, I can now produce with Lambda expressions.</p>
<h2>It’s not all roses</h2>
<p>I do have some major issues with JQuery and Javascript in general.&#160; One of the big problems is that JQuery is not a language, and it’s not a library.&#160; It is a DSL built on top of a language.</p>
<p><strong>Bleeding all the way through the stack</strong></p>
<p>The downfall of this is that it is a very leaky abstraction.&#160; Abstractions are good because they allow us to think at a higher level.</p>
<p>Leaky abstractions are bad because they force us to context switch from a higher level of thinking down to a lower level.</p>
<p>In order to understand JQuery you must understand Javascript, the DOM and CSS to some extent.</p>
<p>Think for a second about all the “languages” or technologies you have to know to develop an ASP.NET web page using JQuery and MVC.</p>
<ul>
<li>ASP.NET MVC </li>
<li>HTML </li>
<li>C# or Visual Basic </li>
<li>JSON </li>
<li>Javascript </li>
<li>JQuery </li>
<li>CSS </li>
<li>Web Services / Rest </li>
<li>HTTP (You need to be able to debug all the coolness you are flinging back and forth.) </li>
</ul>
<p>When you have it all working, it is pretty slick.&#160; Very slick indeed, but it is not a sustainable model.&#160; It is complex and sprinkled with errors and gotchas.</p>
<p><strong>Debugging / readability</strong></p>
<p>When I am writing JQuery, although I feel like it is magical and cool, I also feel a little bit dirty.</p>
<p>Why?</p>
<p>Well, as clean as you try to write JQuery code, it can be pretty nasty.&#160; There is a lot of magic going on, and it is not very easily understandable.</p>
<p>Perhaps I’ll get better at expressing my intent clearly in JQuery code, but I am pretty sure it has to due in part with the leakiness of the abstraction layer, and that can’t really be cleaned up easily.</p>
<p>Debugging is also hell.&#160; I tried debugging through the validation library to see why my error messages weren’t showing up, and it was no picnic.</p>
<p>Javascript itself is notoriously difficult to debug, because objects can have methods dynamically added to them, and all the other little tricks, make it hard to look at a watch window and get anything useful out of an object.</p>
<h2>View logic</h2>
<p>One of the things I really enjoyed while writing JQuery code was putting the view logic where it really belongs.&#160; It is nice to have a language and a server separating the view logic from the model and presentation.</p>
<p>JQuery really allows you to put all the code that manipulates the view in one place, and on the client side, where it really belongs.</p>
<p>JQuery will make your HTML code so much cleaner and helps to actually plug the leaks in the HTML abstraction layer.&#160; (Although it isn’t perfect, especially when working with ASP.NET Web Forms.)</p>
<h2></h2>
<h2>Better late then never at all</h2>
<p>So I know I’m really late to the JQuery party, but I’m here now, and I am liking it.</p>
<p>Overall, I’d recommend taking a look at JQuery if you are like me and hadn’t really used it until now.&#160; It definitely is a valuable skill to develop and is growing at an <a href="http://trends.builtwith.com/javascript/JQuery">extremely rapid pace</a>.</p>
<h6>As always, you can subscribe to this <a href="http://feeds.feedburner.com/MakingTheComplexSimple">RSS feed</a> to follow my posts on Making the Complex Simple.&#160; Feel free to check out <a href="http://elegantcode.com/">ElegantCode.com</a> where I post about the topic of writing elegant code about once a week.&#160; Also, you can follow me on twitter <a href="http://twitter.com/jsonmez">here</a>.</h6>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/complextosimple.wordpress.com/999/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/complextosimple.wordpress.com/999/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/complextosimple.wordpress.com/999/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/complextosimple.wordpress.com/999/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/complextosimple.wordpress.com/999/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/complextosimple.wordpress.com/999/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/complextosimple.wordpress.com/999/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/complextosimple.wordpress.com/999/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/complextosimple.wordpress.com/999/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/complextosimple.wordpress.com/999/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/complextosimple.wordpress.com/999/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/complextosimple.wordpress.com/999/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/complextosimple.wordpress.com/999/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/complextosimple.wordpress.com/999/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=simpleprogrammer.com&amp;blog=10597120&amp;post=999&amp;subd=complextosimple&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://simpleprogrammer.com/2010/07/14/late-to-the-jquery-party/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/695e2a956b2dcb5ac45a7095b6ee338a?s=96&#38;d=retro&#38;r=PG" medium="image">
			<media:title type="html">jsonmez</media:title>
		</media:content>

		<media:content url="http://complextosimple.files.wordpress.com/2010/07/jquerylogo_png_thumb.png" medium="image">
			<media:title type="html">jquery-logo_png</media:title>
		</media:content>
	</item>
		<item>
		<title>C# vs Java Part 2: The Platforms (Web)</title>
		<link>http://simpleprogrammer.com/2010/02/04/c-vs-java-part-2-the-platforms-web/</link>
		<comments>http://simpleprogrammer.com/2010/02/04/c-vs-java-part-2-the-platforms-web/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 19:57:46 +0000</pubDate>
		<dc:creator>jsonmez</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://simpleprogrammer.com/?p=325</guid>
		<description><![CDATA[Back in the C++ days it wasn&#8217;t about the platform at all.  It was all about knowing the intricacies of the language and pointer manipulation. Modern programming languages are more about platforms and libraries than about the language themselves.  In both Java and C# knowing what libraries are available and how to use them is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=simpleprogrammer.com&amp;blog=10597120&amp;post=325&amp;subd=complextosimple&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Back in the C++ days it wasn&#8217;t about the platform at all.  It was all about knowing the intricacies of the language and pointer manipulation.</p>
<p>Modern programming languages are more about platforms and libraries than about the language themselves.  In both Java and C# knowing what libraries are available and how to use them is a much more important factor than knowing all the features of the language.  A developer who understands the platforms and base class libraries, will be able to accomplish more than a language expert, which is a stark contrast to how programming used to be.</p>
<p>One more note before I dive into the platforms.  When I use the term platform here, what I am really referring to is the technology platform, base class libraries, and frameworks in general.</p>
<p><strong>The Web</strong></p>
<p><em>Java</em></p>
<p>For a long time Java has been dominating this space.  If you are doing basic Java web development you will most likely be using Java EE 5 or Java EE 6 which used to be called J2EE.  Aside from that commonality, the rest is a very big question mark.  <a href="http://blog.taragana.com/index.php/archive/10-best-java-web-development-framework/">Here</a> is a list of 10 popular frameworks for developing a Java EE application.</p>
<p>Java web frameworks are huge, cross-cut many different concerns and the choices are daunting, but they are also very good.  For a long time while the .NET community was dragging and dropping controls onto a .aspx page, the Java community was building highly scalable model view controller (<a href="http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller">MVC</a>) frameworks with distinct separation of concerns.</p>
<p>Most Java web application frameworks are built on top of the basic framework available in Java SE, specifically around applets and beans.  The current generation of the base Java SE specification has been greatly simplified to make writing enterprise web applications much easier than it was in the past.  This is the point where the platform and tooling overlap a little bit.  After selecting a web framework for developing in Java (which pretty much all of them are MVC of some sort), if you have a tool which supports developing on that framework (IDE plugin), development on that framework can be very easy.</p>
<p>Here is the difficulty&#8230; information overload.  If you took a look at that list of Java web frameworks, you can see there are many of them to chose from, and each one requires pretty extensive research to understand.  Some of them even combine, like Struts + Spring.  In fairness though,  part of the proliferation of frameworks is due to the age of the platform.  If you can wade through the choices, and settle on a framework, most of the good ones are really good and proven.</p>
<p><em>C#</em></p>
<p>ASP.NET for a long time was analogous with Web Forms.  Up until the release of <a href="http://www.asp.net/(S(d35rmemuuono1wvm1gsp2n45))/mvc/">ASP.NET MVC</a> the only way to do C# web development was with ASP.NET Web Forms.  This technology was not bad.  It just did not have enough guidance.  It truly is amazing how easily you can drag and drop a control onto a page and have it automatically populated with data from your database and allow edits to that data all without writing a line of code.  Amazing, but in a &#8216;violate all separation of concerns, mix all my layers together,  look I&#8217;m accessing the database directly from the UI&#8217; type of way.</p>
<p>Now don&#8217;t get me wrong here.  I&#8217;m trying to be fair and honest, and Java took a beating in my <a href="http://simpleprogrammer.com/2010/02/01/c-vs-java-part-1-the-languages/">previous post</a> about languages; ASP.NET Web Forms is going to take one here.  With that said, yes, it is possible to write a good separation of concerns MVC style application using ASP.NET Web Forms.  And yes, it is possible to write an ASP.NET web forms application that properly uses business objects that use the data access layer and still bind the business objects or data transfer objects to the UI.  Before MVC was around, I built several ASP.NET applications which did exactly that.  The problem is that you really had to figure out creative ways to do it, and there wasn&#8217;t any kind of real guidance.  I always felt like the platform was trying to push me into dragging and dropping, like a little devil sitting on my shoulder saying &#8220;but it is so much easier to just bind that control directly to the database.  Look, the wizard will do it for you.&#8221;</p>
<p>Fortunately that problem has been solved with the ASP.NET MVC platform.  It is very new and still needs some maturing, but it encourages good design practices that separate the concerns.  Under the covers it is still using the Web Forms view engine as a default, but that can be swapped out with any number of view engines which are starting to pop up.  There still is a bit of a complexity issue with ASP.NET MVC in my opinion, especially in regards to AJAX.  I know that some of this has been solved, but some people will find it very difficult to come from a platform where you could drag and drop a server control, have a wizard to set it&#8217;s properties, and have the HTML automatically generated for you, to one where you have to hand code much of the HTML.  ASP.NET MVC uses HTML helper classes to help render the HTML for you, which is a good step, but I think it still has some room for improvement.</p>
<p>Microsoft has also done an excellent job of getting information out there about how to develop in ASP.NET MVC.  This is one of the areas where MVC shines.  When I go to search for how to develop on Sprint or Struts there are some tutorials, but nothing like the volume of information that is out there and easily accessible about ASP.NET MVC.</p>
<p><em>Rich Internet Applications (RIAs)</em></p>
<p>Quick blurb on this topic.  .NET and Java both have competitors to Adobe Flex and Air in this space: Silverlight and JavaFX respectively.  There really isn&#8217;t even a competition here between Silverlight and JavaFX.  JavaFX does not have a visual design and has some strange new language to learn which mixes layers of abstraction.  Silverlight gives you the full power of the .NET framework and uses a common design with Windows Presentation Foundation (WPF) through XAML.  I am not sure what Sun was thinking here.</p>
<p><em>Conclusion</em></p>
<p>It is very hard to compare the web platforms, without giving so many details about them.  I really haven&#8217;t even gone into very much depth at all.  Java EE has a much larger web platform, but it is also more fractured.  ASP.NET is only split between two technologies, but the MVC platform is not very mature at this point.  (Although it is growing and improving extremely fast.)  One consideration as a developer is specialization.  It is not possible to be an expert in every single web platform or framework.  If you going the Java route, you&#8217;d better pick carefully, because the nature of open source development leads to many dead projects.  A considerable investment in learning could be lost.  ASP.NET MVC is still a gamble at this point, but I think it is a good one, because Microsoft is devoting a large amount of resources to it and the adoption seems to be widespread.</p>
<p><strong>To be continued&#8230;</strong></p>
<p>I thought I was going to be able to cover more than the web in this post, but I didn&#8217;t realize how much there is about the web platform.  Tomorrow I will cover desktop development, and future sections will cover IO operations, databases and concurrency, and mobile.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/complextosimple.wordpress.com/325/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/complextosimple.wordpress.com/325/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/complextosimple.wordpress.com/325/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/complextosimple.wordpress.com/325/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/complextosimple.wordpress.com/325/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/complextosimple.wordpress.com/325/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/complextosimple.wordpress.com/325/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/complextosimple.wordpress.com/325/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/complextosimple.wordpress.com/325/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/complextosimple.wordpress.com/325/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/complextosimple.wordpress.com/325/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/complextosimple.wordpress.com/325/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/complextosimple.wordpress.com/325/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/complextosimple.wordpress.com/325/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=simpleprogrammer.com&amp;blog=10597120&amp;post=325&amp;subd=complextosimple&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://simpleprogrammer.com/2010/02/04/c-vs-java-part-2-the-platforms-web/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/695e2a956b2dcb5ac45a7095b6ee338a?s=96&#38;d=retro&#38;r=PG" medium="image">
			<media:title type="html">jsonmez</media:title>
		</media:content>
	</item>
	</channel>
</rss>
