The Pragmatic Programmer

Tulisan iseng kalo ada waktu.
See also: Other Geeks@INDC

April 2008 - Posts

Immediate Translation

Wah, Mibbit udah ngeluarin ceting yg pake automatic translation. Mudah-mudahan nantinya bisa jadi instrumen untuk achieve Turing test. Kapan yah?

Share this post: | | | |
To You - 2

 Hey Microsofties, when will you release a cool App Engine like Google App Engine. So we can have a development environtment with C# and ASP.Net built-in. 

Share this post: | | | |
Just a moderate question

Let's say you have this solution structure:

Solution 'ConsoleApplication2' (2 projects)
|- ClassLibrary1
|  |- Class1.cs
|
|- ConsoleApplication2
   |- Program.cs


In Class1.cs, you define:

namespace ClassLibrary1
{
    
    public class Class1
    {
        public const int ItemPrice = 500;
    }
}

In Program.cs, you define:

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        
        {
            Console.WriteLine(ClassLibrary1.Class1.ItemPrice * 2);

            Console.ReadLine();
        }

    }
}


You have deployed your ConsoleApplication2 application into two different PCs.
Now, you change the value of ItemPrice constants into 1000 and then you compiled the ClassLibrary1 library.

How do you deploy the changes to the two PCs?
Do you just need to deploy the ClassLibrary1 assembly or else?
And why?

Share this post: | | | |
Just a simple question - 2

Without using your compiler, guess what will be the output of this code:

        static void Main(string[] args)
        {
            Sample<string, int> s = new Sample<string, int>("A", 0);

            Console.WriteLine(s.PropA + s.PropB);

            Console.ReadLine();
        }

    public class Sample<A, B>
    {
        public A PropA = null;
        public B PropB = null;

        public Sample(A a, B b)
        {
            PropA = a;
            PropB = b;
        }
    }

and why? 

Share this post: | | | |
Just a simple question

 Without using your compiler, guess what will be the output of this code:

        static void Main(string[] args)
        {
            string s = "A";
            s = string.Concat(s, "B");
            s = string.Join(s, new string[] { "1", "2", "3" });

            Console.WriteLine(s);

            Console.ReadLine();
        }

and why?

Share this post: | | | |