I cheated!

Or innovated!

I had a hard time following the school program. Sitting down, watching a teacher with no confidence talk about things that are supposed to be exciting was not my idea of learning a new skill. I once read somewhere that in the United States education system, the motto is No child left behind. Here I was sitting down in class feeling left behind. I came to school to learn the minimum to be propelled into a career where I will be able to grow and never have to worry about bills, grocery price, or rent. But the professor was talking about "Java or JavaScript", then gave us code to copy and paste into a dot HTML file. None of this made sense to me.

Years before, when I was on my last year of high school in Egypt, I had taken a couple of programming classes. My father knew of my love for computers, so he did his best to expose me to technology as much as possible.

I went to high school in the morning, and in the evening I went to the American University of Cairo. There I took two classes: Data structure and problem solving using C. These classes were hard for me, they were in English and I had not signed up for the TOEFL class yet. I was only fluent in French. I did pass the class however and it gave me a good foundation for coding.

The C language and JavaScript are two very different beasts, but when you have a good foundation in one the other becomes tolerable.

In the US, I took a JavaScript class. One day, I had a bug that I could not fix. I spent the weekend on it in vain. I deleted the project and started anew only to reproduce the same bug over and over. I had created a link dynamically and every time I would click on it, the whole page would become blank. There were no errors, only failures.

On the next day of class I told my teacher about my struggles. Imagine asking this question to someone who teaches programming and yet still confuses Java and JavaScript. After looking at my code for a while, she went back to her desk, and tried running her teacher's version provided by the book. It worked. I asked, "Can you help me figure out what's wrong with mine?" and to this day I still remember her answer:

Well mine works.

(><)

I didn't really know how to respond to that. So she opened the dot js file in TextPad and hit the print button. 200 lines of monospace code wrapping around is neither pretty nor fun to read. This was the most I was going to get out of her. I only ever asked her one more question after that: what is the keyword this in JavaScript. Her answer deserves its own story, so let's just say I never asked her a question again. In some way I want to say that she helped me, in the sense that she didn't stop me from exploring my own solutions. I became self reliant.

Sometimes the best way to find a solution is to put it aside and comeback later with a fresh mind, and I did just that. When I came back, I narrowed the issue to a smaller part of the code, then a few yahoo searches revealed the problem and I was on my way to the next assignment.

Solution: In case you are wondering what the problem was, using document.write in JavaScript after the document has finished rendering, causes it to overwrite the content. So instead, you can append a new object to the DOM.

This is the mentality I developed eventually:

If you can restructure the problem into a series of simple yes or no questions it is much easier to deal with it. Accumulation of small annoyances will stress you and make you react poorly when facing a challenge.

The next assignments were much easier to deal with. I completed all the exercises from our book in a month and went on to tutor the rest of the class for a modest price per head. At the same time I looked for freelance jobs.

At the end of this class, we had to make a group project. We had to use everything we learned from each chapter. Unfortunately, the rest of the class couldn't finish all the book so the chapter 6, 10, 11, and 12 were not included. But I completed them. So in our project, I made use of Ajax which was only taught in chapter 12. Using Ajax on a local file system came with its own sets of problems. I didn't understand HTTP status code at the time but I read that you would need a local server running to make use of it correctly. Since all the computers at school are equipped with Visual Studio and IIS I did just that. Our project titled "The Coral Reef" received the highest praises, my teammates and I all got shiny As.

I liked programming. I didn't care if the teacher was good or bad, because I could just register for a class and learn on my own. So I took a Server Side programming class with C# in the following semester. It was the same teacher. It was much harder, and there was no way in hell I was going to ask her to help me with anything. I learned about server side technologies and practiced on my own. When homework was due, I would just copy and paste code and send it... No I wasn't cheating, she provided the code. I got an A.

So I learned client side and server side programming. For web development, it was all I needed to get started. My financial situation wouldn't even allow me to continue going to school, so I had to be on my way to find real work.

Two years and many gigs after, I worked in a large company. It was a stable job. I knew that every other Friday there would be a paycheck waiting for me.

I learned to write better structured code. I was surrounded with good mentors that helped me learn more and received real world experience. I worked on projects with hard deadlines. I had the opportunity to write enterprise level tools from scratch. Designed the database schema, wrote the web server rules, wrote a caching strategy. I built fancy reports both on the back end and front end. I was the go to guy, for any obscure bug encountered, whether it be on the client-side or server side. It was exciting. Even though everyone complained about how low the pay was, I was getting priceless experience.

Cheating code

Then came a Monday morning when I got a call from an old classmate. She was still in college and she was an assistant to the old professor. They needed my help regarding our old group project. A couple days later, I received an email from the professor asking me if I could come to one of her class with my final project if possible. I responded with enthusiasms.

On that day I went home and opened up my old code. The project was written and tested on IE6. So naturally I updated a few things to some more modern JavaScript. I also updated the Ajax code to work without the need of a web server.

I went to school. My old classmate was now the teacher's assistant. We had worked on that final project in the good old days. The problem was that the teacher wanted to show her students an example of a working project that they could do for their final. They tried to run my project and they couldn't get it to work. If only she had taken the time to debug it.

Instead, they had me come in to fix it. IIS was disabled. Instead of trying to fix the code, I pushed my USB drive in and copied the new code. She asked me what was the problem. I explained that the response code for the Ajax request was 0 when you try to make a request on the local file system. For it to match the book I had to use a web server like IIS.

WHAT?! You used a web server?

I answered yes of course and she freaked out. Then she added: "Students are not allowed to use a server. You guys CHEATED!"

I laughed and thought, "OK, where are the cameras, you guys got me". There was not a shadow of a smile on her face, she was dead serious. Deep down I knew why she was mad. She was ashamed. She was mad because she wanted to show her students a good working project and she couldn't. She tried to debug it and she couldn't. So to look good in front of her class, she has to blame someone, a student, not her inability to figure out code like any respectable hacker would do.

After all the accusations and threats of taking back our grades, she cooled down and said she will let it pass this time. Her reason was, I helped a lot of students pass her class. So I spent the rest of the class presenting the project and gave advice to work in the field.

After class, I met with the teacher's assistant to discuss the ordeal. She was afraid she was going to be expelled from school for a project she only slightly contributed to. I didn't care much since I had already dropped out and was working as a programmer, but I was a little concerned. But since we had the teacher's "forgiveness" we were fine.

At work, when I find clever hacks to get something to work I am applauded and in some occasions even given a raise. In school, I used a solution that was taught in a chapter the teacher didn't get to yet and I was called a cheater. You go figure!

So the verdict is simple. I cheated. I found a clever way (not so clever) to make Ajax calls on my school project.

When I was learning programming in my high school years, the teacher was an experienced programmer. He had real software in the market. He would open his IDE on the projector make modifications and show us the results. You couldn't copy and paste from the book because there was no one universal solution to the problems. Some students would use (n(n+1))/2 to find the sum of an array of numbers, while others would use a for loop and add each number. You are free to use the method that makes sense to you. The computer is the machine doing the science and student tells it what to do.

Unfortunately Programming is not really taught in school. If it is, it is viewed as a science. It is not. Programming and computer science are two different things. Most students graduating with a Comp Sci do not necessarily know how to program. I would know, I interviewed and worked with a few of them. Programming is an art. It is the art of solving a problem with code. Programming is not just the code part, like any language it is a also a culture.


So this is my story of how I cheated in school. I have to make a confession though. I cheat everyday. I also use other people's code. I don't even ask them. I find it on their website and I take it. I use it at home, at work, or when I teach someone else. I can't stop it and I won't stop it. Every time I meet a new graduate, I tell her to cheat. I tell her to use her creative mind to find a solution to problems. If she can't then she can use Google. Ask a question on Stackoverflow. Find a working solution even if it is unconventional.

That is how you learn. That is how you advance in your career. That is how you become a programmer worth is salt.


Comments

There are no comments added yet.

Let's hear your thoughts

For my eyes only