• Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

We're also offering banner ads on our site from just \$5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.

### #Actualwarnexus

Posted 07 May 2013 - 01:43 AM

So I wrote this for my second project for Data Structures. The method chaining got out of control and I violated so many rules of encapsulation.

I have 2 years with general programming experience so how could I gone wrong? Well, I was so focused on getting the features of the program to work. Once I understood how the features was suppose to work, i just hop on my seat and started typing.

Behold my code:

// reduce exponent by one for all exponents greater than 1
Main.getPolynomialHolder().get(polynomialIndex).getPolynomialVector().get(i).setExponent(Main.getPolynomialHolder().get(polynomialIndex).getPolynomialVector().get(i).getExponent()-1);

Yeah...not pretty one bit. I am gonna get a failing grade for this...*virtual smack on forehead*

Let this be a lesson to all newcomers on what not to do. This issue is actually scattered in multiple lines of code. Aw man I am doomed.

### #2warnexus

Posted 07 May 2013 - 01:43 AM

So I wrote this for my second project for Data Structures. The method chaining got out of control and I violated so many rules of encapsulation.

I have 2 years with general programming experience so how could I gone wrong? Well, I was so focused on getting the features of the program to work. Once I understood how the features was suppose to work, i just hop on my seat and started typing.

Behold my code:

// reduce exponent by one for all exponents greater than 1
Main.getPolynomialHolder().get(polynomialIndex).getPolynomialVector().get(i).setExponent(Main.getPolynomialHolder().get(polynomialIndex).getPolynomialVector().get(i).getExponent()-1);

Yeah...not pretty one bit. I am gonna get a failing grade for this...*virtual smack on forehead*

Let this be a lesson to all newcomers on what not to do. This issue is actually scattered in multiple lines of code. Aw man I am doomed.

### #1warnexus

Posted 07 May 2013 - 01:42 AM

So I wrote this for my second project for Data Structures. The method chaining got out of control and I violated so many rules of encapsulation.

I have 2 years with general programming experience so how could I gone wrong? Well, I was so focused on getting the features of the program to work. Once I understood how the features was suppose to work, i just hop on my seat and started typing.

Behold my code:

// reduce exponent by one for all exponents greater than 1
Main.getPolynomialHolder().get(polynomialIndex).getPolynomialVector().get(i).setExponent(Main.getPolynomialHolder().get(polynomialIndex).getPolynomialVector().get(i).getExponent()-1);

Yeah...not pretty one bit. I am gonna get a failing grade for this...*virtual smack on forehead*

Let this be a lesson to all newcomers on what not to do.

PARTNERS