<?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/"
	>

<channel>
	<title>Who So &#187; ASP.Net</title>
	<atom:link href="http://www.trondhuso.no/blog/category/webdevelopment/asp-net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.trondhuso.no/blog</link>
	<description>Blog about PHP, HTML, CSS, patents and all things inbetween</description>
	<lastBuildDate>Tue, 20 Dec 2011 23:45:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>PHP-Tip: Commenting your code</title>
		<link>http://www.trondhuso.no/blog/2010/05/17/php-tip-commenting-your-code/</link>
		<comments>http://www.trondhuso.no/blog/2010/05/17/php-tip-commenting-your-code/#comments</comments>
		<pubDate>Mon, 17 May 2010 20:52:32 +0000</pubDate>
		<dc:creator>Trond Husø</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[commenting]]></category>

		<guid isPermaLink="false">http://www.trondhuso.no/blog/?p=248</guid>
		<description><![CDATA[This really isn&#8217;t a PHP-tip, but more like a programming tip. But since I do most of my development in PHP (and some in C#, and some on VB) I put it up as a PHP-tip. So there. This post is all about commenting. Some do it, some don&#8217;t. I tend to do it. Sometimes [...]]]></description>
			<content:encoded><![CDATA[<p>This really isn&#8217;t a PHP-tip, but more like a programming tip. But since I do most of my development in PHP (and some in C#, and some on VB) I put it up as a PHP-tip. So there.<br />
This post is all about commenting. Some do it, some don&#8217;t. I tend to do it. Sometimes I even comment to much. But that&#8217;s sometimes better than not doing it at all.<br />
Why should you comment your code: </p>
<ol>
<li>Because sometime in the future you might have to go back to the code and fix it. It&#8217;s always nice to know what the initial idea was. And with years and years of programming, you now know a better way to do it. If you don&#8217;t have the comment, you have to analyze your own code much more thoroughly.</li>
<li>If someone else is going to work with your code, it is always nice for them to read your comments. It makes it easier for them to understand the code and to get into it.</li>
<li>It can be fun looking at the comments you&#8217;ve written. I recently looked over some code I did back in 2005(ish) and here I write: &#8220;<em>This part is done in an amazingly stupid way</em>&#8221; or what about: &#8220;<em>I must do this to keep the string value</em> (line break and some code)<em>Really&#8230;????</em>&#8220;.<br />
I posted this on twitter and I got an answer from Frank W. Zammetti (<a href="http://twitter.com/fzammetti">fzammetti</a>):  <em>&#8220;The person that wrote this is a grade A a**hole&#8230; oh wait, it was me!&#8221; <strong>I wrote that one once.</strong></em><br />
I just couldn&#8217;t stop laughing.
</ol>
<p>This is my style of commenting (example in PHP/C/C++/C#-style)<br />
My first line in the file is always the name of the file. This is a habit I&#8217;ve grown to use. It is smart when you are editing code in e.g. VI where you not necessary get the name of the file in the titlebar.<br />
<code><br />
<?php</p>
<p>// name-of-file.php</p>
<p></code></p>
<p>Next comes a general description of what the code in the file shall do:<br />
<code><br />
/**<br />
 * This file is used to create and edit blog posts<br />
 *<br />
</code><br />
Eclipse, Komodo-IDE and NetBeans (And probably other IDEs) supports @todo in the comment. By adding this "tag" you add tasks to your tasks list.<br />
I tend to add tasks in the beginning of the file.<br />
<code><br />
 * @todo: This file need some work.<br />
 * @todo: Fix the code related to creating blog posts<br />
</code><br />
In the same area I also write out bugs that I have fixed, or tasks that I have completed:<br />
<code><br />
 * FIXES:<br />
 * 01.01.2010: Fixed a bug related to updating a blogpost<br />
 * 17.05.2010: Translated all of the comments from Norwegian to English<br />
 */<br />
</code><br />
(note/suggestion) I wouldn't mind if the IDEs could have a @fixed element that I could add to the end of the line so that the IDE could mark out the task as completed.</p>
<p>Then in the code I can comment like this (note that PHP-example is just as an example here):<br />
<code><br />
// Fixing the string so that it is ready for SQL-input<br />
$string = mysql_real_escape_string($string);</p>
<p>// Creating a string for a dropdown-menu.<br />
foreach ($this as $that) {<br />
   $string .= $that;<br />
}<br />
</code></p>
<p>I also sometimes use comments to clear my head or to get a clear overview of the task at hand. This is especially important when you feel that the task is complicated.<br />
An example could be:<br />
<code><br />
/**<br />
 * In this section we shall create the tree-view.<br />
 * We must remember that all nodes starting with W shall be at the top<br />
 * And that we shall mark posts with pictures with a (p) or a small icon<br />
 * Also remember that no lines can be longer than 25 characters. Check the <strong>left</strong> syntax in mySQL...<br />
 */<br />
</code></p>
<p>This is also good practice when you sometimes do not return to the code in a couple of days. An example could be:<br />
<code><br />
/**<br />
 * continue here on Monday.<br />
 * The idea behind the following section is ... .... .. . . ..<br />
 */<br />
</code></p>
<p>Hope this post regarding commenting your code is of any help for you. If you have any great examples of self criticism in your code, please do post them as comments... (No pun intended)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.trondhuso.no/blog/2010/05/17/php-tip-commenting-your-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP vs ASP.Net</title>
		<link>http://www.trondhuso.no/blog/2010/01/20/php-vs-asp-net/</link>
		<comments>http://www.trondhuso.no/blog/2010/01/20/php-vs-asp-net/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 08:00:11 +0000</pubDate>
		<dc:creator>Trond Husø</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.trondhuso.no/blog/?p=174</guid>
		<description><![CDATA[Well, this isn&#8217;t really a VS-blog-post, I just had a discovery while reading up on ASP.Net (Professional ASP.Net 2.0) and I see here that PHP has a way to go when it comes to make web development more productive. Yes we have more control on our code and so on, but the .Net Framework and [...]]]></description>
			<content:encoded><![CDATA[<p>Well, this isn&#8217;t really a VS-blog-post, I just had a discovery while reading up on ASP.Net (Professional ASP.Net 2.0) and I see here that PHP has a way to go when it comes to make web development more productive.<br />
Yes we have more control on our code and so on, but the .Net Framework and Visual Studio just makes things quite attractive for web developers.<br />
<em>I never really believed that I would ever write this in a blog post!</em><br />
I mean, there are components for everything.<br />
Want to create a login form? Drag it onto the canvas.<br />
What about a tree of data? Drag it onto the canvas &#8211; change the settings and boom.<br />
Want to create a portal? Use the .Net Portal Framework &#8211; which makes it possible for you to create something like Sharepoint! (well, that what it looked like in the book)</p>
<p>That is, is, is &#8230; awesome (<em>Again, I never really believed that I would ever write this in a blog post</em>)</p>
<p>There are of course cons related to .Net web application development.<br />
Configuring the IIS-server isn&#8217;t quite understandable, and you cannot go to the IIS.conf file to see what has been done to it in order to make it work like it is. So I would give Apache the victory here!</p>
<p>I have been working/maintaining/fixing on some websites that has been depended on .dll-files. One we recently had to upgrade from 1.1 to 3.5, and making it work under 3.5 wasn&#8217;t all that understandable &#8211; well at least not for me &#8211; but then again, I am still a Noob when it comes to .Net Web Application Development.<br />
Again, I&#8217;ll give PHP the advantage here as it is much easier to understand what has been done. the PHP.ini-file and such is easy to either go through or diff against the default PHP.ini to spot differences.</p>
<p>But for rapidness, especially when you start a project from scratch &#8211; ASP.Net gets one point. </p>
<p>This is where PHP must be heading. Yes it is easier to start with PHP. Or at least that is what used to be the best argument to start programming your dynamic web solution with PHP. But dragging, do some coding, and so on, will mean that .Net development will narrow the gap between PHP and ASP.Net.</p>
<p>According to websites PHP is still the most popular language to use when it comes to web development.<br />
A search on PHP and asp on GoogleFight returns:<br />
301.000.000 (301 million) results for PHP and 98.800.000 (98.8 million) results for asp<br />
ASP.net returns 30.400.000 (30.4 million) hits.</p>
<p>TIOBE Programming Community Index for January 2010 tells us that PHP is on the rise. It&#8217;s on third place behind Java and C, but in front of C++. VB is in fifth while C# is on 6th place. I believe I would put those two together to get some ASP.Net figgures.<br />
The two/three languages below:<br />
3  	5  	  	PHP  	10.071%  	+1.19%  	  A<br />
5 	4 		(Visual) Basic 	7.354% 	-1.81% 	  A<br />
6 	6 		C# 	5.767% 	+0.16% 	  A</p>
<p>PHP is still my language of choice, but I will follow ASP.Net closely. .Net 2.0 is dated and so I need a book for 3.5&#8230; (and probably 4.0) to see what&#8217;s new. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.trondhuso.no/blog/2010/01/20/php-vs-asp-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

