Not long ago I heard of fish (friendly interactive shell) and I decided it was worth a test drive. I have a decent configuration for zsh, with most credits to Oh My Zsh!, but I was determined to get rid of most my dotfiles, as it is one of my greatest excuses to procrastinate, however tidy. Fish comes with lots of things out of the box, so I decided to replace zsh even if it meant to lose a thing or two.
In the documentation of Twitter Boostrap 2, there is a pretty example box, with a caption on the top-left corner. If you inspect the HTML code, you won’t find the caption, it is generated with CSS. It might seem absurd, a violation of the traditional separation of style and content, but there is a way around it.
Twitter Bootstrap is published in LESS and that is how I like to use it. The twitter-bootstrap-rails gem is the most popular and most complete for that purpose. It has several handy generators and helpers. But I can’t for my life install it on JRuby. Since I don’t like forking, I found a somewhat simple workaround.
In functional languages, code consists mainly of processing lists in a recursive manner. A limited list of patterns in processing lists emerge so often that all functional languages provide at least some high-order functions, that are very well written and optimized. The most common and useful high-order functions, the primitives, are (may vary) each (only for imperative programming), filter, map and reduce.
In most languages if you want to check if something is in a array or string, you use functions named indexOf or any variant thereof. The signature and contract don’t usually deviate much, specially in languages with zero-based indexes.
You may want to format some scalar value as a string, since default ToString functionality is possibly not what you want the user to see. You may want to do some occasional tool or toy console app. Not only these but perhaps any other reason may inspire you to code some string art. With C# there is no string interpolation, but there is a string formatting framework with a reasonable power. Let’s see about that.
I am an active member of a .NET user group in the city I live. We have monthly meetings that usually combine a lecture followed by an one hour coding dojo. August this year we had our monthly meeting and I spoke for an hour or so about F# and then challenged the other participants to translate to F# a small problem already codified with C#.
Some weeks ago I started to learn Rails and I decided to make my dev machine the right way. By that I mean I had to make myself proficient with Git, Vim, Shell, TDD and every other skill I thought a smart programmer would master. At first I didn’t want to get rid of my state of art Windows 7 installation with awesome Microsoft Word 2010, Microsoft Visual Studio 2010 full of useful plugins and all that browsers installed to test web pages. I think I had everything a .NET developer would hope for, even had msysgit to play once in a while and pretend my OS was POSIX compliant.
The C# team have introduced some nifty syntax sugars since C# 1.0. Among these new features are some to declare anonymous methods and delegates and initializers for objects and collections. They are are there for a while now and still are relatively unknown or misunderstood by the majority of C# programmers.
I will try and clarify them a bit.