Liam McLennan

Looking at Languages (C#, Javascript & Ruby) 1: Installation and hello world Nov 22

I’m going to be looking at a few different languages and blogging my thoughts. I am not a language dork so it will probably be mostly wrong. The languages I care about are c# (which is what I mostly use), javascript (which I love) and ruby (which everyone else loves).

This post is part of a series comparing the language features of the C#, Javascript and Ruby programming languages.

Installation

C# is installed by installing visual studio, Javascript is included in all the popular browsers and Ruby can be installed (at least on Windows) using the Windows one-click installer.

Scripting-ness

Javascript and ruby are scripting languages, meaning that they are interpreted and dynamically typed. C# is strongly typed and compiled. In practice, this means that C# executes faster and is better at detecting errors at compile time. Javascript and Ruby support a faster development cycle, since there is no compile step, and provide more flexibility.

hello world

Here are the canonical hello world applications in each language.

C#:

class Program
{
  static void Main(string[] args)
  {
    Console.WriteLine("Hello World");
  }
}

Javascript:

alert('Hello World');

Ruby:

puts 'Hello World'

To execute a ruby program open a command prompt and run: ruby [ruby file name]

Note that the scripting languages require less ceremony to get something to run. You can drop commands in a text file, hand it to the interpreter, and it will run. This simple example also demonstrates the differences in line endings – Javascript and C# terminate lines with a semicolon, Ruby uses the new line character. 

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati

Working From Home Nov 22

Most of 2009 I have been working from home. This is a workforce revolution, made possible by technology advances and attitude changes. Here is my list of simple rules for working from home:

  • don’t do it all the time. It is important to have some face-to-face interaction with your team.
  • even when working from home stay in touch. Call your client or team at least once a day.
  • working from home can be isolating. I make sure that I get out of the house every day so that I don’t end up like Edward Scissorhands.
  • have quality gear. Working from home means that your home office is now your working environment. You should have a good workspace and sufficient redundancy. My home office has UPS, two internet connections, two printers and at least two computers.
  • have a separate workspace so that you are able to clearly differentiate between work, and non-work time.
  • Be fastidious with your timesheet. Trust does not come easily, so you need to do everything you can to help your employer understand that you don’t need to be supervised to work well.

Working from home is not for everyone, but there are some great benefits such as reduced travel time and working flexibility (such as the choice to wear pants).

This is my outdoor office:

IMG_2868

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati