Saturday, April 13, 2013

Recursion in Microsoft Visual Studio


I've upgraded to Microsoft Visual Studio 2012 recently and am very happy with the new IDE.
I don't really want to get into the differences between the versions and the "whats new" list right now since you can easily find them with Google. http://www.lmgtfy.com/?q=what%27s+new+in+visual+studio+2012
I would however, like to talk about Recursion.

Recursion is basically a programming technique involving the use of a function that calls itself one or more times until a specified stopping condition is met at which time the rest of each repetition is processed from the last one called to the first.

A common "bug" when you don't set your stopping condition correctly. In such a case the recursion process keeps calling itself until it uses all the processes resources and crashes.
When this happens it is clearly a programming bug and not the IDE's fault.

I made a recursion error that I believe the new IDE should have stopped me from making.
Below is the snippet, can you see the problem ?

       private int recursionInt;

        public int RecursionInt
        {
            get { return RecursionInt; }
            set { recursionInt = value; }
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            int tmp = RecursionInt;
        }


The get function of the RecursionInt Property calls itself instead of recursionInt (I capitalized by mistake).
here is the screen capture of the exception
Property Recursion Exception

I would have thought the new Visual Studio IDE would detect such simple mistakes and stop the at design time just like they do when a function does not return any value.

What do you think ?

Just for fun, take a look at recursion by searching for it with Google.


Google is using the "Did you mean" feature, to illustrate the definition of recursion.
Check it out: https://www.google.com/search?q=recursion




34 comments:

  1. Thanks for your informative blog!!! Your article helped me to understand the future of .net programming language. Keep on updating your with such awesome information. .net training | dot net course Chennai

    ReplyDelete
    Replies
    1. I have read your blog its very attractive and impressive. I like it your blog.

      Dot Net Training in Chennai Dot Net Training in Chennai .Net Online Training .Net Online Training Dot Net Training in Chennai

      Dot Net Online Training .Net Online Training ASP.NET Online Training ASP.NET Online Training

      Delete
  2. I am reading your post from the beginning, it was so interesting to read & I feel thanks to you for posting such a good blog, keep updates regularly.
    Regards,
    SAP training in chennai|SAP training chennai|SAP Training in Chennai|sap training in Chennai

    ReplyDelete
  3. I like your writing style, it was very clear to understanding the concept well; I hope you ll keep your blog as updated.
    Regards,
    Angularjs training in chennai|Angularjs training chennai|Angularjs course in chennai|Angularjs training center in Chennai

    ReplyDelete
  4. Thanks of sharing this post…Python is the fastest growing language that helps to get your dream job in a developing area. It says every fundamental in a programming, so if you want to become an expertise in python get some training
    Regards,
    Python Training in Chennai|Python Training|Python Training Institutes in Chennai

    ReplyDelete
  5. Updating with the latest technology and implementing it is the only way to survive in our niche. Thanks for making me understand through this article. You have done a great job by sharing this content in here. Keep writing article like this.

    DOT NET Training in Chennai | DOT NET Course in Chennai | DOT NET Training Institutes in Chennai

    ReplyDelete
  6. Thanks for your informative article on software testing. Your post helped me to understand the future and career prospects in software testing. Keep on updating your blog with such awesome article. Best software testing training institute in Chennai | Software Testing Training in Chennai | Software testing course in Chennai

    ReplyDelete
  7. Angular JS is a structural framework for dynamic web application and angular's data binding eliminates much of the code that you would otherwise write it.
    Angularjs Training in Chennai | Angularjs training Chennai

    ReplyDelete
  8. I have read your blog its very attractive and impressive. I like it your blog.
    ibm-message-broker training in chennai

    ReplyDelete
  9. Well Said, you have furnished the right information that will be useful to anyone at all time. Thanks for sharing your Ideas.
    Web Designing Course in Chennai | web designing training in chennai

    ReplyDelete
  10. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.
    Dot net training in Chennai | dot net course in Chennai

    ReplyDelete
  11. The blog was absolutely fantastic! Lot of great information which was helpful
    Best software testing training institute in velachery

    ReplyDelete
  12. Thanks for posting this useful content, Good to know about new things here, Let me share this,
    AngularJS Training in Chennai

    ReplyDelete
  13. Thanks for posting this useful content, Good to know about new things here, Let me share this,
    AngularJS Training in Chennai | AngularJS Training | Best AngularJS Training Institute in Chennai

    ReplyDelete
  14. Interesting article. Thank you for your nice post. ERP in Chennai

    ReplyDelete
  15. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it. The python programming language is very popular and most widely used.
    Best Angularjs Training in Chennai
    angularjs training center in chennai

    ReplyDelete
  16. Excellent blog... the concept of microsoft visual studio is really superb with understandable manner..
    Software Testing Training in Chennai | Six Sigma Certification Training in Chennai

    ReplyDelete

  17. This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me...
    Android Training in Chennai
    Ios Training in Chennai

    ReplyDelete
  18. Excellent Blog, it is very impressive and attractive to read your blog, thanks for sharing. keep rocks..
    Android Training institute in velachery | Android Training in velachery

    ReplyDelete
  19. Nice and good article.. it is very useful for me to learn and understand easily.. thanks for sharing your valuable information and time.. please keep updating.
    Java Training Institute in Chennai | DotNet Training Institute in Chennai | Web Designing Training Institute in Chennai

    ReplyDelete
  20. I agree with your blog, really your blog contain very useful information. Thanks for sharing such a nice blog. CCNA Training Institute in Chennai | CCNP Training Institute in Chennai | Six Sigma Training in Chennai

    ReplyDelete

  21. This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information, this is useful to me…
    No.1 Software Testing Training Institute in Chennai | Best Selenium Training Institute in Chennai | ISTQB Certification Center in Velachery

    ReplyDelete
  22. Thanks for sharing such informative article. Know about Know about English to Tamil from techfizy.

    ReplyDelete
  23. Interesting post! This is really helpful for me. I like it! Thanks for sharing!
    office 2016 professional plus deutsch download

    ReplyDelete