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 CPOL
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

 
Generaln1 PinmemberMaasOne12-Jan-10 2:04 
GeneralFew tips more... Pinmemberjkruza11-Jan-10 23:02 
GeneralRe: Few tips more... PinmemberdmitryEB12-Jan-10 1:45 
GeneralRe: Few tips more... PinmemberRiaan Lehmkuhl16-Feb-10 21:59 
Generalhaha great article! PinmemberDruuler11-Jan-10 21:25 
GeneralHa Ha Pinmemberjsh_ec11-Jan-10 18:42 
GeneralTake it somewhere else PinmemberPIEBALDconsult11-Jan-10 15:51 
GeneralRe: Take it somewhere else PinmemberdmitryEB11-Jan-10 16:58 
GeneralRe: Take it somewhere else Pinmemberpwasser11-Jan-10 17:28 
GeneralRe: Take it somewhere else PinmemberMember 368477819-Jan-10 7:27 
JokeUse code region PinmemberAlessandro Bernardi11-Jan-10 14:45 
GeneralMy vote of 1 Pinmembergrey_hem200311-Jan-10 14:37 
GeneralI like it Pinmemberspoodygoon11-Jan-10 14:31 
GeneralEnjoyed it PinmemberRozis11-Jan-10 14:23 
Reminds me of a range of articles I wrote decades ago named 'Cryptomanic programming'. It was a tutorial how to create non-understandable code. Some ideas I worked out there:
 
- Fiddling with ++ (pre and post),+=, <<,>> operators. It's not so difficult to create one line of code that is hard to understand.
- assign more then one variable on the same line. For example: a=b++=c
- changing the variable of a for-loop in the loop itself (different languages have different implementations for this.) You can also change the upper boundary of the for-loop within the loop, and of course the stepsize.
- If your language has macro-capabilities (I don't know C# very well) there are great possibilities to hide things. What i understand of C#, delegates would be my candidate. The C-variant is to use pointers to functions whenever you can. Pointers to pointers to data is also much more sexy as direct datatypes.
- Use the automatic conversion of numeric types for your benefits. Cast to whatever datatype. Floats are my favorite because there's no standard between compilers defined. With some fiddling you can make a program that will (maybe) compile on another compiler but will give strange results. Cast dates to floats and v.v. for example.
- Most high level languages use underlying pointers to implement objects, strings and so on. A great opportunity for the clever programmer. If you can mingle these references with pointers you will get spectacular results.
- A simple but effective advice: use as many variables as you can. And if your language supports untyped variables use them as much as you can.
- Create global variables; they are much easer. Don't forget to create local variables with the same name as the global ones now and then.
- Recursive methods are sexy, they look impressive and nobody understands what they do. Use recursiveness whenever you can.
- return values of functions and methods are intriguing. Maybe you can return a pointer to a local variable.
- Never, never trust a variable. Don't use a variable without checking if it has the right value first. This is surely true if a variable is used as an argument to a method but also within lenghty methods. You never know what happened since your last assigned it a value.
- If your language supports it use 'short-cutting' whenever you can (the effect that if a or b, and a is true b is not evaluated anymore.) Remember expressions may include invokation of methods also.
 
Some more:
 
- Never use a DBMS, write your own instead (that is much more efficient and keeps you of the streets).
- XML is hot, never write anything to disk if it is not in XML.
- Use standards. Seek for the most complex one's and augment them with your own solutions. Point is: noone understands them, but you can always say to your boss that the standard requires ... (fill in whatever you want).
- If you use OO: objects need other objects, so create a system that has as many objects as you can think of. The truth is: everything is an object so get rid of variables and turn them into objects. And objects need to work together, so move methods of one object to an object of another class (warning: this is not so easy as it sounds, but try it). Try to make objects that are max. depend of other objects.
- If your language supports multiple inheritance: feel free and try this concept to the max.
- Forget the stories about reuse. Copy and paste as many code as you can. Reuse is only usefull if you have to change the method/class/function to get it work.
- A professional project uses at least 15 Dll's.
- Versioning: If you want to change something on a method or function (for example because it has a bug) keep the old version in your system (who knows where it is good for in the future). Copy the method to change and give it a new name. By the way: in practice it is always good to have redundant code in your project. And don't forget to create methods that are never invoked.
- Versioning (2): a very sophisticated concept is creating Dll's that contain the same methods but are of a different version. For example create a Dll with some methods. When you create a new release copy the Dll, do your changes in this one, and release this one also. In you main program dynamicly load the version of the Dll you need (the one with bugs or the one without).
 
That's it so far. If you need more feel free to ask: I have tons more...Cool | :cool:
 
Rozis
GeneralRe: Enjoyed it PinmemberdmitryEB11-Jan-10 14:47 
GeneralThis is brilliant!! [modified] PinmemberMos Dan - Lucian11-Jan-10 14:12 
GeneralRe: This is brilliant!! PinmemberdmitryEB11-Jan-10 14:25 
QuestionSQL query as a query string? PinmemberPratik.Patel11-Jan-10 13:43 
AnswerRe: SQL query as a query string? PinmemberdmitryEB11-Jan-10 13:47 
GeneralMore efficiency tips Pinmembernrkn11-Jan-10 13:20 
GeneralRe: More efficiency tips PinmemberdmitryEB11-Jan-10 13:26 
GeneralRe: More efficiency tips Pinmembernrkn11-Jan-10 14:16 
GeneralRe: More efficiency tips PinmemberdmitryEB11-Jan-10 14:23 
GeneralRe: More efficiency tips Pinmembernrkn11-Jan-10 15:15 
GeneralRe: More efficiency tips PinmemberdmitryEB11-Jan-10 15:38 
GeneralRe: More efficiency tips Pinmembernrkn11-Jan-10 16:07 
GeneralRe: More efficiency tips PinmemberdmitryEB11-Jan-10 17:23 
JokeSingle letter variable names PinmemberTimLynch11-Jan-10 12:47 
GeneralRe: Single letter variable names Pinmemberroguewarrior11-Jan-10 12:50 
GeneralRe: Single letter variable names PinmemberAxel Rietschin11-Jan-10 17:31 
GeneralRe: Single letter variable names PinmemberCIDev26-Jun-12 11: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 | Terms of Use | Mobile
Web03 | 2.8.150224.1 | Last Updated 14 Jan 2010
Article Copyright 2010 by dmitryEB
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid