# OOP vs Procedural

**URL:** <https://forum.kirupa.com/t/oop-vs-procedural/262869>\
**Category:** classic bestof\
**Created:** [June 10, 2008, 6:22pm UTC](https://forum.kirupa.com/t/oop-vs-procedural/262869 "2008-06-10T18:22:30Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![Anogar](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@Anogar](https://forum.kirupa.com/u/Anogar)\
**Post date:** [June 11, 2008, 5:56am UTC](https://forum.kirupa.com/t/oop-vs-procedural/262869/21 "2008-06-11T05:56:50Z")

</div>

> [@ajcates;2340511](#):
>
> I use like a very basic oop way of handling even the smallest of things, I write out functions to handle alot of stuff, have like a main function. So its like I only use one class, except I don’t put it in the document class rather on the frame because I like the way I don’t have to type out public or private before my functions and variables.

There are some very real reasons to do object oriented programming the way it’s intended, in class files. Things like public and private have very real meanings, and when used properly they make your life a whole lot easier - _especially_ when working with multiple developers or sharing classes between multiple projects.

It’s hard to understand the power of OOP until you’ve spent some good time using it, and seeing how much time it saves you over the course of a few projects.

---

<div class="post-metadata">

**Author:** ![digitalmatt](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/digitalmatt/32/694_2.png) [@digitalmatt](https://forum.kirupa.com/u/digitalmatt)\
**Post date:** [June 11, 2008, 6:03am UTC](https://forum.kirupa.com/t/oop-vs-procedural/262869/22 "2008-06-11T06:03:38Z")

</div>

[quote=Anogar;2340517]There are some very real reasons to do object oriented programming the way it’s intended, in class files. Things like public and private have very real meanings, and when used properly they make your life a whole lot easier - _especially_ when working with multiple developers or sharing classes between multiple projects.

It’s hard to understand the power of OOP until you’ve spent some good time using it, and seeing how much time it saves you over the course of a few projects.[/quote]

Yeah, that’s another thing that the Java developers I work with tell me…OOP makes working on large team projects immensely easier. Especially if all the developers are working on different, but related chunks of code.

---

<div class="post-metadata">

**Author:** ![Anogar](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@Anogar](https://forum.kirupa.com/u/Anogar)\
**Post date:** [June 11, 2008, 6:15am UTC](https://forum.kirupa.com/t/oop-vs-procedural/262869/23 "2008-06-11T06:15:07Z")

</div>

It’s also very helpful when you want to reuse a class between projects. The whole thing is really more about ways to make your projects easier over the long run.

---

<div class="post-metadata">

**Author:** ![TheCanadian](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@TheCanadian](https://forum.kirupa.com/u/TheCanadian)\
**Post date:** [June 11, 2008, 6:42am UTC](https://forum.kirupa.com/t/oop-vs-procedural/262869/24 "2008-06-11T06:42:03Z")

</div>

I do every Flash project solely with AS3 (I don’t even own CS3, wtf right) so without OOP it would be freaking redic. One of the cool things about AS3 is helper classes. It allows you to fully utilize OOP but without having to create a billion different classes which you’ll never ever use again in a million years.

Take this for example:

```auto
package {
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import jm.geom.Point3D;
	public class ShiftingNodeNetwork extends Sprite {
		private var nodes:Array = new Array();
		private var maxDistance:Number;
		public var axisRotations:Object = new Object();
		public function ShiftingNodeNetwork(width:Number, height:Number, depth:Number, distance:Number, ease:Number, numNodes:Number) {}
		public function start():void {}
		public function stop():void {}		
		private function connect(evt:Event):void {}
	}
}

import flash.display.Shape;
import flash.events.Event;
import jm.geom.Point3D;
import jm.math.Random;
class RandomNode extends Shape {
	private var coord:Point3D;
	private var targCoord:Point3D;
	private var ease:Number;
	private var wc:Number;
	private var hc:Number;
	private var dc:Number;
	public function RandomNode(w:Number, h:Number, d:Number, e:Number) {}
	private function move(evt:Event):void {}
	public function get location():Point3D {}
	public function start(evt:NodeEvent):void {}
	public function stop(evt:NodeEvent):void {}
}

```

That’s just a snippet from one of my experiments with mose of the code removed for clarity. I used the RandomNode as a helper because when would I ever need that class again? Now the classes in there that I do use between multiple projects (like NodeEvent, Point3D) have there own class file so I can import them for another project.

After a while you can start making your own library, organized into packages, that you can access from any file. Saves you from having to search through multiple timelines of code to find what you’re looking for.

[Previous page](https://forum.kirupa.com/t/oop-vs-procedural/262869.md?page=1)
