The "Aha! Moment"
-
you have been stuck for hours and hours trying to solve something or fix something , whether be it an assignment, work or a home project. You feel you have checked every single tutorial Google had to offer and none of them helped :wtf: . Just as you are about to give up, a random thought comes to you,to which by some miracle is the unified solution to your problem. You get this rush and suddenly you scream out "Aha!" Have you ever had that moment? Please share your aha! moment.
The biggest AHA! moment I had on this industry was when my mind switched from structured programming to Object Oriented programming. I spent my early days of programming using VB 5 and 6, that lacked many fundamentol OO aspects so my young brain got trained on structured and that is very difficult to get rid of. Even though later I spent lots of time programming in OO languages, I wasn't really doing OO, not creating, but just using it. But then at one point in time it hit me, when designing a new system. AHA!! Now I know the advantages of OO programing and for the first time I built a system with a lot of reusable code. It was a series of AHAs! One after the other, but the first one started the roll and every time I pushed Ctrl+C on my code I looked again and figured how not to do it and use the OO way.
"To alcohol! The cause of, and solution to, all of life's problems" - Homer Simpson
-
you have been stuck for hours and hours trying to solve something or fix something , whether be it an assignment, work or a home project. You feel you have checked every single tutorial Google had to offer and none of them helped :wtf: . Just as you are about to give up, a random thought comes to you,to which by some miracle is the unified solution to your problem. You get this rush and suddenly you scream out "Aha!" Have you ever had that moment? Please share your aha! moment.
I started fiddling with Aspose.Words for document generation. They claim this is easy because you can program to a objectmodel. Well, what I needed was a "MergeField" in a table cell. And their clever 'builder' kept telling me, "you can not add this", "Table already ended.".. Fun stuff. Finally after much fiddling i found something that worked:
Cell cellStart = CreateCell(rowMergeValues, false);
builder.InsertField("MERGEFIELD " + MYVALUE, "«MergeField»");
var current = builder.CurrentParagraph;
current.Remove();
cellStart.Paragraphs.Add(current);
builder.MoveToDocumentEnd();Yes, add, remove, add, move pointer... Aha! The sad part about problems like these is, it's just a few lines of code.. How could that have taken so much time? Also, reading the book "Code Complete 2.0". (Code is read more often that written.) It really changed the way I program now.
-
you have been stuck for hours and hours trying to solve something or fix something , whether be it an assignment, work or a home project. You feel you have checked every single tutorial Google had to offer and none of them helped :wtf: . Just as you are about to give up, a random thought comes to you,to which by some miracle is the unified solution to your problem. You get this rush and suddenly you scream out "Aha!" Have you ever had that moment? Please share your aha! moment.
well, i had one only 3 weeks ago, i was working on a system at work and the problem I was trying to solve was related to copying and pasting Excel data to import it into the database. I agree, this is an unusual approach to upload data into database as opposed to just simply upload the file, open it and read from it. Anyway, so the problem was that if the excel worksheet had the last x consequent number of columns empty, the system was truncating those columns and that caused the upload to fail on account of accessing indices or locations that didn't exist. I contemplated whole plethora of potential solutions from re-writing the copy and paste functionality to trying to understand if its an operating system fault or the system's to even making the columns mandatory, to fix this. After a couple of days of head banging thus, i wasn't even thinking of a solution but just wondering how can i make the system believe that there are non-empty columns so that the array which reads the columns always had the same length. And VOILA!!! there it struck, it just shone on me in one brief second and literally I jumped from my chair, punched the air and let out a semi-loud "YEAH!" (sorry not AHA! :) ), even before writing the code which would just append empty strings in place of empty columns based on length comparison of the header array and the data array. This code became so visually clear to me that testing it would have been an insult to my work ;). So I just deployed this code to live web server and needless to say its been working flawlessly to date. Cheers
-
you have been stuck for hours and hours trying to solve something or fix something , whether be it an assignment, work or a home project. You feel you have checked every single tutorial Google had to offer and none of them helped :wtf: . Just as you are about to give up, a random thought comes to you,to which by some miracle is the unified solution to your problem. You get this rush and suddenly you scream out "Aha!" Have you ever had that moment? Please share your aha! moment.
I remember this well because it gave me a really dark feeling. I faced it when a program just gave weird wrong calculations. To be specific : (9.7-5.7) >= 4 returns false I couldn't believe it at first, but at the end it was an 'Aha!': http://www-10.lotus.com/ldd/nd6forum.nsf/55c38d716d632d9b8525689b005ba1c0/ee60e29d22ac75e1852577c4004f8328?OpenDocument[^]
-
you have been stuck for hours and hours trying to solve something or fix something , whether be it an assignment, work or a home project. You feel you have checked every single tutorial Google had to offer and none of them helped :wtf: . Just as you are about to give up, a random thought comes to you,to which by some miracle is the unified solution to your problem. You get this rush and suddenly you scream out "Aha!" Have you ever had that moment? Please share your aha! moment.
I had three really really major ones in University; The first real moment for me was grasping the concept of recursion, the second was the concept of object orientation, the third was dynamic/iterative programming. I'm still waiting for the one on the topic of functional programming... On a side note, I had minor "A-Ha!" moments about once a minute during the CS lab assignments - although they were more of the "Oh, so that's why it won't work! :doh: " variety. Also, I didn't use the term specified, instead opting for the slightly more sarcastic "Bingo!" everytime I detected a flaw in my algorithms. It came to the point where my lab partner would beat me to it: I slammed the palm into the table and he'd shout "Bingo!" just ahead of me. It felt good to know that I had an influence on his education... :)
-
Yeah, often. I have done this alot with all sorts of problems. Even dreamed of solutions.
============================== Nothing to say.
Me too, wake up in the middle of the night ..."Aha!!... or Got it!!!", after this, I need to write the solution, or in the worst case, start to work at that time... yeap, happens from time to time, and is priceless!!!
-
Me too, wake up in the middle of the night ..."Aha!!... or Got it!!!", after this, I need to write the solution, or in the worst case, start to work at that time... yeap, happens from time to time, and is priceless!!!