Search

Spinning your wheels.. It's 11pm.. due at 12!: The concepts behind the solution

It’s 5pm on Sunday evening and you decide it’s time to break out your 1st Java assignment, which is due later that evening at 12am. No big deal, you have plenty of time! What can’t you do in seven hours? I mean that’s like at least 40 games of Halo. You stall another hour (playing Halo) until six 0clock at which point you decide you better get started just in case. You glanced at the problem earlier in the week, no biggie. A couple of inputs, some basic processing, some formatted output, and maybe the professor threw in some easy twist. Two maybe three hours tops, you’ll be counting sheep by ten.
 
The clock strike’s ten; you have 25 IM windows open (3 hopefuls). You’ve Googled the same thing 25 times, you have more red squiggly lines than if you had written a letter in Spanish inside MS. Word, your code doesn’t compile,  and it looks like this…
 
public class Chaos {
 
    //default constructor public Chaos()
    {
        x = 0;
    }
 
   public void static main void(stirng argumnets [ ) {  
     
         Scanner scanner int = input;
     
     int x = 0; int y = 0;
 
         while(true) {
          x = x +1;
 
            JOptionPane.showMessageDialog(“Please help me”);
           Int z = (int) x + ;
 
 
          New Chaos(); }
// 
  }};
 
 
 
It’s now 11pm, one hour to go. You’re now online searching for a coder for hire ready to spend your tuition on the answer. Subject: JAVA 101: Need assignment help in next hour PLEASE ASSIST! Will PAY ANY AMOUNT (I got cheeseburgers). In the next 45 minutes you manage to clean up a bit of the chaos and by 11:59 you turn in some solution that at least compiles, but as soon as the user enters any input and presses enter or clicks OK, boom! 34 errors Exception in thread "main" java.lang.NullPointerException Line 32…..
 
 
The assignment is returned..
 
Grade: C -
 
Comments:
You didn’t follow directions, your algorithm is nonsense, you are terrible, drop the class now or you will expire, you will fail my course, you suck.
 
 
You’re not alone! I come across this scenario more often than not. I’d say it’s very rare I see a student with a 99% completed solution with the exception of some missing bracket or that is asking for efficiency help (never). A majority of cases I run across are that frantic student at the top of the hour, hell bent on finding an answer, ready to break all moral compass to succeed.
 
 
The problem is not a lack of intelligence or the assigned problem itself (usually fairly straight forward). The problem lies in failing to understand concepts and that C, C++, Java, C#, Python, or any language are simply tools, which in their own way, demonstrate these concepts. Many languages today enforce the Object Oriented (OO) paradigm (Java, C#). Other’s don’t enforce the OO paradigm, but are OO themselves such as Python, which for example, allow the choice between say OOP and other paradigms (procedural, functional, imperative, etc) or a combination of such. Each of these languages has their own intricacies and unique way of doing things. Some are more powerful than others in certain areas. Python has a strong presence in the scientific community with libs such as matplotlib, scipy, numpy, and close ties with R. Java is well established in the multi-tier web application (MVC) solution space. Of course there are exceptions to the above rules and proclamations, there are thousands of languages and many are not OO and OO does not fit all problems. However, it’s fair to say a majority of the 101 courses I see fall into this category.
 
“The professor told me that everything is to go in the main method and if we don’t do that we’ll get points off!” The idea here is to teach the very basics of the language your primitives vs. refs, your order of operations, your mods, your Strings and your outputs before moving on to OOP. The problem I find here is memorization; it’s tedious, difficult, frustrating, and prone to 10pm fanatical searches for the answers. Once a similar solution is found, it’s pasted into the main method, and hacked until it compiles. The student is exhausted, left with a bad taste in his mouth for programming, and ends up repeating this cycle until either he/she drops the course or comes out hating Java. I assure it’s not Java you hate!
 
 
What if I told you, I never memorized a single piece of syntax in my life? That isn’t to say repetition didn’t play a role in my learning. I’ve presumably typed System.out.println () a half million times.. However, I have never typed System.out five times in a row in an effort to memorize syntax. Not to toot my own horn here, but I was the number one student in my intro programming courses for one reason and one reason only. I focused on the task at hand because I understood some basic concepts and how those concepts fit together early on. Primitives vs. Reference types, how to call a method with a reference type and dot notation, integer division gives integer results, and the basic components that make up an object such as attributers and behaviors. With just a few of these concepts I began thinking about problems from these perspectives, there was no translation needed from English to solution to OOP to java to IDE only concepts to solution. By the time I was ready to record my solution, the language had nothing to do with it, a simple formality.
 
 
Take the time to learn these few concepts, language aside. That is the pseudo code, the annoying tables, and the grammar concept behind all Langs. My promise to the student is if you take the time to understand a few simple concepts, you’ll never memorize another piece of syntax in your life. You may have to look something up, but you’ll know what you’re looking for, what you want, and how it works and why. You’ll discover that the solution to your assignment is as easy as you thought it was and all that time your peers are spending on getting their programs to compile, you’re now spending on making your solution as elegant and efficient as possible.
 
 
I leave you with a few of these concepts, not by any means a complete list, but a good start. Learn these and get back to Halo, The answer to your null pointer exception is here..
 
 
A few concepts: 
-Primitive VS Ref types (See python everything is an object)
-Class -Method -Constructor -Attributes -Behaviors -Arguments Vs. Parameters -Encapsulation -Inheritance -Polymorphism -Difference between classes an objects- -Your basic loop types and their differences (when to use each) -Selection statements a. Switch b. Continue c. Break - Access modifiers -Setters/ getters -Static vs. Non Static -declarer vs. init. -null vs 0, 
 
Let me know how I can help. 
 
Good luck,
 
Mike

Comments

Great read! As a programming newbie, I experience the feelings you mentioned in this blog often. Hopefully my views on programming will turnaround. 
if (isMyPost) { }