Programming Life Hack - International Days

International Days

Internationally important Days

Breaking

Home Top Ad

Post Top Ad

Wednesday, 12 August 2015

Programming Life Hack

Through this post I would like , everyone to share their own ideas on programming that makes programmer's life easier . Every programmers have some secret weapons which makes them ahead of time. I would like to share my secret. Also i would like to hear from you folks. Let us share some tricks and tips for make programmer's life easy .

Note: This is not about how you become good programmer it is about how some simple tricks makes your programming life easy 

I would like to classify this area as below

a) Short key skills

There are a lot of cool shortcut keys in asp.net frame work . We could just practice few times
and become an expert . When you are so familiar with these short key, then your speed boost up about 25% . You could be faster and more effective just with a simple practice of shortcut keys and wen you became expert , your monitors appears as hacker's in movies


Note:- Not only the short key but also need to know the programming lol :)

I am Listing some short cut key I am using frequently if that helps you I would be grateful

  • Ctrl + G → Go to the line number
  • Ctrl +Tab → Select between the opened pages
  • Shift+Delete → Delete a line
  • Ctrl +C and Ctrl +V → Don't laugh , Everyone knows but a lot of people don't know the power this short key combination if you press Ctrl+C and Ctrl+V then you will get the entire line copied and paste to next line .
  • Ctrl+Shift +V → Cycles through the copied texts .
  • Ctrl+Right Arrow → Skip trough the words.
  • Shift+Ctrl+Right Arrow → Select a word
  • Shift+End → Select a cursor point to the end of line
  • Shift+Home → Select a cursor point to beginning of the line .
  • Shift+Ctrl+Home → Select a cursor point to the beginning of the page.
  • Shift+Ctrl+End → Select a cursor point to the beginning of the page .
  • Ctrl+Home → Goto the beginning of the page.
  • Ctrl+End → Goto the end of the page
  • Ctrl+T → Interchange the character on both side of the cursor
  • Ctrl+K+K → Book Mark a code and remove book mark
  • Ctrl+K+P → Goto the book marked line
  • F9 → Put a break point in the cursor line
  • Ctrl+Shift+S → Save all
  • Ctrl+U → Change selected text to lowercase letters
  • Ctrl+Shift+U → Change selected text to Uppercase letter
  • F12 → Goto definition
  • Alt+F12 → Peek to definition
  • Ctrl+M+M → Toggle outlining (open and close a cursor section )
  • Ctrl+M+L → Toggle outlining of entire page
  • Ctrl+M+P → Stop outlining
  • Ctrl+K+C → Comment a selected section or cursor line.
  • Ctrl+K+U → UnComment the selected section or cursor line .
  • Ctrl+Shift+N → Add new item
  • Ctrl+Alt+L → Show solution explorer
  • Alt + Mouse → Select a vertical part of code .
  • Ctrl+Space → Autocomplete Intelisence .
  • Ctrl+- → Go to the previous courser position .
These are comes in my mind please add up what you have as comment

Split screens

Let us consider the scenario that we want to copy some thing from end of a long page to top of the page or code same as the function below , What we usually do is scroll down and up continuously but there is some feature present in .net IDE is split screens That helps us to view the desired portion blow and at the same time we could edit on other screen which is most helpful and time consuming
there is also a full screen option available in .net press Shift+Alt+Enter then you could edit your source code in this model which is also a cool feature 

Screen Grouping

There is a feature in .net IDE that we can group the screens vertically so that we could easily copy from one page to another or cross verify the different pages



b) Look before you leap


It is very hard to code as speed as Hugh Jackman in sawadfish . I dreamed like to do code as fast as he does in that movie. I practice hard as I am practicing my typing skills I realized that not only the typing skills need to know what should I write next .Soon after finish one line of coding , we should code the next line in mind . Always think ahead ,everyone can do that with a little practicing.
Every human being is blessed with tremendous brain power , sky is our limit. Plan your block of code ahead and type as soon as possible and surprise your co-workers. Always remember , Plan your next block of code ahead. If you practice this way , not only your coding your life will get better and better. Make a habit to plan ahead


c) Excel The Wizard

I don't know how many programmers uses the Excel as your coding companion , I am using it as my code generating tool .
Consider the scenario that we have to create a class which has more than fifty properties and we have to create the properties as per the Database table . What we usually do is copy and paste every single property one by one . which will time consuming and a boring process , also we have to cross check if miss something .
What I am doing is , I had created an excel file which have the equation to generate properties by simply copy and paste the column name from database , I can create variables with its data-type.

I will explain with an example so that every body could understand

Consider I have to create an entity class which have 48 variables


I have to create a class Transaction with all these properties
what I am gonna do is create a class name Transaction as below shown

next open my excel which I have created and is equipped with my formula to create properties


and then I am gonna copy and paste entire column name to my excel


   and we need data-type too right, so simply copy and paste data-types from your database table design, from there we can select all data-types of your column with one copy and paste it on excel








and you ca see all variables are generated . It is a vb code .

You can do as per your requirements now copy and paste to your class it will take about maximum 1 minute and is not boring also :)


I am listing my excel formulas which I had used in above example

Which is work only in Open office calc

For Creating the Data-types
=IF(ISERROR(FIND("int";A1))=0;"Integer";IF(ISERROR(FIND("char";A1))=0;"String";IF(ISERROR(FIND("datetime";A1))=0;"DateTime";IF(ISERROR(FIND("decimal";A1))=0;"Decimal";IF(ISERROR(FIND("bit";A1))=0;"Boolean";IF(ISERROR(FIND("numeric";A1))=0;"Decimal";"--"))))))

A1 is copy pasted database Data-type

For creating the default Value

=IF(B1="Integer";"0";IF(B1="String";"String.empty";IF(B1="DateTime";"Nothing";IF(B1="Decimal";"0.0";IF(B1="Boolean";"false")))))
For creating the Variables

="Public "&D1&" As "&B1&" = "&C1

This is very simple example you can basically generate all type of repeating code using excel
Which is time saving and efficient . Reduced human errors also an advantage of this method. You can use excel in many ways think out of box...............

d) Advantages of copy and pasting

Don't underestimate the importance of copy and pasting in Software developing . Copy and paste not only helps you to save time but also helps you to develop a quality code. Because you are copying from a already tested and working code so the chances of getting error is very less.

Note:- Remember to remove programmer's name and date lol :)

Please leave your comment if this article helps you in anyway . If it helps you then I am very grateful . I am sure you also have some unique method to ease your programming and I would like to here it from you please share it with us as comment ..

Happy Coding..




3 comments:

  1. hi so informative keep posting this kind of tricks and tips

    ReplyDelete
    Replies
    1. Glad to know that it helped you please ho through my latest post on MVC interview questions http://grandhah.blogspot.in/2015/10/mvc-interview-questions-part-2.html

      Delete
  2. you should have provided a download link for your open office document sample:)

    ReplyDelete

Post Bottom Ad

Pages