Far Away Developer

Sebastien Lachance

Archive for September, 2007

Adding an element to an array in C#

Posted by Sebastien Lachance on September 26, 2007

It’s probably the same thing in VB.NET but the example is in C#.

   1: Address[] addresses = customer.AddressList;
   2:
   3: Array.Resize(ref addresses, addresses.Length + 1);
   4:
   5: addresses[addresses.Length - 1] = address;

Posted in .NET | No Comments »

Last lecture

Posted by Sebastien Lachance on September 26, 2007

Watch and cry (of course I’m not crying for real).

http://link.brightcove.com/services/link/bcpid452319854/bctid1199157902

Posted in Blogging | No Comments »

Becoming a better developer : Where Am I? Second Update

Posted by Sebastien Lachance on September 21, 2007

I’m almost through my first 3 books, Head First Design Patterns, Windows Forms 2.0 and CLR via C#. I am not reading as much as I would want because of the construction of my new house, but starting Monday in 2 weeks I should be back on track with a more normal life (I really hope so).

Posted in Fun, Learning, Programming | No Comments »

The problem with Constant and Versionning

Posted by Sebastien Lachance on September 20, 2007

Suppose you have 2 assembly, called ProjectA and ProjectB. And each one of the assembly have a corresponding ClassA and ClassB class. In the ClassA class, you have a constant.

Example :

public const string SPNAME = "SP_Insert_Something"

Then the ClassB class use the constant in his code. You compile, everything work as expected. After a while, you change the value of the SPNAME constant for “SP_Insert_Another_Thing”. You recompile, but the problem is that the ClassB (which is in another assembly not recompiled) will still use the old value. At compile-time, the value of the constant is added to the IL (Intermediate Language) and no reference at all is made to the constant field of the ClassA class in the ProjectA assembly. You should consider using a readonly field. When using the readonly keyword, the value will not be inserted into the IL code and the code will instead check the value stored in the ProjectA assembly.

public readonly string spname= "SP_Insert_Something"

Posted in .NET | No Comments »

My list of bookmarks of the week 1

Posted by Sebastien Lachance on September 6, 2007

I have a huge list of feeds and sometime there is some really long post and some excellent links. And I don’t always have the time to go through this. So I hit Ctrl-D to place it in my bookmarks. So today I had some time left to clean this all up. So, here is all the bookmark that will stay bookmark.

This one is the most visited by me in the last month. Lot of useful tips.

147 Tips to be better (which happens to be the theme of my blog).

When you don’t know what to listen.

Tim Ferriss offers you this OCD.

I have ordered the book today.

Finally someone answers them!

And at last, a developer link.

Let me know if you enjoy this kind of posts. Good day!

Posted in Fun | 1 Comment »

I need advices

Posted by Sebastien Lachance on September 5, 2007

I will soon move to my new house and I got a 13×13 room for my office. There is no windows, but I have a really big patio door. I will almost never receive any client and I want it to be a productive and fun place. Do you have any advice for me?

Posted in Blogging, Fun | No Comments »

Becoming a better developer : Where am I?

Posted by Sebastien Lachance on September 3, 2007

I stopped completely drinking energy drink. Too much harmful effect. I also stopped drinking carbonated beverage a long time ago. For the rest I must admit it’s a lot more difficult than I thought but I’m optimist. Not a single pound lost, but I want to start slowly by modifying my bad habits one by one.

As for my reading, I have 200 pages of Windows Forms 2.0 and 150 pages of CLR via C#. I’m enjoying this last one. I have learn a lot on the content of a DLL. As for the Windows Forms 2.0 book, I must admit that the interest is not there. I am not learning anything new and I feel that I’m studying for an exam. But there is some interesting chapter coming on next.

Posted in Fun, Learning, Programming | No Comments »