Course Review

--Originally published at Hell Yeah

I am currently in the last few hours before the end of the Object-Oriented Programming course, taught by Ken Bauer, with whom I happen to share birthday.

This course was made in such a way that I never saw before. The learning was left almost entirely to us, Ken was more of a guide than a teacher, and I think that was a great way to structure it.

In terms of learning, I went in with little to no knowledge of Java. Object-Oriented Programming in general was an area almost completely unknown to me. With the problems that Ken “assigned” and a few on my own, I was able to learn more about how Java works and why OOP is often used instead of Imperative Programming. Not all of it was practice, the videos that we watched offered interesting perspectives on the theorical side of OOP, along with the opinions of people far above us in knowledge of this topic.

I also learned to use a little of Eclipse, a tool that is used a lot in Java programming. It is, as Ken said at the beginning of the course, a Titan of a program. It has a lot of things that I have no idea what they do or why they are there, but the things I learned to use, I found that were extremely complex but not unnecesarily. What it does, it does not do in a half-assed way, but it can be overwhelming at times.

Also, Github. I have had my Github account for ~2 years, not knowing what it was. I saw on /r/learnprogramming again and again that having a Github account is essential in this line of work, but I never really understood why. Now, I still have a lot to learn and understand about it, hell, I can’t use the terminal commands for git without a guide open in another window, but I know why it is important and what it can do. Github is really the best way to store public code and to manage big projects on a team. It also serves as a kinda-portfolio that gives a testimony of what you know and what you’ve done before.

Talking about the structure of the class, it was a bit “Laissez-faire”. Ken just guided us in the direction we should be going and helped us when we had trouble, but this class did not hold our hand. We were expected to learn on our own and to do our own research about the challenges we faced. I really liked this and I would chose it over the traditional way anytime.

o7


Course Review

Final Exam

--Originally published at oscarlopez95blog

What is an object?

Something that has state and behavior, state can be things to describe the object. (Color, shape, weight, etc.) And behavior is what the object does (Running, talking, walking, etc.)

What is an attribute?
Attributes are the state of the objects, are things who will describe and make your object. If you had a cat object, your attributes would be its size, weight, color, name, etc.

What is a method?
Methods are the behavior of the object, they tell the objects what to do and how to do it. For example if you had a cat object, then the methods would be Walking, meowing, eating, etc.

What is abstraction?
Abstraction in object oriented programming is basically giving information on what the object does, but not how it does it.
Abstract classes don’t need to have abstract methods, but if a class has 1 or more abstract methods, then it needs to be declared as an abstract class.
To use an abstract class you don’t instantiate it, you inherit it from another class, and you need to provide implementation to all the abstract methods it has.

What is encapsulation?
Is wrapping the data and the code that uses said data (methods) together. When you encapsulate a class, its variables will be hidden from other classes and can only be accessed through methods of their current class. To achieve encapsulation you must declare the variables as private and provide public setter and getter methods to modify and view the variables.

What are “has-a” and “is-a” relationships?
“Has-a” relationship is basically when you describe an object, for example a Cat has 4 legs, a name, color, size and weight.

Meanwhile, a “is-a” relationship is when you categorize something, for example a cat is a mammal. You have to realize this only goes one way, for example, every cat is a mammal, but not every mammal is a cat.

What are the mechanics for class description (coding) in the JavaProgramming Language?
For class description in Java we use comments, we use them to make our code understandable and easy to debug, to write a comment you just do this:
/** This is a comment */

What are visibility modifiers, their purpose and use in practice?
There are basically 4 visibility and access modifiers in Java:
Default
Private
Public
Protected

The first one, the default one doesn’t use any keyword. And what it does is a variable or method declared without any modifier is only available to classes in the same package.

Private is the most restrictive, it makes variables and methods only available to the class they are declared on, classes and interfaces can’t be private.

Public is the most open one, a variable or method can be accessed by any other class. But if the class we are trying to access is in a different package, it needs to be imported.

Protected basically allows any subclasses to access the variables and methods in a superclass.

What are inheritance and polymorphism? (Specification and implementation)
Inheritance is the process where one class acquires the properties (methods and fields) of another. The information is managed in hierarchical order.
The class which inherits the properties of other is known as subclass, and the class whose properties are inherited is known as superclass. It uses the “extends” keyword.

class Mammal{

}

class Cat extends Mammal{

}

Polymorphism is the ability of an object to take many forms, the most common use is when a parent class reference is used to refer to a child class object.
Any object that can pass more then one “is-a” relationship is considered polymorphic.

public interface Vegetarian{}
public class Animal{}
public class Deer extends Animal implements Vegetarian{}

By this logic, Deer is-a animal, vegetarian, deer and object.

What is delegation?
Inheritence uses the java compiler’s type system to implicitly include code from elsewhere, with delegation you explicitly implement the callout.

Inheritance is limited to a single parent class (and ancestors) but it can sometimes be non-obvious where your code is going; delegation is less elegant, but you can bring in functionality from multiple other classes and the flow is clearly visible.

What are CRC cards and how do we use them?
CRC cards are usually created from index cards. Members of a brainstorming session will write up one CRC card for each relevant class/object of their design. The card is partitioned into three areas:

On top of the card, the class name
On the left, the responsibilities of the class
On the right, collaborators (other classes) with which this class interacts to fulfill its responsibilities

Using a small card keeps the complexity of the design at a minimum. It focuses designers on the essentials of the class and prevents them from getting into its details and implementation at a time when such detail is probably counter-productive. It also discourages giving the class too many responsibilities. Because the cards are portable, they can easily be laid out on a table and re-arranged while discussing a design.

What are overloading and overwriting? How do we implement those in Java?
Method Overloading is a feature that allows a class to have two or more methods having same name, if their argument lists are different. To overload, you have two or more methods with the same name, but different arguments.

The benefit of overwriting is: ability to define a behaviour that’s specific to the subclass type which means a subclass can implement a parent class method, but with different arguments. To overwrite, you re-write a method from the super class, with different arguments.

What is the metaobject protocol?

The essence of a Metaobject Protocol is simple: every aspect of a program’s mapping down onto the lower level substrate (i.e. its compilation and runtime support) is controlled by some object or set of objects following a well-defined protocol. These objects are called metaobjects, because they are about the mapping of the program, rather than objects in the program’s primary subject domain. Client programmers can replace one or more of these objects with specialized ones to affect specific aspects of the implementation of specific parts of their program.

What do you feel are the benefits to object-oriented programming?
Code Reuse and Recycling: Objects created for Object Oriented Programs can easily be reused in other programs.

Encapsulation (part 1): Once an Object is created, knowledge of its implementation is not necessary for its use. In older programs, coders needed understand the details of a piece of code before using it (in this or another program).

Encapsulation (part 2): Objects have the ability to hide certain parts of themselves from programmers. This prevents programmers from tampering with values they shouldn’t. Additionally, the object controls how one interacts with it, preventing other kinds of errors. For example, a programmer (or another program) cannot set the width of a window to -400.

Design Benefits: Large programs are very difficult to write. Object Oriented Programs force designers to go through an extensive planning phase, which makes for better designs with less flaws. In addition, once a program reaches a certain size, Object Oriented Programs are actually easier to program than non-Object Oriented ones.

Why do you think your change to object-oriented programming is difficult or what makes it difficult for the standard student?
I think it’s difficult to start because it requires more planning than other ways to program. To create an object-oriented program you need to design it very well, and even though it gets easier as the program gets more complex, the beginning of the program is hard, and by consequence, the learning curve for object-oriented programming tends to be harder at the start.

 


Final Exam

Project

--Originally published at Alan TC201

The last version of my project is finished, my parther and I made some video games in Java. Dafne did a puzzle, I did a pong.

The pong was made following diferent totorials and I borrow some of the most dificult code, in this case the dificulty, and the puyisics of the ball.

The resourses I use to made this pong was very elaborate, but the principal was the youtube channel Jaryt Bustard. Watching this video was the perfect way to started program my project, and in the end mine looked very similar.

http://codereview.stackexchange.com/questions/27197/pong-game-in-java

http://staticvoidgames.com/tutorials/swing/swingPong

You could say that my ping was a variation between my knowlage and all this different pages. It was difficult to understand how the pyhisics of the ball was going to be but with all the information I found I knew that I had to use the angles of the ball and throw it back in its reverse angle.

The best part of this project was the libertie, I could do what I wanted and I did this game because my father used to play it when he was a child and now he could remember those time with this game.

Here I am going to left the blog of my parther that did the puzzle.


Project

Course Review

--Originally published at oscarlopez95blog

This is my Course Review for my Object oriented programming class with Ken. First of all, my overall opinion on the course is that it is something really new, and the fact that Ken focuses a lot on us learning the concepts helps a lot with the learning curve of the topics. Also, I believe it’s better to learn Object oriented programming in general and then focus on a language that we need, instead of just learning Java por example.

 

What I think about the topics

The class is about Object oriented programming, and we’ve seen many topics, from objects to polymorphism and delegation. But honestly I think there should be a more interactive way to learn about those topics rather than just reading about them and trying to implement them from nothing.

Sometimes students who are completely new to object oriented programming can get lost because there are so many new things and they’re really different from what you’ve seen before that it just takes time and practice to fully understand them.

What I think about #AbolishGrading

I think this idea is pretty neat, it gives more freedom to the students and prepare us for real life situations. As an engineer you’ll never go to work and your boss will tell you “I need you to write a code that does X thing, but you can’t look anywhere to help yourself”, and after you’re done something like “Oh that’s good, but not great, 83” That’s just not real.

We as engineer students need to realize that a work or a project is about us working as hard as we can and fulfilling both our own and our teacher’s expectations about it.

The grading system doesn’t reward knowledge or how much have you learned, that’s why students cheat, because all they care about is a grade which practically means nothing if they haven’t learned anything.

What I think about Ken

This is the second class that I’ve had with Ken in my degree and I can honestly say he’s one of the best teachers I’ve had in my life. His ideas are new and fresh and he’s not afraid to do and say what he thinks is right for us. He’s not the typical teacher who just grades book summaries and stands up in front of the class room reading a powerpoint presentation, and we need more teachers like him.

Ken, keep up the work like always, don’t let some students too used to the old school system or other teachers thinking you’re crazy change your mind about what’s the best way to facilitate knowledge. Because we both know it’s not about “teaching” is about being a facilitator for students who actually want to learn and become better.


Course Review

WSQ10 -College Advice

--Originally published at JAVALIO

Well I was kinda lost the first time I see those advices, I mean three or four I already expected by there are some that I did not see coming.

Let’s review some of the most important advices Joel Spolsky gave us.

  1. Learn how to write before graduating.
  2. Learn C before graduating.
  3. Learn microeconomics before graduating.
  4. Don’t blow off non-CS classes just because they’re boring.
  5. Take programming-intensive courses.
  6. Stop worrying about all the jobs going to India.
  7. No matter what you do, get a good summer internship.

This list is the whole advices, I will talk about Learn how to write before graduating, Learn C before graduating,  and Take programming-intesnsive courses.

I wasn’t aware about the importance of writing. I mean, I have been in some competitions and always seems like the documentation is an important thing,  but I never expected to be that important, but I could see why, is like the presentation to the world of your product, that product must sell, and attract to anybody.

Learning C before graduating, I guess is one of the most important things to do in my life, I have to many doubts about the how the low level programming happend, how os are build, how drivers work, so this is very important.

This is a important point I have learned with flipped classroom, you should always look for improving for yourself, taking courses, intensive course will help any programmer to be proactive and do more things by himself.


WSQ10 -College Advice

Course Review

--Originally published at Alan TC201

Another semester has gone by and is time to do our last projects, exams and more, but first I’m going to do a review about the Object orientated programming course.

Course Review

This class was very interactive and different from other, you have a lot of freedom but at the same time you have to use that freedom wisely, you can’t go around doing nothing in this course.

Course Review

You need to do all the work, investigate for yourself and learn for yourself, because that’s the way of learning nowdays, you have the internet with all the information you need. So the Ken is there to help you and guide you in tings you are not understanding, the wsq’s and the masteries are there to practice your abilities the project is there to show your abilities, and your blog, github, Lynda.com and twitter is there to teach you to be connected and find information. All in the course is extremely put together to work.

Course Review

And then you have extras, for example sometimes we receive from Ken some information about history of programming, this things had nothing to do with the course but where very interesting, we used different programs like python or java like if they have been there forever, but no, those things also had its history, and that was the grate about kens class this semester, you could have everything as long as you were responsible, but you also received more, like extras.

Course Review

So in conclusion, this class is very good, but only if you adapt to it.


Course Review

WSQ13 – James Gosling

--Originally published at Alan TC201

In this video of the Triangulation Podcast the men invited is James Gosling one of the inventors of Java. His passion in the computers came in a very yong age, when his father show him an old computer and James got fascinating with the device. He started to get information about that, and then in school he discover programing he started to work in satelital programing and he used to skip school a lot of times, but their teachers where happy that in such a yong age we could be gaining money in something very new in those days.

WSQ13 – James Gosling

He worked in IBM, their first projects was software, the idea of JAVA came from a small group that saw how everything was changing hardware to software, they saw that they run with problems that people that were not preper to program did.

WSQ13 – James Gosling

This podcast was more difficult to understand than the past one. It was mor tectician, but the core, the story of Java was very interesting, the highs, the lows, the conflicts with google, oracle and everythins,

WSQ13 – James Gosling

You can see how everything happend and what is know teaching kids to learn java, in this case Minecraft.

WSQ13 – James Gosling

 

 

 


WSQ13 – James Gosling

WSQ 12 – Ward Cunningham

--Originally published at Alan TC201

I used to herd podcast about video games in the past, but right know I’m to busy for that kind of luxuries. I’m going to be sincere, I was hoping to get bored with this video, Ward Cunningham, the creator of te Wiki! the goddamn Wiki!

WSQ 12 – Ward Cunningham
It is very incredible how a man so simple could have contributed in such a big way in computer programming, in the internet and in sharing information in general. Yes the Wiki was the main topic, but in the podcast they also talk about how were the school days of Ward, how he started to get interested in this big and noise devices that where the first computers.

WSQ 12 – Ward Cunningham

Then the conversation turn to small talk the Object oriented program, that is exactly that purely object oriented.

WSQ 12 – Ward Cunningham

Then the more important part was the creation and life of the wiki, how it was created, why it was created, its influence to the distribution of online information, menciona Wikipedia and how is the biggest representation of this type of data, etc.

WSQ 12 – Ward Cunningham

PD: Something wird was that the advertisements where actully fun to watch, I don’t know way.


WSQ 12 – Ward Cunningham

Project advancements – Hangman done!

--Originally published at oscarlopez95blog

So our project as you already know will be an arcade machine simulator, with different games, a credit system and 2 players.

We’ve already finished the hangman game and we’re almost done with the other two.

We just need to implement the game logic into a graphic environment.

Here’s the code for the game.

If you have any questions about how we did it feel free to comment on this post.


Project advancements – Hangman done!

Partial 2 masteries

--Originally published at oscarlopez95blog

What are inheritance and polymorphism? (Specification and implementation)
Inheritance is the process where one class acquires the properties (methods and fields) of another. The information is managed in hierarchical order.
The class which inherits the properties of other is known as subclass, and the class whose properties are inherited is known as superclass. It uses the “extends” keyword.

class Mammal{

}

class Cat extends Mammal{

}

Polymorphism is the ability of an object to take many forms, the most common use is when a parent class reference is used to refer to a child class object.
Any object that can pass more then one “is-a” relationship is considered polymorphic.

public interface Vegetarian{}
public class Animal{}
public class Deer extends Animal implements Vegetarian{}

By this logic, Deer is-a animal, vegetarian, deer and object.

What is delegation?
Inheritence uses the java compiler’s type system to implicitly include code from elsewhere, with delegation you explicitly implement the callout.

Inheritance is limited to a single parent class (and ancestors) but it can sometimes be non-obvious where your code is going; delegation is less elegant, but you can bring in functionality from multiple other classes and the flow is clearly visible.

What are CRC cards and how do we use them?
CRC cards are usually created from index cards. Members of a brainstorming session will write up one CRC card for each relevant class/object of their design. The card is partitioned into three areas:

On top of the card, the class name
On the left, the responsibilities of the class
On the right, collaborators (other classes) with which this class interacts to fulfill its responsibilities

Using a small card keeps the complexity of the design at a minimum. It focuses designers on the essentials of the class and prevents them from getting into its details and implementation at a time when such detail is probably counter-productive. It also discourages giving the class too many responsibilities. Because the cards are portable, they can easily be laid out on a table and re-arranged while discussing a design.

What are overloading and overwriting? How do we implement those in Java?
Method Overloading is a feature that allows a class to have two or more methods having same name, if their argument lists are different. To overload, you have two or more methods with the same name, but different arguments.

The benefit of overwriting is: ability to define a behaviour that’s specific to the subclass type which means a subclass can implement a parent class method, but with different arguments. To overwrite, you re-write a method from the super class, with different arguments.

What do you feel are the benefits to object-oriented programming?
Code Reuse and Recycling: Objects created for Object Oriented Programs can easily be reused in other programs.

Encapsulation (part 1): Once an Object is created, knowledge of its implementation is not necessary for its use. In older programs, coders needed understand the details of a piece of code before using it (in this or another program).

Encapsulation (part 2): Objects have the ability to hide certain parts of themselves from programmers. This prevents programmers from tampering with values they shouldn’t. Additionally, the object controls how one interacts with it, preventing other kinds of errors. For example, a programmer (or another program) cannot set the width of a window to -400.

Design Benefits: Large programs are very difficult to write. Object Oriented Programs force designers to go through an extensive planning phase, which makes for better designs with less flaws. In addition, once a program reaches a certain size, Object Oriented Programs are actually easier to program than non-Object Oriented ones.

Why do you think your change to object-oriented programming is difficult or what makes it difficult for the standard student?
I think it’s difficult to start because it requires more planning than other ways to program. To create an object-oriented program you need to design it very well, and even though it gets easier as the program gets more complex, the beginning of the program is hard, and by consequence, the learning curve for object-oriented programming tends to be harder at the start.


Partial 2 masteries