Michel P. Macedo

I Am Sorry

| Comments

I am sorry for kind of calling you a moron. But I would like to point out that saying that Linux is for developers is not only inaccurate, but also it is a way of saying without provocation or basis on fact that Linux is useless and suck. Saying that for someone that believes in the cause of free (as in freedom) software, you are saying they are stupid, like someone looking down on you with disgust and despise because you are “just a programmer” or because you refuse to eat meat, when everyone else is, i.e, because you are not like them.

Damn High German Ich!

| Comments

I wasn’t particularly longing for the time I would have to utter this sound again (pretty much any voiceless fricative), even though I still intend to resume my German studies. In Esperanto this sound is used for the letter ĥ (name ĥo). It is relatively rare, but it finally came up in one of my Esperanto reading practice sessions.

Iterating Collections in JavaScript

| Comments

When I iterate in any language, I like to have a list of somethings to iterate because I can use more idiomatic code and have more explicit initial state, state changes and exit conditions. Most languages have a slightly different for/foreach that iterates over things that are considered enumerable by the language. In JavaScript we have two types of enumerable objects: array-like objects, also known as collections or simply arrays; and objects, also known as object hashes or associative arrays, even though they are just any JavaScript object that is used for that purpose.

Javascript Not Minus One Operator

| Comments

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.

In Javascript, both Array’s and String’s indexOf return minus one (-1) for not found. Minus one isn’t particularly semantic, and checking for it tends to produce the most verbose and technical bits of otherwise cleanly written code.

Formatting Strings in .NET

| Comments

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.

F# Coding Dojo

| Comments

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#.

I Spun Off Linux From My Dev Machine

| Comments

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.