<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-408960218141579147</id><updated>2024-11-05T18:44:26.620-08:00</updated><category term="How excption occurs"/><category term="What is an Exception"/><category term="program"/><category term="real life exception Example"/><category term="software programming"/><category term="software programming and life"/><title type='text'>saturday blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://abirs-saturdayblog.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/408960218141579147/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://abirs-saturdayblog.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Abir</name><uri>http://www.blogger.com/profile/00643715590138105701</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-408960218141579147.post-224568444006935979</id><published>2010-02-27T05:30:00.000-08:00</published><updated>2010-03-14T11:50:20.647-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="How excption occurs"/><category scheme="http://www.blogger.com/atom/ns#" term="real life exception Example"/><category scheme="http://www.blogger.com/atom/ns#" term="What is an Exception"/><title type='text'>I am an Exception .....</title><content type='html'>Sunday afternoons are  slow,calm,quite and peaceful. I usually like to spend my sunday afternoon at my favorite coffee shop sipping my favorite cold coffee(cappe nirvana),sitting beside the window watching time fly slowly.&lt;br /&gt;
&lt;br /&gt;
On last sunday something unusual happened …. a  couple in the coffee shop suddenly started arguing with the waiter for bringing the wrong order(to be  honest poor waiter was not at fault,they placed  the wrong order).As situation was about to get tensed  ,suddenly cafe manager came into the picture from nowhere,listened to the argument patiently  and  handled the situation in a very diplomatic manner. This  situation could  have grown worse and it might have resulted in the feeling of sickness among the other customers  also and they might have walked out disrupting the normal flow of business and afternoon also, but the situation handled by the cafe manager was remarkable.&lt;br /&gt;
&lt;br /&gt;
Suddenly I realized that cafe is also a sequence of predefined actions(taking order,serving order,billing etc.),in other word it is also a program,and an exception occurred which was handled appropriately avoiding untoward situation. In the smooth flow of the cafe business suddenly the wrongly place order was about to break the flow,this event was similar to the “Exception ” in the programming.&lt;br /&gt;
&lt;br /&gt;
Exception is shorthand for the “Exceptional Event”  or in other words is the event that disrupts the normal flow of the program.&lt;br /&gt;
Whenever an exceptional event occurs within the method ,the method creates an object (which is called as Exception object )of it and hand it over to the runtime system ,this process is known as “throwing an Exception”.(In above scenario method was to placeOrder and exceptional event was wrong order)&lt;br /&gt;
&lt;br /&gt;
The runtime system  will try to find something to handle this exception object, in the Call stack, Call Stack as the  name is the ordered list of all the methods that had been called ,in reverse order ,to get the method where exception occurred. &lt;br /&gt;
The runtime system actually looks for the Exception handler which is a  method in the call stack that contains the block of code to handle the exception .(cafe manager played the runtime system and looking for the solution  for the unexpected situation was similar to looking for call stack for the handler)  &lt;br /&gt;
&lt;br /&gt;
When an appropriate exception is found (by appropriate exception I mean if the type of the exception object thrown matches the type that can be handled by the handler.) runtime passes the exception to the handler. The exception handler is said to catch the exception.(when the manager handled the situation completely)&lt;br /&gt;
&lt;br /&gt;
If the runtime exhaustively searches for the handler and if it doesn&#39;t find one one then comes the nightmare of any developer ….the flow terminates.&lt;br /&gt;
&lt;br /&gt;
Exceptions are not the crime or something which is unforgivable but is some unexpected situation occurred which have caused the normal flow to disrupt.&lt;br /&gt;
&lt;br /&gt;
So I have started behaving like a cool cafe manager. whenever I find an exception I coolly go to the method where exception occurred  and say “hey how may I help you ?” and put my exception handling solution around it .&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
var gaJsHost = ((&quot;https:&quot; == document.location.protocol) ? &quot;https://ssl.&quot; : &quot;http://www.&quot;);
document.write(unescape(&quot;%3Cscript src=&#39;&quot; + gaJsHost + &quot;google-analytics.com/ga.js&#39; type=&#39;text/javascript&#39;%3E%3C/script%3E&quot;));
&lt;/script&gt;&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
try {
var pageTracker = _gat._getTracker(&quot;UA-15241187-1&quot;);
pageTracker._trackPageview();
} catch(err) {}&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://abirs-saturdayblog.blogspot.com/feeds/224568444006935979/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://abirs-saturdayblog.blogspot.com/2010/02/i-am-exception.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/408960218141579147/posts/default/224568444006935979'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/408960218141579147/posts/default/224568444006935979'/><link rel='alternate' type='text/html' href='http://abirs-saturdayblog.blogspot.com/2010/02/i-am-exception.html' title='I am an Exception .....'/><author><name>Abir</name><uri>http://www.blogger.com/profile/00643715590138105701</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-408960218141579147.post-4413497397771288709</id><published>2010-02-19T12:56:00.001-08:00</published><updated>2010-02-25T09:54:01.178-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="program"/><category scheme="http://www.blogger.com/atom/ns#" term="software programming"/><category scheme="http://www.blogger.com/atom/ns#" term="software programming and life"/><title type='text'>I don&#39;t know what is programming............</title><content type='html'>&lt;meta content=&quot;text/html; charset=utf-8&quot; equiv=&quot;CONTENT-TYPE&quot;&gt;&lt;/meta&gt;&lt;title&gt;&lt;/title&gt;&lt;style type=&quot;text/css&quot;&gt;
 	&lt;!-- 		@page { margin: 0.79in } 		P { margin-bottom: 0.08in } 	--&gt;
&lt;/style&gt;&lt;br /&gt;
&lt;div style=&quot;font-style: italic; margin-bottom: 0in;&quot;&gt;After spending &lt;b&gt;a&lt;/b&gt; couple of years as a hardcore programmer , I have realized that I don&#39;t know what  &lt;/div&gt;&lt;div style=&quot;font-style: italic; margin-bottom: 0in;&quot;&gt;is programming or I can say that I have been doing &lt;b&gt;programming &lt;/b&gt; since the day I was born .&lt;/div&gt;&lt;div style=&quot;font-style: italic; margin-bottom: 0in;&quot;&gt;While I was programming a new chat system, I observed that I have been missed out something for&amp;nbsp; so many years of programming.There lies a striking &lt;b&gt;similarity&lt;/b&gt; between programming and day to day life.&lt;/div&gt;&lt;div style=&quot;font-style: italic; margin-bottom: 0in;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-style: italic; margin-bottom: 0in;&quot;&gt;Life is a series of the sequences woven together logically and programming is no different. It may because of the educational culture of India that I &lt;span class=&quot;blsp-spelling-error&quot; id=&quot;SPELLING_ERROR_0&quot;&gt;couldn&lt;/span&gt;t observe such a beautiful similarity before .&lt;/div&gt;&lt;div style=&quot;font-style: italic; margin-bottom: 0in;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-style: italic; margin-bottom: 0in;&quot;&gt;Lets take an example when we ask someone “what&#39;s your program dude?” or we when say to bunch of our friends”lets set the program”. Or when we turn on the idiot box runs a list of coming up programs, it means a sequence of predefined actions.&lt;/div&gt;&lt;div style=&quot;font-style: italic; margin-bottom: 0in;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-style: italic; margin-bottom: 0in;&quot;&gt;Lets break this buzz word “Software Programming”,” software”= computer instruction or data , “program” = a series of the steps to be carried out.  &lt;/div&gt;&lt;div style=&quot;font-style: italic; margin-bottom: 0in;&quot;&gt;Software programming is a sequence of the predefined instructions to the computer (in short) . For every input there are some predefined actions to be performed, for example when we insert our ATM card into the cash dispenser machine the software in that machine has been designed to read the card, on clicking “withdrawal” to dispense cash.  &lt;/div&gt;&lt;div style=&quot;font-style: italic; margin-bottom: 0in;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-style: italic; margin-bottom: 0in;&quot;&gt;This is something similar to the good old banking culture,where we use to fill up the pay in slip and hand it over to the teller (whose cold looks can even freeze the time) who will send it over for further processing and after spending hours over there u get your long awaited money.&lt;/div&gt;&lt;div style=&quot;font-style: italic; margin-bottom: 0in;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-style: italic; margin-bottom: 0in;&quot;&gt;After thinking lot over it I realized that software programming is not an end product(as it is projected to the newbies) its a mean to achieve it. In the above stated example of the ATM cash dispenser machine,software installed wont generate the money or it wont create the ink to print the receipt .But rather logically woven string of actions: when the card is inserted read it when clicked enter open the vault when user wants to wind up print the receipt .  &lt;/div&gt;&lt;div style=&quot;font-style: italic; margin-bottom: 0in;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-style: italic; margin-bottom: 0in;&quot;&gt;I laugh now at myself for the moments when I used to say “I can do anything” The fact is that I can weave the software into a series of &lt;b&gt;sequential actions&lt;/b&gt; to achieve a certain task .Java can be use to make a program to prepare the coffee but it cannot create coffee beans,&lt;/div&gt;&lt;div style=&quot;font-style: italic; margin-bottom: 0in;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-style: italic; margin-bottom: 0in;&quot;&gt;Program a Great weekend Guys........&lt;/div&gt;&lt;div style=&quot;font-style: italic; margin-bottom: 0in;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://abirs-saturdayblog.blogspot.com/feeds/4413497397771288709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://abirs-saturdayblog.blogspot.com/2010/02/i-dont-know-what-is-programming.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/408960218141579147/posts/default/4413497397771288709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/408960218141579147/posts/default/4413497397771288709'/><link rel='alternate' type='text/html' href='http://abirs-saturdayblog.blogspot.com/2010/02/i-dont-know-what-is-programming.html' title='I don&#39;t know what is programming............'/><author><name>Abir</name><uri>http://www.blogger.com/profile/00643715590138105701</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>