Development productivity – all my thoughts

0
807

Last month I started working in a new project idea, I love to write code and I also love painting, I don’t see so many differences between these two activities, twice are based on our pure creativity, we can create all we think and all we want, sometime I love to use this my quote, I paint when I write code 🙂

As a painter in front a white picture, when I have an idea or an inspiration, I start to write code in front an empty Visual Studio project, Initially the activity is very expensive because I have a clear idea, a clear feeling in my mind, but I’m not sure about what I’m going to do to realize that, I write and delete the same code many times, changing it continuously, until I’m satisfied.
Logically I work during my free time, normally during the night, so the optimization of my time and the improvement of my productivity is the first real critical aspect for me, more I’m fast more quickly I will realize my idea and more happy will be wife 🙂

My personal strategy is to invest time to increase my productivity, more I invest in the first time and more I will be fast and optimized in my development, but what is, for my opinion, the development productivity?
I can think about it in three different main aspects, one is how much fast I can write code, the second is how much I can optimize my writing code and the third is the motivation.
First my best strategy is to study Visual Studio and .Net Framework to understand  the best options I can use to optimize my development life, I want to do two simple but powerful examples.

About the first one, how many time I need to re write the same lines of code, I like to create my best base code snippets, I do that before and in the during of development, and this is very simple and fast to do, this is a my real sample.

Create a simple XML file with this content:

<?xml version=”1.0″ encoding=”utf-8″ ?>
<CodeSnippet Format=”1.0.0″ xmlns=”http://schemas.microsoft.com/VisualStudio/2013/CodeSnippet”>
<Header>
<Title>LogMessage</Title>
<Author>Nino</Author>
<Shortcut>log</Shortcut>
<Description>Insert log message</Description>
<SnippetTypes>
<SnippetType>SurroundsWith</SnippetType>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>message</ID>
<Default>my function</Default>
</Literal>
</Declarations>
<Code Language=”CSharp”>
<![CDATA[
LogEngine.WriteLog(Configuration.General_Source,
string.Format(“Error in {0}”, MethodBase.GetCurrentMethod().Name),
Constant.Error_EventID_High_Critical_HYIS,
Constant.TaskCategories_HYIS,
ex,
MessageLevel.Error);
]]>
</Code>
</Snippet>
</CodeSnippet>

Save the file with .snippet extension and import the snippet file in Visual Studio using the Code Snipper Manager you will find under the Tools voice menu.
snipet

When I need to reuse my code I just press Ctrl + K and then X.

snipet2Select the snippet

snipp3

and press Enter

snipp4

There are other ways to do that, you can check here.
This is a very simple example about what I do to optimize my productivity but there are many other thing we can do, I repeat, my best strategy is to keep me update on Visual Studio features.

The second one is about how to optimize my writing code, as I said before, there are many features to use but I like to use more some of them than other and I would like to resume the best for me, I saw that the features below are able to increase my productivity of 500%:

I think that the important thing is, not only just to study new features, this is not so complicate, the complicate thing is to understand how to use them in the best way,  I spent time studying all of these and it was a bite stressful but using this strategy now I write code 60% less, this is crazy but true.

The last one, the motivation, is at the base of all, if you are motivated you work faster and better, otherwise is a big problem, you can be a guru of programming but without motivation nothing is possible.
I use a lot of different strategies to keep myself motivated, the two most important are:

I like to write code in atomic way before and try it, I like to create a Lab Console project and I start to write all the base functions and classes before, if you see your code running you keep yourself motivated, later I like to put all of them in the real scenario and when you see the result and the motivation will be crazy.

Another important aspect for me is listening music, different kinds of music, it depends about what I need to do, quite music or silent when I need to think and to be real focused, progressive rock or radio during the normal development and hard rock when I’m tired or I need to develop faster 🙂

BTW
I like to invest in my knowledge because it will help me to work better in the future.

LEAVE A REPLY

Please enter your comment!
Please enter your name here