Friday, August 03, 2012

Introduction to OOP (cont.)

Hello again! Let's continue with our short introduction to OOP. We already know what is a program, what is a programming language and more importantly for this entry, what is a paradigm.


We're here to learn Object Oriented Programming, which follows the Object Oriented paradigm. So the question now is, what do we think about when we make a program based on this paradigm?


This paradigm has two main ideas: objects and messages. A object is an entity that exhibits a specific behavior, and that behavior gets triggered when a message is sent to the object. A program that follows this paradigm is nothing but a bunch of objects that send messages to each other in their little object world (aka environment) to reach a common goal.




Harmony: Suppose I want to make a program about music. The instruments could be objects in that program and the way to play music would be by sending messages to the instruments so they produce the sounds I want. But if I don't interact with the objects, nothing will happen.



Grouchy: I hate Harmony's "music".
Let's hope the music he models sound better than reality.



That's interesting Grouchy, thanks for bringing it up :) It's important to differentiate reality from the model of it we make based on what we want the program to do. In reality, Harmony has physical instruments he uses to produce sounds, but in his program the objects he uses to represent the instruments are not actual instruments. This may sound rather trivial, but sometimes we might find that the objects we program do not behave exactly like the ones in reality. The good thing about that is that we can take that licence to make our programs simpler, after all we only need to program what will help us reach our goal in the way we think it's more convenient.

I know for now it all seems very vague, so the next step is to find an example of a very small program for us to start using and adding more ideas to the basic ones.

See you soon!!

Tuesday, July 24, 2012

Introduction to OOP

Before we dive in the world of programming, we need to be sure we have a couple of concepts straight in our head.
  • Program
  • Programming Paradigm
  • Programming Language

Program

What is a program?
What you should all know by now, as users, is that a program is something you can run on your computer to do something you want. For example, you can use a program to play videos. They can be seen as "black boxes": input comes in - magic happens - output comes out.
Now that we're going to play the role of programmers (we'd be the ones making those fancy programs, being the wizards holding the wand), we need to be aware of a few extra things. The generic definition of computer program is a bunch of code that the machine can interpret and execute in order to reach a specific goal.
That bunch of code should be written using a programming language, which could be very different from each other because there are different things to think of based on which paradigm they are based on.

Programming Paradigm

Brainy says: A paradigm describes a set of concepts or thought patterns, and particularly in programming it describes a programming style. So a programming paradigm represents the ideas we should consider when we program following that paradigm.
As you know by now, we're going to learn a specific programming paradigm, which is Object Oriented. There are more paradigms such as Procedural, Functional and Logic programming and they all have different ideas behind.

Programming Language

A programming language is what we use to make programs that can run in a computer and has a specific syntax (its form, what defines if a program is correctly written) and semantics (the meaning of the code). Languages can follow more than one paradigm, some are more strict than others on that aspect.
What we'll be using to learn OOP is the Smalltalk programming language because it's purely object oriented and it's really easy to learn. The idea is that once you understand the paradigm and how to use those ideas to make a program, then learning a different object oriented language should be quick and simple :D

On the next post we'll be giving our first steps into OOP, so get ready to have lots of fun!

Monday, June 18, 2012

Welcome to the Village

Oh, hi there! Welcome to OOP from Scratch!

What is the purpose of this blog?

We want to learn how to make software, just for fun, starting from the very basics and learning a lot of good practices while we work.

What do Smurfs have to do with programming?

Not much, but they're eager to help us in the process, giving us tips to encourage us to become better programmers. So be nice to them and don't dismiss they're comments :)

So, this is for kids, then...

Nah, this is intended for anyone who wants to learn OOP only knowing a bit of logic, math and how to use a computer. The whole Smurfish setup is just for fun and to make it distinguish itself from other courses you may find online.

And you are...?

I'm Mariana, I live in Argentina and I'm about to get a Systems Engineering degree. I'm a programmer and I teach a couple of programming subjects at college. I love cartoons and games, which is why I have a rather naive point of view regarding... well, pretty much everything.

Last question, when do we start?

Soon... for me this is clearly a hobby, so I'll be putting up new entries whenever I can make some time for it. Subscribe and stay tunned!!!