Your Honor. I object!
I object against all to common linear programming. And with linear programming I don't mean what you learn in calculusII. I mean programming with lots of lines of code in one file, lots of lines of code in one function, and then calling functions with lots of lines of code from that function. This is a disaster, and it should be stopped.
I therefor hereby announce the beginning of the small object era. Small Objects are objects that are so fine-grained, that they can be strung together like chains of paperclips, forming larger and larger systems.
It is not recognized often that a lot of programming languages have taken the object paradigm seriously. The concept might be unknown to the beginning programmers, and so they stay away from it, especially if they are web programmers and it doesn't seem necessary to start creating objects.
For those of you who do not know what Object Oriented programming is, let me explain a little, and let me take the short route. First, an object is a thing that has properties and methods, or if you like variables and functions, in one nice package. Now we can consider two 'levels' of OO (object orientation) programming. There is object based programming, which means you just write a class (object template) and then use that template to mass produce objects. So you could create a String class and it could have a Reverse method.
In the second level of OO programming, you start creating subclasses, which are variations to the theme of an existing class, let's say a BinaryString, and then it's children EncodedImage, MP3Song, and MpegMovie, and FirstName... (They all can be a string... They could, really, no kidding). We call this concept inheritance.
Riply, Believe it or not, almost all modern scripting languages nowadays support object based programming and inheritance. So all you JavaScript, VBScript, Python and Perl script-kiddies, come closer and listen up.
JavaScript and VBscript unfortunately do not support inheritance (low ahhhhhhhh). But the good news is: it's incredibly easy to create objects with them. And once you do, there is no turning back.
In stead of function A, B, C, and D, immediately create a class in JavaScript, simply announced by a function.
Example:
I know, the whole prototype thing sucks. I'm like: hey, I'm writing a real class here, this is not a prototype. Anyway, we have more luck in VBScript.
Let's do the same thing in VBScript
And that's how easy it is to create objects in these languages. Go ahead. Take a bite, and please, get a taste of it before you swallow.
I therefor hereby announce the beginning of the small object era. Small Objects are objects that are so fine-grained, that they can be strung together like chains of paperclips, forming larger and larger systems.
It is not recognized often that a lot of programming languages have taken the object paradigm seriously. The concept might be unknown to the beginning programmers, and so they stay away from it, especially if they are web programmers and it doesn't seem necessary to start creating objects.
For those of you who do not know what Object Oriented programming is, let me explain a little, and let me take the short route. First, an object is a thing that has properties and methods, or if you like variables and functions, in one nice package. Now we can consider two 'levels' of OO (object orientation) programming. There is object based programming, which means you just write a class (object template) and then use that template to mass produce objects. So you could create a String class and it could have a Reverse method.
In the second level of OO programming, you start creating subclasses, which are variations to the theme of an existing class, let's say a BinaryString, and then it's children EncodedImage, MP3Song, and MpegMovie, and FirstName... (They all can be a string... They could, really, no kidding). We call this concept inheritance.
Riply, Believe it or not, almost all modern scripting languages nowadays support object based programming and inheritance. So all you JavaScript, VBScript, Python and Perl script-kiddies, come closer and listen up.
JavaScript and VBscript unfortunately do not support inheritance (low ahhhhhhhh). But the good news is: it's incredibly easy to create objects with them. And once you do, there is no turning back.
JavaScript
In stead of function A, B, C, and D, immediately create a class in JavaScript, simply announced by a function.
Example:
function initClass()
{
RubiksCube.prototype.scramble = scrambleCube;
RubiksCube.prototype.solve = solveCube;
}
function scrambleCube()
{
..yada yada yada
}
function solveCube()
{
..yada yada yada
.. whaddayaknow? it's solved
}
function RubiksCube(colors) // my hobby
{
this.colors = colors;
}
I know, the whole prototype thing sucks. I'm like: hey, I'm writing a real class here, this is not a prototype. Anyway, we have more luck in VBScript.
VBScript
Let's do the same thing in VBScript
Class RubiksCube
Public colors
Function Scramble
..yada yada yada
End Function
Function Solve
..yada yada yada
.. whaddayaknow? it's solved
End Function
End Class
And that's how easy it is to create objects in these languages. Go ahead. Take a bite, and please, get a taste of it before you swallow.
