<?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>Elegant Code &#187; Jan Van Ryswyck</title>
	<atom:link href="http://elegantcode.com/author/jryswyck/feed/" rel="self" type="application/rss+xml" />
	<link>http://elegantcode.com</link>
	<description></description>
	<lastBuildDate>Sat, 18 May 2013 03:09:31 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Introducing node-validation</title>
		<link>http://elegantcode.com/2013/05/03/introducing-node-validation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=introducing-node-validation</link>
		<comments>http://elegantcode.com/2013/05/03/introducing-node-validation/#comments</comments>
		<pubDate>Fri, 03 May 2013 20:26:10 +0000</pubDate>
		<dc:creator>Jan Van Ryswyck</dc:creator>
				<category><![CDATA[Node.js]]></category>

		<guid isPermaLink="false">http://elegantcode.com/?p=6048</guid>
		<description><![CDATA[Some time ago I was looking for a validation library/module for use in a small Express application that I was writing at the time. I couldn’t find anything that suited my taste so I decided to write one myself just for kicks. The goal was learning how to publish a module to npm and making [...]]]></description>
				<content:encoded><![CDATA[<p align="justify">Some time ago I was looking for a validation library/module for use in a small <a href="http://elegantcode.com/2011/12/23/taking-toddler-steps-with-node-js-express/" target="_blank">Express</a> application that I was writing at the time. I couldn’t find anything that suited my taste so I decided to write one myself just for kicks. The goal was learning how to publish a module to <a href="https://npmjs.org/" target="_blank">npm</a> and making a futile attempt to contribute something back to the vibrant Node.js community. <a href="https://github.com/JanVanRyswyck/node-validation" target="_blank">node-validation</a> is a minimal but slightly opinionated validation library for Node.js. </p>
<p align="justify">Installing node-validation can be done using the canonical package manager:</p>
<blockquote><p align="justify"><font style="background-color: #ffffff"><em>$ npm install node-validation</em></font></p>
</blockquote>
<p align="justify">Validation rules must be defined in a custom validator by deriving from the base V<em><code><em>alidator</em></code>.</em></p>
<p align="justify"><em></em></p>
<pre class="csharpcode"><span class="kwrd">var</span> MyObjectValidator = <span class="kwrd">function</span>() {
    Validator.call(<span class="kwrd">this</span>);

    <span class="kwrd">this</span>.ruleFor(<span class="str">'stringProperty'</span>).isNotEmpty();
    <span class="kwrd">this</span>.ruleFor(<span class="str">'otherStringProperty'</span>).hasMaximumLength(10);

    <span class="kwrd">this</span>.ruleFor(<span class="str">'numericStringProperty'</span>).isNumber()
        .withMessage(<span class="str">'Oops, something is wrong ...'</span>);
    <span class="kwrd">this</span>.ruleFor(<span class="str">'dateStringProperty'</span>)
        .matches(/^(19|20)\d\d[-](0[1-9]|1[012])[-](0[1-9]|[12][0-9]|3[01])$/);

    <span class="kwrd">this</span>.ruleFor(<span class="str">'numberProperty'</span>).isInteger();
    <span class="kwrd">this</span>.ruleFor(<span class="str">'otherNumberProperty'</span>).isMaximum(5);

    <span class="kwrd">this</span>.ruleFor(<span class="str">'exoticProperty'</span>).<span class="kwrd">is</span>(<span class="kwrd">function</span>(value) {
        <span class="kwrd">return</span> 3 === value.propertyA + value.propertyB;
    }).withMessage(<span class="str">'Either propertyA or propertyB has an incorrect value.'</span>);
};

util.inherits(MyObjectValidator, Validator);</pre>
<p>&#160;</p>
<p align="justify">After creating a validator object, an object that needs to be validated (the subject) can be passed to the <code><em>validate</em></code> method. The <code><em>validate</em></code> method returns an array of validation errors specifying a message and the name of the violating property.</p>
<p>&#160;</p>
<pre class="csharpcode"><span class="rem">//</span>
<span class="rem">// Validation subject</span>
<span class="rem">//</span>
<span class="kwrd">var</span> subject = {
    stringProperty: <span class="str">''</span>,
    otherStringProperty: <span class="str">'Some string value that is too long ...'</span>,

    numericStringProperty: <span class="str">'65.85 invalid'</span>,
    dateStringProperty: <span class="str">'2013-04-30 invalid'</span>,

    numberProperty: <span class="str">'Some invalid number'</span>,
    otherNumberProperty: 48,

    exoticProperty: {
        propertyA: 1,
        propertyB: 1
    }
};

<span class="rem">//</span>
<span class="rem">// Now it's time to validate</span>
<span class="rem">//</span>
<span class="kwrd">var</span> validator = <span class="kwrd">new</span> MyObjectValidator();
<span class="kwrd">var</span> validationErrors = validator.validate(subject);

<span class="kwrd">for</span>(<span class="kwrd">var</span> i=0; i &lt; validationErrors.length; i++) {
    console.log(<span class="str">'Property name: '</span> + validationErrors[i].propertyName 
                + <span class="str">', Message: '</span> + validationErrors[i].message);
}</pre>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>&#160;</p>
<p align="justify">There you go. Head over to <a href="https://github.com/JanVanRyswyck/node-validation" target="_blank">the GitHub repository</a> and give it a try. I’m definitely looking forward to hear your feedback. </p>
]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2013/05/03/introducing-node-validation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Basic JavaScript: Prototypical Inheritance vs. Functional Inheritance</title>
		<link>http://elegantcode.com/2013/03/22/basic-javascript-prototypical-inheritance-vs-functional-inheritance/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=basic-javascript-prototypical-inheritance-vs-functional-inheritance</link>
		<comments>http://elegantcode.com/2013/03/22/basic-javascript-prototypical-inheritance-vs-functional-inheritance/#comments</comments>
		<pubDate>Fri, 22 Mar 2013 22:14:32 +0000</pubDate>
		<dc:creator>Jan Van Ryswyck</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://elegantcode.com/?p=6027</guid>
		<description><![CDATA[Inheritance in JavaScript has been the topic of many discussions in the past and will continue to be the source of future debates and arguments. While we do value composition over inheritance, we don’t want to throw the baby out with the bathwater either. So, from time to time, we run into these cases where [...]]]></description>
				<content:encoded><![CDATA[<p align="justify">Inheritance in JavaScript has been the topic of many discussions in the past and will continue to be the source of future debates and arguments. While we do value <a href="http://en.wikipedia.org/wiki/Composition_over_inheritance" target="_blank">composition over inheritance</a>, we don’t want to throw the baby out with the bathwater either. So, from time to time, we run into these cases where we want some notion of inheritance in JavaScript. Now what? </p>
<p align="justify">As with many things in JavaScript, there is not a single straight answer. We can choose between a couple of options and many different variations of these solutions. But one thing’s for sure: we can’t have it all!</p>
<p align="justify">In this blog post I want to discuss two different styles of inheritance that I have a hard time choosing from when programming JavaScript. And as with everything in life, both styles have their own pros and cons.&#160; </p>
<h4>Prototypical inheritance</h4>
<p align="justify">In ‘classical’ programming languages, one class can directly inherit from another class. JavaScript doesn’t have this notion of classes (yet). Instead, JavaScript has prototypes which you can augment to fit your own needs. This means that having a single augmented object as the prototype for other objects, which <em>‘inherit’</em> all members of the augmented prototype object, kind of simulates a <em>pseudo-classical</em> <em>inheritance</em> pattern. Let’s talk code in order to demystify this concept.</p>
<pre class="csharpcode" style="height: 559px; width: 100%"><span class="rem">// validator.js</span>
<span class="kwrd">var</span> Validator = exports.Validator = <span class="kwrd">function</span>() {
    <span class="kwrd">this</span>._rules = [];
};

Validator.prototype.addRule = <span class="kwrd">function</span>(rule) {
    <span class="kwrd">this</span>._rules.push(rule)
};

Validator.prototype.validate = <span class="kwrd">function</span>(instance) {
    ...
};

<span class="rem">// specificValidator.js</span>
<span class="kwrd">var</span> util = require(<span class="str">'util'</span>);

<span class="kwrd">var</span> SpecificValidator = <span class="kwrd">function</span>() {
    Validator.call(<span class="kwrd">this</span>);
};

util.inherits(SpecificValidator, Validator);

SpecificValidator.prototype.filter = <span class="kwrd">function</span>(instance) {
    ...
};

<span class="rem">// client.js</span>
<span class="kwrd">var</span> validator = <span class="kwrd">new</span> SpecificValidator();

<span class="rem">// Calls function on derived object</span>
validator.filter( { ... } );        

<span class="rem">// Calls function on base object</span>
validator.validate( { ... } );        </pre>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p align="justify">Here we have a constructor function named <em>Validator</em> which is the base object for other <em>‘derived’</em> objects. We augment the prototype with two functions (<em>addRule</em> and <em>validate</em>). Next we define another constructor function named <em>SpecificValidator</em>. We <em>‘derive’</em> this new&#160; constructor function by calling the base constructor function and wiring the prototype by using the <a href="http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor" target="_blank">util.inherits()</a> function from the Node.js core library.</p>
<p align="justify">We have to use the <em>new</em> keyword in order to instantiate a <em>SpecificValidator</em> object. Now we can use the functions that we added to the prototype.</p>
<h4>Functional inheritance</h4>
<p align="justify">This pattern is advocated by <a href="http://www.crockford.com/" target="_blank">Douglas Crockford</a> in his book <a href="http://elegantcode.com/2010/05/24/book-review-javascript-the-good-parts/" target="_blank">JavaScript, The Good Parts</a>. There he offers this particular style as the way to go for inheriting objects. Let’s look at an example.</p>
<pre class="csharpcode" style="height: 585px; width: 100%"><span class="rem">// validator.js</span>
module.exports = <span class="kwrd">function</span>() {
    <span class="kwrd">var</span> rules = [], my = {};

    my.addRule = <span class="kwrd">function</span>(rule) {
        rules.push(rule);
    };

    my.validate = <span class="kwrd">function</span>(instance) {
        ...
    };

    <span class="kwrd">return</span> my;
};

<span class="rem">// specificValidator.js</span>
<span class="kwrd">var</span> validator = require(<span class="str">'...'</span>).validator;

<span class="kwrd">var</span> specificValidator = <span class="kwrd">function</span>() {
    <span class="kwrd">var</span> my = validator();

    my.filter = <span class="kwrd">function</span>(instance) {
        ...
    };
    
    <span class="kwrd">return</span> my;
};

<span class="rem">// client.js</span>
<span class="kwrd">var</span> validator = specificValidator();

<span class="rem">// Calls function on derived object</span>
validator.filter( { ... } );    

<span class="rem">// Calls function on base object</span>
validator.validate( { ... } );        </pre>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p align="justify">The base constructor function returns an object that is augmented with functions and is returned at the end. The derived constructor function simple calls the base constructor function and further augments the retrieved object before returning it to the calling code. Here we don’t have to use the new keyword to instantiate anything. Just calling the right constructor function gives us an object which we can use in our client code. </p>
<h4>Conclusion</h4>
<p align="justify">The most important benefit of prototypical inheritance, at least in my humble opinion, is performance. By augmenting the prototype with functions, we only create these functions once. Not matter how many times we instantiate a constructor function, the same functions get (re)used every single time. Functional inheritance on the other hand creates new functions every time a constructor function is called, which is several orders of magnitude slower compared to the prototypical inheritance pattern.</p>
<p align="justify">On the other hand, the prototypical approach doesn’t come with encapsulation. Looking at the example shown earlier, the ‘_rules’ property is publicly available to the client code and can be manipulated at will. By using a simple convention, like prefixing with an underscore, we can indicate that these private members should not be touched in order to guarantee a correct behavior. But again, nothing can be enforced. Using functional constructors, we can have private variables and functions that cannot be manipulated by the calling code.&#160;&#160;&#160;&#160; </p>
<p align="justify">There are more pros and cons, but for me, these are the most important ones to be aware of. You can see that both styles have their strengths and weaknesses. I usually tend to go with prototypical inheritance as this is the ‘JavaScript way’, but I like using the functional approach as well for those cases were I know in advance that not too many objects are created or when I don’t care about performance.</p>
<p align="justify">I would love to hear other takes on this. What particular styles do you use? When do you use them and why?</p>
<p align="justify">Until next time </p>
]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2013/03/22/basic-javascript-prototypical-inheritance-vs-functional-inheritance/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Confessions of a Sublime Text-aholic</title>
		<link>http://elegantcode.com/2013/02/22/confessions-of-a-sublime-text-aholic/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=confessions-of-a-sublime-text-aholic</link>
		<comments>http://elegantcode.com/2013/02/22/confessions-of-a-sublime-text-aholic/#comments</comments>
		<pubDate>Fri, 22 Feb 2013 20:45:16 +0000</pubDate>
		<dc:creator>Jan Van Ryswyck</dc:creator>
				<category><![CDATA[Tools and Utilities]]></category>

		<guid isPermaLink="false">http://elegantcode.com/?p=5578</guid>
		<description><![CDATA[It’s true. I’m a Sublime Text addict. It’s by far my favorite development tool. End of story! Just to illustrate, earlier this week, a member of our development team asked how to quickly remove all empty lines from a very large text file. I quickly came up with the following: Press CTRL-F. Enable regular expressions [...]]]></description>
				<content:encoded><![CDATA[<p align="justify">It’s true. I’m a Sublime Text addict. It’s by far my favorite development tool. End of story!</p>
<p align="justify">Just to illustrate, earlier this week, a member of our development team asked how to quickly remove all empty lines from a very large text file. I quickly came up with the following:</p>
<ol>
<li>
<div align="justify">Press CTRL-F.</div>
</li>
<li>
<div align="justify">Enable regular expressions (the button entirely in the bottom-left corner).</div>
</li>
<li>
<div align="justify">Search for ^\s*$</div>
</li>
<li>
<div align="justify">Press ALT-ENTER (click on the “Find all” button).</div>
</li>
<li>
<div align="justify">Hit the backspace button.</div>
</li>
<li>
<div align="justify">Done!</div>
</li>
<li>
<div align="justify">Be merry …</div>
</li>
</ol>
<ol>Don’t just take my word for it. Just start using it!</ol>
]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2013/02/22/confessions-of-a-sublime-text-aholic/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Writing Fast, Memory-Efficient JavaScript</title>
		<link>http://elegantcode.com/2013/02/08/writing-fast-memory-efficient-javascript/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=writing-fast-memory-efficient-javascript</link>
		<comments>http://elegantcode.com/2013/02/08/writing-fast-memory-efficient-javascript/#comments</comments>
		<pubDate>Fri, 08 Feb 2013 19:44:32 +0000</pubDate>
		<dc:creator>Jan Van Ryswyck</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://elegantcode.com/?p=5555</guid>
		<description><![CDATA[Earlier this week, I read this great article titled “Writing Fast, Memory-Efficient JavaScript” by Addy Osmani. This is a highly recommended read for anyone involved in writing JavaScript code. The topics that I found to be particularly interesting were the apparent fact that it’s better to avoid the delete keyword and cached functions in the [...]]]></description>
				<content:encoded><![CDATA[<p align="justify">Earlier this week, I read this great article titled “<a href="http://coding.smashingmagazine.com/2012/11/05/writing-fast-memory-efficient-javascript/" target="_blank">Writing Fast, Memory-Efficient JavaScript</a>” by <a href="http://addyosmani.com/blog/" target="_blank">Addy Osmani</a>. This is a highly recommended read for anyone involved in writing JavaScript code.</p>
<p align="justify">The topics that I found to be particularly interesting were the apparent fact that it’s better to avoid the delete keyword and cached functions in <a href="http://elegantcode.com/2011/02/15/basic-javascript-part-10-the-module-pattern/" target="_blank">the module pattern</a>. The major down-side that I see when using cached functions is that you can’t have any private variables within your module. But this is highly interesting stuff, nonetheless.</p>
]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2013/02/08/writing-fast-memory-efficient-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Taking Toddler Steps with Node.js &#8211; Express Routing Revisited</title>
		<link>http://elegantcode.com/2013/02/01/taking-toddler-steps-with-node-js-express-routing-revisited/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=taking-toddler-steps-with-node-js-express-routing-revisited</link>
		<comments>http://elegantcode.com/2013/02/01/taking-toddler-steps-with-node-js-express-routing-revisited/#comments</comments>
		<pubDate>Fri, 01 Feb 2013 21:24:20 +0000</pubDate>
		<dc:creator>Jan Van Ryswyck</dc:creator>
				<category><![CDATA[Node.js]]></category>

		<guid isPermaLink="false">http://elegantcode.com/?p=5553</guid>
		<description><![CDATA[Last year I wrote this blog post where I described a couple of ways on how to tackle routing with Express. In the mean while I moved on from the “Plain Old School” approach to an approach where I replaced underscore.js with node-require-directory. Setting up node-require-directory is quite easy. In the routes folder, we just [...]]]></description>
				<content:encoded><![CDATA[<p align="justify">Last year I wrote <a href="http://elegantcode.com/2012/01/20/taking-toddler-steps-with-node-js-express-routing/" target="_blank">this blog post</a> where I described a couple of ways on how to tackle routing with <a href="http://expressjs.com/" target="_blank">Express</a>. In the mean while I moved on from the “Plain Old School” approach to an approach where I replaced <a href="http://underscorejs.org/" target="_blank">underscore.js</a> with <a href="https://github.com/TroyGoode/node-require-directory" target="_blank">node-require-directory</a>. </p>
<p align="justify">Setting up node-require-directory is quite easy. In the <em>routes</em> folder, we just need to add an <em>index.js</em> module with the following two lines:</p>
<pre style="width: 100%; height: 41px" class="csharpcode"><span class="kwrd">var</span> requireDirectory = require(<span class="str">'require-directory'</span>);
module.exports = requireDirectory(module);</pre>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p align="justify">Setting up the routes for Express then looks like this:</p>
<pre style="width: 100%; height: 169px" class="csharpcode"><span class="kwrd">var</span> routes = require(<span class="str">'./../routes'</span>);

<span class="rem">// Setting up an application ...</span>

application.get(<span class="str">'/'</span>, routes.root);
application.get(<span class="str">'/home'</span>, routes.home);
application.get(<span class="str">'/signin'</span>, routes.authentication.signin);
application.post(<span class="str">'/signout'</span>, routes.authentication.signout);

// More route registrations</pre>
<p align="justify">Here we simple reference the <em>index.js</em> module. The node-require-directory module takes care of building up a tree of functions which we can now access for our route registrations. Adding a new route is as simple as creating a new module somewhere inside the routes folder or one of its subfolders and creating a new route registration. Have a look at <a href="https://github.com/TroyGoode/node-require-directory/tree/master/test/example" target="_blank">this example</a>.</p>
<p align="justify">I found this little gem to be quite useful and it might be helpful for some of you as well.</p>
<p align="justify">Until next time.</p>
]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2013/02/01/taking-toddler-steps-with-node-js-express-routing-revisited/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visual Studio Light Edition</title>
		<link>http://elegantcode.com/2012/11/30/visual-studio-light-edition/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=visual-studio-light-edition</link>
		<comments>http://elegantcode.com/2012/11/30/visual-studio-light-edition/#comments</comments>
		<pubDate>Fri, 30 Nov 2012 21:08:42 +0000</pubDate>
		<dc:creator>Jan Van Ryswyck</dc:creator>
				<category><![CDATA[.Net 4.0]]></category>
		<category><![CDATA[Tools and Utilities]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://elegantcode.com/?p=5516</guid>
		<description><![CDATA[I noticed this blog post from Scott Hanselman the other day about Visual Studio Express 2012 for Windows Desktop. This post included a screenshot from the installation program. Something that really took me by the throat is this: Notice that the Express edition of Visual Studio seems to require no less than 4.15 GB of [...]]]></description>
				<content:encoded><![CDATA[<p align="justify">I noticed this blog post from Scott Hanselman the other day about <a href="http://www.hanselman.com/blog/FREEVisualStudioExpress2012ForWindowsDesktop.aspx" target="_blank">Visual Studio Express 2012 for Windows Desktop</a>. This post included a screenshot from the installation program. Something that really took me by the throat is this:</p>
<p align="justify"><a href="http://elegantcode.com/wp-content/uploads/2012/11/image1.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://elegantcode.com/wp-content/uploads/2012/11/image_thumb1.png" width="378" height="428" /></a></p>
<p align="justify">Notice that the Express edition of Visual Studio seems to require no less than <u>4.15 GB</u> of hard disk space! So I decided to try out the Professional edition of Visual Studio just to find out that it needs <u>7.56 GB</u> to install!</p>
<p><a href="http://elegantcode.com/wp-content/uploads/2012/11/image2.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://elegantcode.com/wp-content/uploads/2012/11/image_thumb2.png" width="377" height="427" /></a></p>
<p align="justify">Ask yourself, how on earth can an IDE that requires 7.56 GB to install be fast enough to even be usable at all? What kind of monster machine is required to not even choke to death when I accidentally open a second instance of Visual Studio? We&#8217;ve all seen those dreadful white screens of death, right? </p>
<p align="justify">Yes, I know that we&#8217;re living in 2012 and that disk space is very cheap. Yes, I know that RAM memory grow on trees these days and that CPU power is growing increasingly. But is this kind of footprint justified for an IDE that proclaims productivity? Or is it just me?</p>
<p align="justify">After recovering from my amazement I tried installing <a href="http://www.icsharpcode.net/opensource/sd/" target="_blank">SharpDevelop</a>, an open-source IDE for building .NET applications.</p>
<p align="justify"><a href="http://elegantcode.com/wp-content/uploads/2012/11/image3.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://elegantcode.com/wp-content/uploads/2012/11/image_thumb3.png" width="424" height="327" /></a></p>
<p align="justify">SharpDevelop seems to be more than happy with just a mere <u>64 Mb</u> of storage. I tried opening a large solution and it loads pretty darn fast. So, I should just shut up and go with SharpDevelop then? See, this is where I have to admit that I have a slight problem. </p>
<p align="justify">See, I depend heavily on Resharper for doing C# development. This amazing code-by-keystrokes tool is both a blessing and a curse. Any serious developer who builds .NET applications has to admit that whipping up some C# code without a tool like Resharper is incredibly painful, to say the least. This tool is truly a blessing and this is why I can&#8217;t go with SharpDevelop as my IDE of choice when building application for the .NET platform. But on the other hand, Resharper is not a stand-alone tool as it needs Visual Studio to host it. To me, this is a curse. </p>
<p align="justify">Visual Studio 2012 in it&#8217;s current form has become too heavily packed with features, which I don&#8217;t use anyway, so that&#8217;s it&#8217;s no longer usable for me to host Resharper. I&#8217;m no longer willing to make that tradeoff. I tried using Visual Studio 2012 with Resharper, but I turned back to Visual Studio 2010 after a short while. From a performance point of view, Visual Studio 2010 isn&#8217;t running great either. So I guess this is just a necessary evil that I have to overcome for building .NET 4.0 applications. </p>
<p align="justify">I understand that Microsoft&#8217;s business model is building platforms and tools for the world to use. It&#8217;s a business like any other business, focused on earning money. There&#8217;s nothing wrong with that. This is why Anders is so keen on <a href="http://www.typescriptlang.org/" target="_blank">statically typed languages</a>, because they require more tooling and tooling is what brings in the money for his division. It&#8217;s as simple as that. </p>
<p align="justify">But it doesn&#8217;t have to be all bad! What if the Visual Studio development team would come up with a stripped down version of Visual Studio? Think about how awesome this could be. What should be in the box? Just the basics! The code editor, the solution explorer, the debugger and the ability to host add-ons. No designers, no SQL Server integration, no TFS integration, etc. … Just the most basic features. That&#8217;s it! The installation footprint should be no more than 500 Mb, ideally only 100Mb. Wouldn’t that be awesome? This would be would actually solve my current development needs!</p>
<p align="justify">I hereby tag my fellow Elegant Coder David Starr, who recently joined the Visual Studio team at Microsoft. You can do it David!&#160; The best is yet to come!</p>
<p align="justify">So I&#8217;m eagerly awaiting the next release cycle of Visual Studio in order to see whether I&#8217;m up for a treat <img src='http://elegantcode.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> . </p>
<p>Until next time.</p>
]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2012/11/30/visual-studio-light-edition/feed/</wfw:commentRss>
		<slash:comments>39</slash:comments>
		</item>
		<item>
		<title>Steve Jobs &#8211; The Biography by Walter Isaacson</title>
		<link>http://elegantcode.com/2012/08/07/steve-jobs-the-biography-by-walter-isaacson/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=steve-jobs-the-biography-by-walter-isaacson</link>
		<comments>http://elegantcode.com/2012/08/07/steve-jobs-the-biography-by-walter-isaacson/#comments</comments>
		<pubDate>Tue, 07 Aug 2012 10:00:00 +0000</pubDate>
		<dc:creator>Jan Van Ryswyck</dc:creator>
				<category><![CDATA[Books]]></category>

		<guid isPermaLink="false">http://elegantcode.com/?p=5243</guid>
		<description><![CDATA[At first I was a bit skeptical whether I should spend time listening to the audio version of this book. I’ve heard and read both great things as well as bad things about the book. A few people recommended it, while a couple of others discouraged me from reading it. But after getting through only [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://elegantcode.com/wp-content/uploads/2012/08/image.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="image" border="0" alt="image" src="http://elegantcode.com/wp-content/uploads/2012/08/image_thumb.png" width="213" height="314" /></a></p>
<p align="justify">At first I was a bit skeptical whether I should spend time listening to the audio version of this book. I’ve heard and read both great things as well as bad things about the book. A few people recommended it, while a couple of others discouraged me from reading it. But after getting through only a few chapters I was completely hooked. </p>
<p align="justify">The book tells the life story of Steve Jobs from birth until his sad passing, describing the important moments of his life in a very open and honest way. </p>
<p align="justify">The part that I personally found the most interesting were the early years of Apple. There’s a lot of computer history in there that stems from when I was just an infant. These fascinating stories alone, like how the Mac and the IBM PC were rubbing shoulders, makes the book worthwhile. I’ve actually learned a lot from this book, especially about the events from the past that made Apple the company that it is today. </p>
<p align="justify">I never really considered myself an Apple fan. Heck, I don’t even follow what they are announcing at their conferences or events. I usually read about it days after in the newspapers. But while I was reading the book, I started noticing all the Apple devices that me and my family are using on a day-to-day basis. When did that happen? Did they sneak up on me or what? When I told my wife about this, she told me that I start rambling about replacing my three year old desktop with an iMac every time we walk by an Apple store or a retailer. Wow! This certainly didn’t help either. Perhaps it’s inevitable, I don’t know.</p>
<p align="justify">But what I do know is that I really enjoy using their devices (iPod, iPad, MacBook Pro, etc. …) and now I learned about the rationale behind it. And the scary part was that it all made sense as well. </p>
<p align="justify">This book tells the remarkable story of a passionate individual with a firm vision that will be remembered for many generations to come. If you’re a technologist, you just owe it to yourself to pick up a copy and read it.</p>
<p align="justify">Now I’m off reading a book on Bill Gates <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-winkingsmile" alt="Winking smile" src="http://elegantcode.com/wp-content/uploads/2012/08/wlEmoticon-winkingsmile.png" />.</p>
<p align="justify">Until next time. </p>
]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2012/08/07/steve-jobs-the-biography-by-walter-isaacson/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Blitz</title>
		<link>http://elegantcode.com/2012/07/24/blitz/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=blitz</link>
		<comments>http://elegantcode.com/2012/07/24/blitz/#comments</comments>
		<pubDate>Tue, 24 Jul 2012 10:00:00 +0000</pubDate>
		<dc:creator>Jan Van Ryswyck</dc:creator>
				<category><![CDATA[Tools and Utilities]]></category>

		<guid isPermaLink="false">http://elegantcode.com/?p=5229</guid>
		<description><![CDATA[The last couple of weeks I’ve been playing with a load testing tool called Blitz. You can create a free account which provides you the ability to ‘rush’ your web application with 250 concurrent users (or less) for 1 minute. And of course, you can increase both the number of concurrent users as well as [...]]]></description>
				<content:encoded><![CDATA[<p align="justify">The last couple of weeks I’ve been playing with a load testing tool called <a href="http://blitz.io" target="_blank">Blitz</a>. You can create a free account which provides you the ability to ‘rush’ your web application with 250 concurrent users (or less) for 1 minute. And of course, you can increase both the number of concurrent users as well as the duration of the load tests after you specify a credit card number. </p>
<p align="justify">The interface is pretty slick, as it provides you with a kind of command line interface.&#160;&#160; </p>
<p align="justify"><a href="http://elegantcode.com/wp-content/uploads/2012/07/image.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://elegantcode.com/wp-content/uploads/2012/07/image_thumb.png" width="445" height="102" /></a></p>
<p align="justify">Here I specified to run a load test, increasing the number of concurrent users from 1 to 12 over a period of one minute. The test is going to run from their datacenter in Ireland. You can choose from a couple of places in the US as well. </p>
<p align="justify">This command yields the following results.</p>
<p align="justify"><a href="http://elegantcode.com/wp-content/uploads/2012/07/image1.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://elegantcode.com/wp-content/uploads/2012/07/image_thumb1.png" width="588" height="493" /></a></p>
<p>Blitz also integrates with web application performance tools like <a href="http://newrelic.com/" target="_blank">New Relic</a> which enables you to further analyze the results and see what’s going on in your web application.</p>
<p>This is actually the first time ever that I had so much fun doing load tests <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-winkingsmile" alt="Winking smile" src="http://elegantcode.com/wp-content/uploads/2012/07/wlEmoticon-winkingsmile.png" />.</p>
<p>Until next time.</p>
]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2012/07/24/blitz/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Outliers &#8211; The Story of Success</title>
		<link>http://elegantcode.com/2012/07/17/outliers-the-story-of-success/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=outliers-the-story-of-success</link>
		<comments>http://elegantcode.com/2012/07/17/outliers-the-story-of-success/#comments</comments>
		<pubDate>Tue, 17 Jul 2012 10:00:00 +0000</pubDate>
		<dc:creator>Jan Van Ryswyck</dc:creator>
				<category><![CDATA[Books]]></category>

		<guid isPermaLink="false">http://elegantcode.com/?p=5221</guid>
		<description><![CDATA[A couple of weeks ago, I digested the audio version of Outliers – The Story of Success, written by Malcolm Gladwell. In this book, the author tells the story of a couple well-known and also lesser-known individuals that are considered to be successful. But what’s particularly interesting about this book, is the analysis the author [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.amazon.com/exec/obidos/ASIN/0316017930/elegantcode-20" target="_blank"><img style="margin: 0px auto; display: block; float: none" alt="A single marble is in the center, while a group of marbles is at the top." src="http://upload.wikimedia.org/wikipedia/en/thumb/b/be/Outliers.png/200px-Outliers.png" width="201" height="306" /></a></p>
<p align="justify">A couple of weeks ago, I digested the audio version of <a href="http://www.amazon.com/exec/obidos/ASIN/0316017930/elegantcode-20" target="_blank">Outliers – The Story of Success</a>, written by <a href="http://en.wikipedia.org/wiki/Malcolm_Gladwell" target="_blank">Malcolm Gladwell</a>. In this book, the author tells the story of a couple well-known and also lesser-known individuals that are considered to be successful. But what’s particularly interesting about this book, is the analysis the author makes to uncover the exact reason(s) that make these talented people stand out from the masses. </p>
<p align="justify">There seem to be several factors at play. Apparently, being talented isn’t enough on its own (duh). Getting opportunities and taking them, hard work (the famous <a href="http://www.gladwell.com/outliers/outliers_excerpt1.html" target="_blank">10.000 hour rule</a>) and perseverance are just a couple of reasons that pop up regularly throughout the book. But more stunningly are reasons like the month of the year that some of the people discussed are born to even the particular year itself. The author claims that this is the very reason why early geeks like Bill Gates, Steve Jobs, Paul Allen, Bill Joy, etc. … were so successful.&#160; The very year that these guys were born turned out to be a major part of their success.</p>
<p align="justify">Interested? Check out <a href="http://en.wikipedia.org/wiki/Outliers_(book)" target="_blank">this page on Wikipedia</a> that is devoted to this fascinating book. Make sure to pick up a copy. You won’t regret it!</p>
<p align="justify">Until next time.&#160; </p>
]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2012/07/17/outliers-the-story-of-success/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Developers Life&#8211;The Social Media Diet</title>
		<link>http://elegantcode.com/2012/07/03/my-developers-livethe-social-media-diet/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=my-developers-livethe-social-media-diet</link>
		<comments>http://elegantcode.com/2012/07/03/my-developers-livethe-social-media-diet/#comments</comments>
		<pubDate>Tue, 03 Jul 2012 10:00:00 +0000</pubDate>
		<dc:creator>Jan Van Ryswyck</dc:creator>
				<category><![CDATA[Esoterica]]></category>

		<guid isPermaLink="false">http://elegantcode.com/?p=5209</guid>
		<description><![CDATA[In the previous blog posts I discussed the importance of getting enough sleep and physical exercise. For this post I want to provide a quick shout out of the social media diet that I’m currently trying out. My name is Jan and I don’t have a Facebook or a Netlog account of some kind. I [...]]]></description>
				<content:encoded><![CDATA[<p align="justify">In the previous blog posts I discussed the importance of getting enough sleep and physical exercise. For this post I want to provide a quick shout out of the social media diet that I’m currently trying out. </p>
<p align="justify">My name is Jan and I don’t have a Facebook or a Netlog account of some kind. I do have a Google+ account that I haven’t visited in like four months. I also have a Twitter account that I’ve used quite often in the past. Currently I’m checking my Twitter account no more than two times a day for only a couple of minutes. Quite often I don’t visit it at all. Why? Because I let it all go.</p>
<p align="justify">I did not gain as much free time as I initially anticipated. But what I did gain was my ability to focus on stuff that I kept postponing for some time and more efficiency while doing it. Looking back, my brain feels less flooded and I no longer have that nagging urge that I’m missing out on information that is not really that important in the first place.&#160;&#160; </p>
<p align="justify">Don’t get me wrong here. I’m not entirely condemning social media either. I do get some value out of it, at the very least some entertainment only when I’m open for it. But I just let myself take some benefit from social media in the most superficial way as I possible can without getting too much involved. That way I’m able to pick up or learn something new without feeling like an informationholic. </p>
<p align="justify">I no longer have a Twitter client constantly running in the background. I also disabled all other kinds of notifications popping up like e-mail, … etc. And I must say that it works like a charm.</p>
<p align="justify">Close your browser or social media client and get out there! Exercise. Read a book. Learn a new programming language. Play with your kids. Listen to some music. Garden. Anything. No one on his dead bed ever said, “I wish I had wasted more time using social media”. Don’t be afraid to miss out on that one tweet or message, because you’re probably already lost track of what’s really important.</p>
<p align="justify">Until next time.</p>
]]></content:encoded>
			<wfw:commentRss>http://elegantcode.com/2012/07/03/my-developers-livethe-social-media-diet/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
