Tuesday, August 14, 2007
This is Part 2 of a series answering the question:  Where do I start as a programmer:

16/08/2007 update - Fixed links

Historically, programming languages are often introduced with their Hello World example. It is completely trivial but also quite an informative place to start.

A Hello World may look like this, for a .NET Console application:

...in C#

class Program
{
   static void Main(string[] args)
   {
      Console.WriteLine("Hello World");
      Console.ReadLine(); // press Enter to close
   }
}

...in VB.NET

Sub Main()
   Console.WriteLine("Hello world!")
   Console.ReadLine() 'press Enter to close
End Sub

I won’t go into the exact details of this sample, but I will mention that the purpose of this trivial example is to illustrate that you are scripting a conversation between the computer and a program.  Magic does not live here.  Computers are just following instructions.

The value of starting a project on a rich framework like the Microsoft.NET framework is that plenty of the elemental pieces required to construct these scripts are supplied for you and arranged in a discoverable fashion. 

An exhaustive list of the pieces that are supplied in the framework is documented in the MSDN Library that you can install with the Express Editions and also online.

Follow the white rabbit, neo…

Start with some good quality learning guidance focused on Visual Studio:
…and don’t forget the web is littered with good and not so good programming tutorials.

Read other people's source code

The problem with tutorials is that they often leave off some important details in order to keep the example simple, thus you can only go so far reading tutorials.

Reading other people's source code can be very helpful in understaning how a technology is used in practice.  Some sources:
Start a project

Lots of people (ok, me – but probably plenty of others too) need a project to really get the programming juices flowing.  I need a problem to solve; otherwise I’ll just stare at the File -> New dialogue for hours.

What does this mean for beginner programmers?  Don’t think you have to look for problems that are new to science and have never been solved before.  Download.com  probably has hundreds of “note taking” applications, and “home movie database” applications.  The benefit of  starting a project at this stage of your career is not to solve a new problem – it’s what you pick up along the way.

Be generous with the constraints of your project.  Learning works best when it’s fun.  The last thing you need when starting programming is the stress of project constraints!

Start a blog

Grab an account at Blogger or one of the other blogging platforms and record your experiences.

Even if it is just “this is what I learned today” and “this is what I don’t understand today” posts there is still value in blogging:
  1. Blogging forces you to stream your thoughts down into words.  The cathartic effect this can have on your thoughts while learning a technology can hardly be understated. 
  2. Blogging is a great way to open a conversation with other people who are doing the same thing

For blogging on the train?  Try Windows Live Writer, but I often just use Word then copy-and-paste when I get connected again.

Be aware of support:

Of course, the blogosphere has a wealth of information ;-)

Some others:
...and there are literally hunderds more sites on the web of various quality and reputation...

What Else?  I'd love to hear from anyone via comments here on this topic.  What other bits should people go and get for programming on day one.

Listening To:  DAT323 Inside T-SQL (with Itzik Ben-Gan) from Tech.Ed '07.
Tuesday, August 14, 2007 2:14:01 PM (AUS Eastern Standard Time, UTC+10:00)  #    Disclaimer  |  Comments [3]  | 
A friend of mine dropped me an email that asked the following:

So, I’ve been thinking more and more lately that I should make some better use of my spare brain cycles and train time by learning some coding. Do you have any recommendations for where a total coding newbie with no money and no copy of VS should start?

So I thought I would answer in a series of blog posts.  This is part 1.

The first thing is no money does not mean that you can’t have a copy of Visual Studio

The first thing to do is grab a copy of Visual Studio Express Edition.  These are supprisingly capable cut down versions of the real Visual Studio 2005.

Go for Visual Basic or C# - don’t think C++ or J# are particularly good places to start learning code.  Either is fine.  Really. 

Also, Visual Studio 2008 Express Edition is available in Beta 2 at the time of writing.  Visual Studio 2008 is awesome, but again not the best place to start imho.

Then grab Visual Web Developer Express and SQL Server Express

Also, if you think MCP Certification is on the cards, each MS Press training kit comes with a 90-day copy of Visual Studio Professional.

UPDATE:  There are some additional downloads to consider:

The second thing is no Visual Studio does not mean no .NET programming

#develop, or SharpDevelop is a free, open source development tool for C#, VB.NET and Boo.

It has a couple of limitations, but can be had for a tiny 8.2Mb download and dosen't carry some of the weight of Visual Studio while still keeping some of the look and feel.

Still have some spare bandwidth?

Grab the Windows SDK.  It's probabbly a bit above the beginner level but it represents an execllent reference to what is happening under the hood when you come to need to know.

Grab FxCop (NB: you may have grabbed this as part of the Windows SDK).  FxCop is a tool that looks at your programs and compares them to a set of rules for programming on the .NET framework.  This is a little bit of an advanced topic, but also is a really valuable learning tool for avoiding bad coding habits.

FxCop 101:  The default is to check your code against all the rules.  As a beginner you probabbly don't want this.

Source code control is an important practice.  Even for a single guy on a train.

For source code control I would recommend going with SourceGear Vault which is free for a single named concurrent user.  It's really easy to install and get going.

Unlike SourceSafe, Vault is backed with a SQL Server database for better performance and backup support, and also runs over SSL and can run over the internet.  Additionally it supports an Edit-Merge-Commit usage pattern in addition to SourceSafe’s Checkout-Change-Commit usage pattern – but that is a bit of an advanced topic so don’t get too distracted.  Just know that it’s there for later.

What Else?  I'd love to hear from anyone via comments here on this topic.  What other bits should people go and get for programming on day one.

Listening To:  DAT318 Applied ADO.NET Entities from Tech.Ed '07.

Tuesday, August 14, 2007 1:26:16 PM (AUS Eastern Standard Time, UTC+10:00)  #    Disclaimer  |  Comments [2]  |