Is it good practice to shorten functions? Like this code for instance:

      using System;
      namespace Hello
          class Program
                public static void Main(String[] args)
                     Write("Hello, World!");

                public static void Write(string s)

                public static void Stagger()

I get lazy and do stuff like that a lot. But is it proper?

  • 1
    Short answer: yes. Long answer: read that linked question and the other ones it links to.
    – user22815
    Feb 13, 2015 at 3:04
  • Thanks a lot! Sorry, I didn't see those when I was searching.
    – XiKuuKy
    Feb 13, 2015 at 3:26

1 Answer 1


If you do it to improve code readability, this is a good idea.

If you do it to type less, you probably do it wrong.

In your example, your methods don't improve readability; I would even assert that they add complexity and decrease readability:

  • What is Write? Is it writing something to a file? A log? Right, you should read how the method is implemented (since you don't even have XML comments) in order to know what is the purpose of the method.

  • What do Stagger means? Unless this term is used a lot in the application domain, I would avoid it: Console.ReadLine is much more explicit.

They might help you to type less, if you're writing your apps in Notepad. If you use Visual Studio, Intellisense will make those methods irrelevant. Not counting the fact that if you count using the official C# style, you would be writing Program.Write instead of just Write, which means that the number of keys pressed while using Intellisense will be exactly the same.

Not the answer you're looking for? Browse other questions tagged or ask your own question.