﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Evan Larsen commented on Reviewing SignalR&amp;ndash;Part II</title><description>I really like your blogging style of investigating and asking questions which you can later answer.. taking you along your thought process. Its very relieving to see we both followed similar paths.</description><link>http://ayende.com/93185/reviewing-signalr-part-ii#comment20</link><guid>http://ayende.com/93185/reviewing-signalr-part-ii#comment20</guid><pubDate>Tue, 22 Nov 2011 21:38:59 GMT</pubDate></item><item><title>A'braham Barakhyahu commented on Reviewing SignalR&amp;ndash;Part II</title><description>Glad to see you had the exact same questions I did when looking in the code.</description><link>http://ayende.com/93185/reviewing-signalr-part-ii#comment19</link><guid>http://ayende.com/93185/reviewing-signalr-part-ii#comment19</guid><pubDate>Tue, 11 Oct 2011 16:12:36 GMT</pubDate></item><item><title>Asif commented on Reviewing SignalR&amp;ndash;Part II</title><description>After knowing that Ayende struggled on SignalR I was hoping He would help us in understanding it, but he didn't and others too started talking on JS  :) That is funny from Microsoft Surrounded guys that they go off topic in the frustration of Js. Well whoever says they hate Js, I don't think they loved it like others did who made lots of good things in js.</description><link>http://ayende.com/93185/reviewing-signalr-part-ii#comment18</link><guid>http://ayende.com/93185/reviewing-signalr-part-ii#comment18</guid><pubDate>Wed, 05 Oct 2011 20:05:25 GMT</pubDate></item><item><title>Jamie commented on Reviewing SignalR&amp;ndash;Part II</title><description>Having going from years of C# to doing a lot of both C# and JS in the last year or so, this is a remarkably familiar scenario :) It does take a bit of getting used to. Especially the idea that you can just add properties/methods on the fly, functions as first class objetcs. Not to mention dealing with nonexistent entities, or using a variable for any number of different things in a single context.

It is easy to dismiss or underestimate Javascript, but once you get the hang of it you start wishing you could do some of this stuff in C#. You lose some structure but you gain some incredibly terse code. And because JS is so easily extensible it's much easier to create natural, readable frameworks and constructs. After working in JS for a day I go back to C# and feel like I'm in "structure soup" and wish all those classes would just go away or maybe become a nice prototype. Pros and cons on both sides, but I've definitely learned to appreciate JS.</description><link>http://ayende.com/93185/reviewing-signalr-part-ii#comment17</link><guid>http://ayende.com/93185/reviewing-signalr-part-ii#comment17</guid><pubDate>Tue, 20 Sep 2011 21:21:46 GMT</pubDate></item><item><title>Ayende Rahien commented on Reviewing SignalR&amp;ndash;Part II</title><description>Drazen,
Yes, after you authorized a few times, it just works</description><link>http://ayende.com/93185/reviewing-signalr-part-ii#comment16</link><guid>http://ayende.com/93185/reviewing-signalr-part-ii#comment16</guid><pubDate>Tue, 20 Sep 2011 06:12:17 GMT</pubDate></item><item><title>Drazen Dotlic commented on Reviewing SignalR&amp;ndash;Part II</title><description>Btw, your CAPTCHA is killing me :) - I just posted essentially the same comment twice, plus I wasn't sure if the comment got posted or not.

Curiously, the captcha isn't there any more - is that because I've posted more than 2-3 times?</description><link>http://ayende.com/93185/reviewing-signalr-part-ii#comment15</link><guid>http://ayende.com/93185/reviewing-signalr-part-ii#comment15</guid><pubDate>Mon, 19 Sep 2011 17:23:11 GMT</pubDate></item><item><title>Drazen Dotlic commented on Reviewing SignalR&amp;ndash;Part II</title><description>Ayende,

if we're talking about "method_missing" in Ruby, then you are definitely right - in standard JS that doesn't exist yet.</description><link>http://ayende.com/93185/reviewing-signalr-part-ii#comment14</link><guid>http://ayende.com/93185/reviewing-signalr-part-ii#comment14</guid><pubDate>Mon, 19 Sep 2011 17:21:37 GMT</pubDate></item><item><title>David Fauber commented on Reviewing SignalR&amp;ndash;Part II</title><description>Interesting approach to figuring out what is going on with the implementation details.  That whole search for context seems to be what is missing from a lot of technical articles and leads to a lot of mind-numbing debates where people just talk past each other.

Also, I will not rest until I've terrified someone with horrible misuse of that comma operator.</description><link>http://ayende.com/93185/reviewing-signalr-part-ii#comment12</link><guid>http://ayende.com/93185/reviewing-signalr-part-ii#comment12</guid><pubDate>Mon, 19 Sep 2011 15:21:29 GMT</pubDate></item><item><title>njy commented on Reviewing SignalR&amp;ndash;Part II</title><description>@Harry: yeah, with his next example in the comments i got what he meant ;-)</description><link>http://ayende.com/93185/reviewing-signalr-part-ii#comment11</link><guid>http://ayende.com/93185/reviewing-signalr-part-ii#comment11</guid><pubDate>Mon, 19 Sep 2011 14:09:04 GMT</pubDate></item><item><title>Harry Steinhilber commented on Reviewing SignalR&amp;ndash;Part II</title><description>@njy,
If you look at the line of code Ayende was commenting on with the "on the fly", it was calling `$.connection.chat`. It wasn't assigning a value like your original example. So theoretically, the result should have been undefined, but it was surprising that it was an object. </description><link>http://ayende.com/93185/reviewing-signalr-part-ii#comment10</link><guid>http://ayende.com/93185/reviewing-signalr-part-ii#comment10</guid><pubDate>Mon, 19 Sep 2011 13:59:24 GMT</pubDate></item><item><title>njy commented on Reviewing SignalR&amp;ndash;Part II</title><description>@oren: that is not "defining" stuff on the fly, that is "calling" something undefined on the fly (and, after that call, it will still remain undefined) and having the object intercept the thing on the fly and do something.
Much like the DynamicObject.TryGetMember(...) in .net.

In that case you're right, js can't do that.</description><link>http://ayende.com/93185/reviewing-signalr-part-ii#comment9</link><guid>http://ayende.com/93185/reviewing-signalr-part-ii#comment9</guid><pubDate>Mon, 19 Sep 2011 12:47:23 GMT</pubDate></item><item><title>njy commented on Reviewing SignalR&amp;ndash;Part II</title><description>@Kristof: yes, that would be the way. Regarding readabilty, it depends on tastes and what you're used to, really: suppore you're a .net dev from the 2.0 times (that is, you don't know lambdas) , in that case a js closure may seem really ugly and obscure. But now that .net people know about lambdas and Func&lt;T&gt; stuff, js colsures feel more intuitive, for example.</description><link>http://ayende.com/93185/reviewing-signalr-part-ii#comment8</link><guid>http://ayende.com/93185/reviewing-signalr-part-ii#comment8</guid><pubDate>Mon, 19 Sep 2011 12:44:02 GMT</pubDate></item><item><title>Ayende Rahien commented on Reviewing SignalR&amp;ndash;Part II</title><description>Drazen,
What I meant, in JS you can write something like:

query.find_by_name_and_email();
query.find_by_user_and_age();

And stuff like that, which you can in Ruby, which allows you to capture unknown calls and handle them.
You can't do that with JS</description><link>http://ayende.com/93185/reviewing-signalr-part-ii#comment7</link><guid>http://ayende.com/93185/reviewing-signalr-part-ii#comment7</guid><pubDate>Mon, 19 Sep 2011 12:17:42 GMT</pubDate></item><item><title>Drazen Dotlic commented on Reviewing SignalR&amp;ndash;Part II</title><description>&gt;&gt; and I don’t think that JS allows you to define things on the fly

You have got to be kidding me :D. JavaScript is a scripting (duh!) language, of course it allows you to define things on the fly. You can redefine practically anything on the fly, including overwriting/hiding existing members on the exiting objects (like Array).

Look up Ruby and monkey-patching. You'd be surprised what the 'other side' has to put up with and even revels in :) If you're used to statically typed languages, I guess all this comes as a bit of shock to you :))

</description><link>http://ayende.com/93185/reviewing-signalr-part-ii#comment5</link><guid>http://ayende.com/93185/reviewing-signalr-part-ii#comment5</guid><pubDate>Mon, 19 Sep 2011 12:13:40 GMT</pubDate></item><item><title>Kristof Claes commented on Reviewing SignalR&amp;ndash;Part II</title><description>@njy - How would you write it on seperate lines then?

var connection = this;
var config = new { transport = "auto" };
var initialize;

Like that? That would be a lot more readable. The ", initialize" is very confusing to read in my opinion.</description><link>http://ayende.com/93185/reviewing-signalr-part-ii#comment4</link><guid>http://ayende.com/93185/reviewing-signalr-part-ii#comment4</guid><pubDate>Mon, 19 Sep 2011 11:24:40 GMT</pubDate></item><item><title>njy commented on Reviewing SignalR&amp;ndash;Part II</title><description>Sorry Oren but that is not a use of the comma operator in assignment, it's just a plain old multiline assignment.

It's the same as if in C# you would've done this:

var connection = this,
  config = new {
    transport = "auto"
  },
  initialize;

Oh, and yes, you can declare things on the fly, like:

var ayende  = {};
ayende.firstname = "Oren";
ayende.lastname = "Eini";</description><link>http://ayende.com/93185/reviewing-signalr-part-ii#comment3</link><guid>http://ayende.com/93185/reviewing-signalr-part-ii#comment3</guid><pubDate>Mon, 19 Sep 2011 10:09:50 GMT</pubDate></item><item><title>Niklas commented on Reviewing SignalR&amp;ndash;Part II</title><description>That is a straightforward best-practice variable initialization. It's refreshing to see you struggle with a language that is somewhat alien to you :).</description><link>http://ayende.com/93185/reviewing-signalr-part-ii#comment2</link><guid>http://ayende.com/93185/reviewing-signalr-part-ii#comment2</guid><pubDate>Mon, 19 Sep 2011 10:02:12 GMT</pubDate></item><item><title>David Rolland commented on Reviewing SignalR&amp;ndash;Part II</title><description>This is exactly why I hate JS. Too much magic happening behind the scene and you have to look at the documentation to understand the syntax at every line.</description><link>http://ayende.com/93185/reviewing-signalr-part-ii#comment1</link><guid>http://ayende.com/93185/reviewing-signalr-part-ii#comment1</guid><pubDate>Mon, 19 Sep 2011 09:42:39 GMT</pubDate></item></channel></rss>