Wednesday, 24 October 2012

To Catch A Shooting Star

As I am starting to get back into computing after my break with it to learn about and solidfy personal discipline I came across an article that clarified something that used to puzzle me so much when 'playing around' with coding.

 I always struggled with the fact that once a process produced its outcome, say 5+5, the answer would be produced and the program would either close or go onto its next process seemingly destroying the outcome of the previous process. Well it turns out this is to do with the fact that computers only do what they are told and if you told them to add '5+5', that's exactly what they are going to do. You didn't ask them to save that outcome so they obviously are not going to do that for you. What you have to do however is 'Catch a Shooting Star'. The shooting Star in this instance being the outcome from the process that is going to blink up on your screen then just disappear. To save this shooting star you have to hold on to it, hold on to it by storing it as a Variable. 

 Hopefully this produced one of those 'ohhhhhh yeah, of course' moments to you as it did me'. Knowing that if I want anything to continue existing in computing it has to be stored makes a huge difference to the way I view programming and I am feeling far more confident about not being confused about why my 'programs' would just blink up and then disappear. One thing that still puzzles me however is where does that '25' (from the '5+5' example) go, is it just erased?, was it ever stored?. 









 Anyway I hope this provides a little bit more clarity to understanding programming as it did for me.


No comments:

Post a Comment