Tonight I was watching the show called "Hawking" on the science channel. There was a scene where Stephen was at a dinner with an advisor, family and acolleague. There was a discussion of Mozart and how he claimed to havean entire symphony in his head upon waking in the morning. One of the people didn't understand how this could be true as music is "temporal"- it can't all exist in just one moment. Hawkings mentor at thatstates that perhaps music is a way of thinking that goes beyond language, that perhaps that is what genius is - thinking without time.
I have to say that I agree with this respect to programming. I consider this to be an art, and that true ability for genius in programming isstunted by language, and that to be truly great in programming one must move beyond syntax / language and into abstract symbol manipulation. Details of syntax of languages bog down the mind into unnecessary details, obscuring the pure beauty of programming, and complicating theability to grasp large architectures outside the scope of the texteditor.
It's interesting to see that as Hawking's ALS progresses, he decides that it will be best for him to shed himself of the constructs of language so that he can more effectively develop in hismind complex thoughts on matter, gravity and space time. I often believe that this is a way that programming should be approached; andperhaps not just programming but overall system design andarchitecture, and that syntax of programming languages is an artifactthat can composed as an after thought.
This is interesting as I believe it also explains how one can have an entire symphony in theirmind at one moment, and how it can come into being in such a way. It is an abstract concept, built by the mind through processes that aren'tcompletely understood. In a book I read during the summer called "The Math Gene", (and I have to apologize as I don't have the exactreference here at this moment but I will give it later), great minds that think in this manner often come to solutions to complex problem soften out of the blue, when the mind is completely not focused on the problem at hand, and that allows it to use it's complex symbol and pattern manipulation capabilities almost without knowing.
I have to say that I have experienced this type of "light bulb being turned on", but I am not quite sure myself how this happens in my mind the way it does. All I know is that somehow by setting up my mind to have the correct constructs for thought in place, often when I'm doing somethingcompletely unrelated (such as working out in a gym), is when I get great insights, not when in the cubicle.
I tend to think that is has to do with patterns. Not necessarily patterns of software construction (as in the GoF), but of patterns of thought. Perhaps there are patterns in software that when properly structured in the mind just form natural forms of more complex interlocking patterns? I hope to explore these here in my blog as I ponder them through the near future.
Technorati Tags: Cognition
2963e04c-90a4-4cc0-9545-1fadbde25689|0|.0
Take the following code snippet to iterate across an array:
int[] ia = new int[] { 5, 4, 3, 2, 1};
for (int i=0; i<ia.Length; i++)
{
Console.WriteLine(ia[i]);
}
What'sthe problem with this code? Well, its just too verbose. I have asimple idea here, and I have to type way too much. All I want to do isdo something to every element in the array (in this case, it's print iton the console, but the process can be arbitrarily complex). To dothis, I have to say 'for', and then create a variable that I have toinitialize, increment and check for a completion state. I then have touse that variable to select the particular element of the array toprocess.
I can't tell you how many times I've had to type thisboiler plate, and it kills me every time as I have a simple idea, dosomething with each of the items, and I have to do a lot of problematictyping to get it done (I wont get into the reasons for problems - thathas been documented elsewhere quite well).
C# nicely has gone and made this a little simpler:
int[] ia = new int[] { 5, 4, 3, 2, 1};
foreach (int i in ia)
{
Console.WriteLine(i);
}
Atleast with the foreach construct, I don't have the initialization ofthe index variable, incrementation, termination comparison to type andget messed up. I still do need to have a variable to hold the currentitem, and the other boiler plate code around it (the 'foreach' andsuch).
Can't this be still simpler? How about the following:
int[] ia = new int[] { 5, 4, 3, 2, 1};
iterate ia |i| { Console.WriteLine(i) };
Theiterate keyword means just that - iterate across something. You figureout how to, Mr. computer. I'm just interested in doing something witheach item, which I'll refer to as the symbol inside of the pipes. Isn't this nice?
Yes, I know this is quite literally Ruby, but Ijust wanted to resolve this down to its essence for expositorypurposes. And also why I like Ruby, but more can also be accomplished,and this is another core concept of P#...
Technorati Tags: Patterns
8da14cd9-2b7f-43e9-b09d-510fa223320f|0|.0