Javascript

Closure in Javascript vs C#

Java vs C# As Jon Skeet pointed out in this excellent article on closures, the strategies of capturing the execution context which the behaviour is bound to different between Java and C#. C# captures the variable itself, whereas Java captures the value of the variable. To illustrate the difference, here’s Jon’s original example in C#: …

Closure in Javascript vs C# Read More »

Currying and Partial Applications in F#, Javascript and C#

In my last post I explained the difference between the techniques of Currying and Partial Application, following on where there let me show you how you might apply these two techniques in F#, Javascript and C#. F# Starting with F#, being a functional language it makes currying and partial application dead easy (considering that they …

Currying and Partial Applications in F#, Javascript and C# Read More »

Currying vs Partial Application

Recently I have come across some really interesting questions and debates around these two terms and how they differ from one another. There seems to be widespread confusions with many examples demonstrates one whilst intends another, and some simply uses the terms interchangeably. Whilst admittedly not being a function programming expert, I’ve spent a bit …

Currying vs Partial Application Read More »

Creating a link swipe effect with Javascript

I saw this in last month’s .Net magazine and thought it was pretty cool and worthwhile sharing. Without giving away too much of the intricacies (seeing as this is not my own work), this technique essentially boils down to using Javascript to append a <span> element to mask over each of the links on the …

Creating a link swipe effect with Javascript Read More »

Javascript’s prototypal inheritance, for a C# developer

The other day I put up a post with some quick bullet points about objects in javascript to help someone from a static, strongly typed language (like C# or Java) background understand javascript’s dynamic and loose type system. One important thing I haven’t talked about yet is the way inheritance work in javascript, which again, …

Javascript’s prototypal inheritance, for a C# developer Read More »

Javascript objects, for a C# developer

Coming from a C# background, the thing that has struck me the most in learning javascript is its combination of dynamic and loose type system and protoypal inheritance model (more on this later). Objects in javascript are very different from those in C#, though the ExpandoObject type in C# 4 offers similar ability to add/remove …

Javascript objects, for a C# developer Read More »

Javascript – Dynamically generating Accessor and Mutation methods

This is a neat trick I picked up the other day, you can create a dynamic class which takes in a set of properties in the constructor and dynamically generates Accessor and/or Mutation methods (you just have to choose which lines to leave out): In your calling code, you can then create a new class …

Javascript – Dynamically generating Accessor and Mutation methods Read More »

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close