Tuesday, January 27, 2015

Doug Crockford on Monads and JavaScript

He's not the father of JavaScript, he's more the strongly opinionated caretaker.

Here is his fascinating YouTube video on JavaScript and Monads.

Here is the sourcecode: https://github.com/douglascrockford/monad

He covers four monads in the talk:

  • The Identity Monad
  • The Ajax Monad
  • The Maybe Monad, which eliminates the possibility of a null -- very cool!
  • The Promise Monad, which apparently is not agreed upon by all to be a monad

Two links he mentions

Carl Hewitt, inventor of the Actor Model

Mark Miller, Secure Distributed Programming with Object-capabilities in JavaScript

How to Page in ASP.NET Web API

Great article. There are several ways of doing it, including the Twitter way, which handles infinite feeds in real-time scenarios using cursors.

Paging in ASP.NET Web API: Introduction | Jerrie Pelser

Cool Visual Studio Extensions From Mads Kristensen

Mads, the author of the essential Web Essentials extension for Visual Studio, has created a number of other plugins and extensions as well. Here's a link to two blog posts by him describing these extensions.

New handy Visual Studio extensions
New handy Visual Studio extensions - part 2

Monday, January 26, 2015

Learn F# or Haskell?

Here's a side-by-side comparison of ML dialects, of which F# is one, with Haskell:
ML Dialects and Haskell: SML, OCaml, F#, Haskell - Hyperpolyglot

Then there are the various "99 Bottles" F# implementations. Interestingly, Don Syme's is one of the longer version. He is the creator of F# and arguably knows it the best.
99 Bottles of Beer | Language F#

Here's the Haskell version:
99 Bottles of Beer | Language Haskell

Friday, January 23, 2015

ASP.NET - don't minimize files if you're bundling!

If you've got bundling turned on, the ASP.NET bundling library will choose the already minimized instead of minimizing it at runtime. This can cause problems if you have updated the the source file -- file.js or file.css -- and you haven't remimized it.

So don't minimize the file in the IDE. Alternatively, set up some sort of automation that will automatically minimize the file or your minimized CSS and JavaScript files will be out of sync and your won't know why.

See this StackOverflow question: ASP.NET Bundling - Bundle not updating after included file has changed (returns 304 not modified)

Thursday, January 22, 2015

Adding only non-whitespace changes in Git.

Sometimes it's useful to add only the non-whitespace changes because typically they'll be the meaningful content. This StackOverflow question show how to do that.

Here's the command to add everything, ignoring whitespace-only changes:

git diff -w | git apply --cached --ignore-whitespace


Link here: http://stackoverflow.com/questions/3515597/git-add-only-non-whitespace-changes