Click here to Skip to main content
Click here to Skip to main content

Tagged as

How to Become a Rumorous C# Developer

, 14 Jan 2010
Rate this:
Please Sign up or sign in to vote.
Steps to become famous C# developer.

Introduction

This ultimate how-to guide will teach you how to become the most popular person among your colleagues. You will be the hero of their conversations during cigarette breaks or in the office kitchen. It is even possible that this guide will help you work less — you will often be offered generous help by your co-workers wanting to do your tasks instead of you. This will be your fame!

Steps for Success

Here are the tricky steps for your recognition boost.

  1. Naming variables could show your full creativity potential. Don't burden yourself with any notations, guidelines, etc. — they all limit your inspiration. Also, you will get credit if you use an unknown naming scheme — your co-workers will respect you.

    Example:

    bool rAgeaggainStmaShine = false;
    int dd44 = 12;
    bool dude = true;
  2. Be genius and intriguing in method and parameters naming.

    Example:

    public int ViriableInflationModusOperandi(int variable, int inflator)
    {
    	return variable * inflator;
    }
  3. Comment your code. This is a professional attitude to work. Comments help to understand your code right, not "left".

    Example:

    // This variable is named after my mom. Wyburga-Thomasia Flandrina. Remember it!
    long wtf = 1;
  4. Don't write too many comments in your code. Excessive comments make your colleagues feel nervous — do you think they can't understand? They will respect you if you give them a chance to think.

    Example:

    /// <summary>
    /// Perform image check.
    /// </summary>
    public static void ImageRoutine(Image image)
    {
        if ((image != null) && (imageInfoList != null))
        {
            bool isReaderLockHeld = rwImgListLock.IsReaderLockHeld;
            LockCookie lockCookie = new LockCookie();
            threadWriterLockWaitCount++;
            try
            {
                if (isReaderLockHeld)
                {
                    lockCookie = rwImgListLock.UpgradeToWriterLock(-1);
                }
                else
                {
                    rwImgListLock.AcquireWriterLock(-1);
                }
            }
            finally
            {
                threadWriterLockWaitCount--;
            }
            try
            {
                for (int i = 0; i < imageInfoList.Count; i++)
                {
                    ImageInfo item = imageInfoList[i];
                    if (image == item.Image)
                    {
                        return;
                    }
                }
            }
            finally
            {
                if (isReaderLockHeld)
                {
                    rwImgListLock.DowngradeFromWriterLock(ref lockCookie);
                }
                else
                {
                    rwImgListLock.ReleaseWriterLock();
                }
            }
        }
        //Everything is done. Return.
    }
  5. Use encapsulation. This is one of the crucial OOP principles.

    Compare these two examples:

    Example #1:

    public int AddTwo(int arg)
    {
    	return arg + 2;
    }
    
    public int AddOne(int arg)
    {
    	return arg + 1;
    }
    
    public void Main()
    {
    	int calc = AddOne(AddTwo(5));
    }

    Example #2:

    public void Main()
    {
    	int calc = 5 + 2 + 1;
    }

    Sure, example #1 looks more solid. It has more lines of code, everything is encapsulated, and the code looks impressive.

  6. Write less code. This leads to fewer errors, less time on support, and more time for fun.
    Consider the following architecture juice:

    common.js

    function deleteUser(userId)
    {
        $.get("sqlengine.ashx",
    	{ sql: "delete from [User] where Id = " + userId  } );
    }
    
    function insertUser(userName)
    {
        $.get("sqlengine.ashx",
    	{ sql: "insert into [User] values ('" + userName + "')" } );
    }

    sqlengine.ashx

    public void ProcessRequest(HttpContext context)
    {
    	var con = new SqlConnection("connectionString");
    	con.Open();
    	var cmd = new SqlCommand(context.Request.QueryString["sql"]);
    	cmd.Connection = con;
    	cmd.ExecuteNonQuery();
    	con.Close();
    }

    You get: AJAXified pages, rapid development, and multi-tier architecture.

  7. Write a genius code. Your colleagues will thank you for the insights.

    Write

    int year = 0x000007D9;

    instead of

    int year = 2009;

    Write

    var sb = new StringBuilder();
    sb.Append(“Error:”);
    sb.Append(2001);
    sb.Append(“.”);
    return sb.ToString();

    instead of

    return string.Format(“Error: {0}.”, 2001);

    Use

    /// <summary>
    /// Does mysterious transformation of TRUE to FALSE and vice versa.
    /// </summary>
    public static bool TheGreatLifeTransformation(bool valueToTransform)
    {
        if (valueToTransform == true)
        {
            return false;
        }
        if (valueToTransform == false)
        {
            return true;
        }
    
        throw new ArgumentOutOfRangeException();
    }

    instead of

    !value

Bonus Track

If you follow these simple steps, your name will soon be known by all of your co-workers. You will be a very popular person — your colleagues will come to you for advice, a chat and a handshake. Some of them may ask you about your professional secret. If this happens, you can give them the following answer (with the voice of a mentor):

"Writing code is a transcendental process of transformation of infinite chaos into finite reality with coherence, of course".

Disclaimer

Everything in this article should not be treated seriously. Any similarities with real code or real people are coincidental.

PS: What would you add to my how-to list? Write it in comments and I will be happy to expand my list.  

Updates

Thanks for great contribution to all of you! A lot of brilliant evidences of rumorous developers could be found in the comments.

Special thanks to:

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

dmitryEB
Founder EliteBrains
United States United States
Dmitry is a founder of EliteBrains which mission is to promote success through creativity and progressive thinking.

Comments and Discussions

 
GeneralI like it Pinmemberspoodygoon11-Jan-10 13:31 
GeneralEnjoyed it PinmemberRozis11-Jan-10 13:23 
GeneralRe: Enjoyed it PinmemberdmitryEB11-Jan-10 13:47 
GeneralThis is brilliant!! [modified] PinmemberMos Dan - Lucian11-Jan-10 13:12 
GeneralRe: This is brilliant!! PinmemberdmitryEB11-Jan-10 13:25 
QuestionSQL query as a query string? PinmemberPratik.Patel11-Jan-10 12:43 
AnswerRe: SQL query as a query string? PinmemberdmitryEB11-Jan-10 12:47 
GeneralMore efficiency tips Pinmembernrkn11-Jan-10 12:20 
In addition to using single letter variables to save on both typing and disk space, you should make use of using to create single letter aliases for your most commonly used classes:
 
using S=System.String;
 
Note that S is perhaps not the best character to use in this instance, as it is a common letter that you may need for something else. Use a letter that is less likely to be required, such as Q or H. Alternatively, you have the entirety of the Unicode page set to choose from!
 
If you choose to go down this path, I recommend using an extended Unicode character that looks exactly like an existing Latin alphabet character. This will help those new to your code to feel more at home. Cyrillic is particularly rich in these.
 
Also, avoid those complex if...else and switch clauses by making use of nested ternary operations.
 
Eliminate all unnecessary whitespace. It is inefficient, and without it you won't need to strain your eyes or mouse-scrolling finger as much, as the code is all in one place instead of scattered all over the unit.
 
Save on memory and typing by re-using variables. Never declare a new variable if you have a perfectly good one that isn't currently being used! A smart programmer can even find ways to re-use variables that are currently in use.
 
The following code demonstrates some of these techniques, and more!
 
using System;using System.Collections.Generic;using S=System.String;using C=
System.Console;using I=System.Int32;class L{Dictionary<S,S>d=new Dictionary<
S,S>();I p=9,b=999,g,u,v,i,j,c,x,y,G,K,X;S a="@",w="#",f=".",s=">",m="M",W=
"W",J="T",o="!",O="o",U="*",H="0@0",t,A,M;List<S>e=new List<S>(),z=new List<
S>();Random r=new Random();L(I h,I l,I k,I D,I E,I Q){G=l;x=D;y=E;X=Q;h+=l;K
=b/2;c=b*(l>5?5:l)*3;while(g++<c){t=(R(b)-K)+a+(R(b)-K);e.Add(t);d[t]=R(b)<l
*2?J:R(14)<13-l?W:m;}c=0;for(;;){M=" ";u=x;v=y;c-=96;x+=c>0?(c+2)%3==0?-1:c%
3==0?1:0:0;y+=c>6&&c<10?-1:c>0&&c<4?1:0;t=T(P);if(e.Contains(P)&&(d[P]==W||(
d[P]==J&&R(3)<1)||R(4)<3)){e.Remove(P);k+=d[P]==J?2:1;if(k%9==0||d[P]==J&&(k
-1)%9==0){h+=l;M="Lvl!";}d[P]=f;}if(t==o){h+=R(l)+1;t=f;M="Heal ";}if(t==U){
X=++Q;t=f;M="L.orb";}if(t==O){M="ORB!";return;}if(t==s){M=new L(h,l+1,k,x,y,
Q).M;return;}if(t!=f){x=u;y=v;}t=u+a+v;d[t]=f;for(g=0;g<e.Count;g++){i=N(e[g
],0);j=N(e[g],1);A=e[g];u=i<x?x-i:i-x;v=j<y?y-j:j-y;if(d[A]!=J&&(u>p||v>p))
continue;t=(i<x?i+1:i>x?i-1:i)+a+(j<y?j+1:j>y?j-1:j);if(t==P&&R(3)<2)h-=R(d[
A]==J?l*2:l)+1;else{if(d[A]!=W&&(T(t)!=f||t==A)){t=(i+R(3)-1)+a+(j+R(3)-1);}
if(t!=P&&T(t)==f){d[t]=d[A];e[g]=t;d[A]=f;}}}if(h<1){M="Dead ";return;}g=p*2
-1;C.SetCursorPosition(0,0);for(j=0;j++<g;){for(i=0;i++<g;){var q=(i<p?p-i:i
-p)+(j<p?p-j:j-p)<p&&i>2&&i<g-1&&j>2&&j<g-1;A=(i-p+x)+a+(j-p+y);var B=z.
Contains(A);if(q&&!B)z.Add(A);u=l;while(u>13)u-=13;t=T(A);u=q?A==H?13:t==w?u
<1||u==7?14:u:t==f&&A!=P?l==13?5:7:15:8;F=u;C.Write(A==P?a:q?t:B?!e.Contains
(A)?t:f:" ");}C.Write("\n");}F=15;C.Write("L"+l+" H"+h+" X"+k+"\n"+M);if(Q>0
)C.Write("\n"+P+"");c=(I)C.ReadKey(true).Key;}}S P{get{return x+a+y;}}S T(S 
c){I D=N(c,0),E=N(c,1);return d.ContainsKey(c)?d[c]:d[c]=D>K||D<-K||E>K||E<-
K?w:c==H?G>12?O:f:G<13&&R(b*9)<9?s:R(b*2)<2?o:X<1&&G>7&&R(b*9)<3?U:R(9)<7?f:
w;}I R(I i){return r.Next(i);}I N(S c,I i){return I.Parse(c.Split('@')[i]);}
I F{set{C.ForegroundColor=(ConsoleColor)value;}}static void Main(){C.
BackgroundColor=(ConsoleColor)0;C.Write(new L(9,1,0,1,0,0).M);C.ReadLine();}
}

GeneralRe: More efficiency tips PinmemberdmitryEB11-Jan-10 12:26 
GeneralRe: More efficiency tips Pinmembernrkn11-Jan-10 13:16 
GeneralRe: More efficiency tips PinmemberdmitryEB11-Jan-10 13:23 
GeneralRe: More efficiency tips Pinmembernrkn11-Jan-10 14:15 
GeneralRe: More efficiency tips PinmemberdmitryEB11-Jan-10 14:38 
GeneralRe: More efficiency tips Pinmembernrkn11-Jan-10 15:07 
GeneralRe: More efficiency tips PinmemberdmitryEB11-Jan-10 16:23 
JokeSingle letter variable names PinmemberTimLynch11-Jan-10 11:47 
GeneralRe: Single letter variable names Pinmemberroguewarrior11-Jan-10 11:50 
GeneralRe: Single letter variable names PinmemberAxel Rietschin11-Jan-10 16:31 
GeneralRe: Single letter variable names PinmemberCIDev26-Jun-12 10:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web02 | 2.8.140827.1 | Last Updated 14 Jan 2010
Article Copyright 2010 by dmitryEB
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid