My Profile Photo

Personal Webpage of David Duggins


Well, I was born on a normal day in July, 1981 and have been creating chaos ever since. Born in North Carolina, but raised in the aftermath of the Soviet Union, Kazakhstan, I have been messing around with computers nearly my entire life. I wrote my first program in assembly when I was 11. In my early teens I ran a BBS connected to Fidonet and started building a website for my band. In 1999 I was introduced to Linux, and it was love at first compile. I started my career in IT in the early 2000's doing IT for a Car Dealership in Charlotte NC. I wrote my first major web app in Cold Fusion (an ecom app) at that time. In 2006 I left Charlotte and moved down to Columbia where starting working as a developer, freelancer and consultant. Currently I am working as a freelance developer and DevOps consultant!!


Classless Object Oriented JavaScript Programming (Lesson 1)

\n I’ve been exploring Object Oriented Programming with JavaScript. It’s been an interesting experience because JavaScript is not really a traditional Object Oriented Language but rather a prototype language. Prototype is a type of object oriented language that is classless. In a prototype language, inheritance is achieved by reusing prototypes of objects. It is a fascinating model. So let’s get started on our exploration of class-less object oriented programming The first thing of note is that we are not actually creating a class (note:Classless Object Oriented JavaScript) Essentially, all we are going to do is create the equivilent of a constructor.  Our constructor will have an alert box that fires whenever we create a new object, as well as some basic properties of our car.

Now, when ever we create a new Car prototype, we get this alert. It’s a great way to make sure it’s working! Now lets add some variables to our class. For a car we will need a make a model and a color.

Now, after the function, we need to do a little bit more.

This sets the default value of the make, model and color. It also introduces us to the prototype property. Later, we will use this prototype property to create our sports car class that inherits the Car class. Now we are all set to create some cars!

The cool thing about JavaScript is how methods are handled. We actually define a function with the prototype property. Just remember that we need to use ‘this’ to access the variable in the class.

Go ahead and play around a bit with this. Next, we will talk about how you can use prototype to create another class that inherits another class.

© 2024 David Duggins. All rights reserved.