Excuse me for a second, I am going to get very technical.
For those that want the tldr version: If you do not program right, you can ruin your hard drive quickly.
My background is in Computer Engineering and so I have my years of experience in low-level languages. One of the best features that I saw huge use for in my first year was in using C++ with pointers.
The hope is that you can use less processing power of locating, accessing, and then releasing memory by doing the foundational work yourself instead of using API functions that have lots of processing overhead. The concern is that if done wrong, you will loose your data and potentially corrupt your entire hard drive.
Now, to the devastation.
You Cannot Prove Stupidity
My project was to create a simple cash register application that hosts global variables of money, (a penny equals one cent, a fifty dollar bill equals 50,000 cents) then when someone “bought something” take the cost of the object (stored locally) and come up with the change that is to due to them. If we could use the API function, I could have this program done in an hour, easily. But we were playing with pointers.
Most programming software comes with debugging mode and the “run now” mode, including Microsoft’s Visual Studio that I was using to create a program. The issue with pointers is that you cannot debug it, because you can use it correctly until everything has gone wrong. The best way to debug is to have a set of free eyes look at your code, whether you take the night off and come back or grab a friend. Of course, I waited till the night before to write the code… so I had to try to do it myself.
If You Break It Once, Break It Again
Having written up my alpha version of the application, I decided to run it, thinking I had all the bugs fixed. Unfortunately, I was incorrectly using a pointer, which by itself is not a problem. Yet, this pointer was running in an endless loop and hidden in a custom function. In 10 seconds, I realized something was wrong but my computer was already locked up and within a minute and half, the university’s computer hard drive was corrupted and would need reformatted.
*sigh*
So what was my solution? Upload it off the shared server onto another computer and fix it. Harmless, right? 5 hours later, an energy drink or two, and two more corrupted hard drives, I finally had a working application. I got about 4 hours of sleep that night, an A on the assignment, and a lesson on why you do not wait till the last minute (I would need to learn that lesson about 20 more times before it would stick).
There is something to be said about doing it right the first time, but many times that is impossible.
Anyone else have a great programming “tech wreck” story?
[…] No More Memory […]