0
votes
1answer
42 views

Box(x,y,X,Y), box(x,X,y,Y), box(x,w,y,h), box(x,y,w,h) or box(fromPos,toPos)?

Say you are representing a box, or creating a function that slices a 2d array, or whatever. How do you represent it?
0
votes
1answer
69 views

I've finally found a satisfactory way to create classes on JavaScript. Are there any cons to it?

Depending on external OO libraries is really bad, using prototypes/new has some limitations, using only hashes has others. Dealing with classes was always a pain in JavaScript and it didn't help that ...
3
votes
1answer
94 views

The eternal dilemma: bar.foo() or foo(bar)?

I was using foo(bar) as it's adopted for functional programming. console.log( join( map(function(row){ return row.join(" "); }, tablify( ...
0
votes
1answer
87 views

js oop best practise

I have to set up a new JavaScript library for a big project, which isn't Object Oriented yet. So I built a small file to test some needs. The result is the following: var Module = { Config: ...
0
votes
1answer
33 views

Dynamically create object

I am developing a web-application and I am encountering some trouble : I have some tabs and each one contains input forms with different values. I need to switch beetween these tabs and see the ...
0
votes
0answers
28 views

Making one object the property of another whilst avoiding scope issues

After being inspired by some MVC style design patterns, I have been trying to separate data from views in my code and move toward a more sensibly organized object based approach. (please, don't bother ...
1
vote
1answer
90 views

Is this a good JavaScript class?

I'm trying to get my head around object oriented programming, and I'm starting in JavaScript. I have put a working demo of my code on JSFiddle (here), but the class is below. My main concerns are ...
3
votes
1answer
200 views

Javascript PriorityQueue based on object property

I am pretty new to javascript development and its temperaments. I wrote this class which is a priority queue based on a numeric property of any object. As far as I can tell, the following code is ...
7
votes
2answers
402 views

Javascript based product customization app

http://duc.pagodabox.com/product.php I'm developing a JS based app that allows you to customize a product. I still consider myself a super newbie to javascript and especially to object oriented ...
0
votes
4answers
285 views

Javascript effective code structure

What would be the best (performance, memory wise) to achieve a clean way to create a class or some way to properly structure the code, that shares 2 variables (req, res) which have a decent object ...
1
vote
1answer
109 views

javascript multiple inheritance code review

i had made a small code snippet for multiple inheritance in js. this code is working for me but actually i like to get the review, that its good and if any problem; provide the solution. etc. the code ...
3
votes
2answers
182 views

JavaScript (multiple) inheritance / mixins

I'm quite new to JavaScript, and I'm trying to understand the idea behind inheritance in JavaScript. I've read a bit about it, and I don't want to mess with prototypes (which I don't yet fully ...
0
votes
0answers
106 views

Implementation of Javascript Classes and Inheritance

I've created a simple Javascript library to be able to create "classes" and extend them defining instance and static methods and variables. It consists in a simple function Class with two methods: ...
1
vote
1answer
63 views

Trying to use “this” to refer to a class's instance variable inside a function within the class's method in JavaScript

Hope that title makes sense. This is part of an object I have: The event listener attaches to the correct marker passed in the parameter but inside the function, this points to something else. ...
2
votes
0answers
69 views

improve a js object “framework”

I have this simple object setup in javascript - Full code on jsbin http://jsbin.com/uqacop/11/edit#javascript,live I'll break it up below, but the question(s) - Does it break? I mean, I'm sure ...
2
votes
3answers
38 views

Link to a parent object

I have a couple of nested objects, where A is always a part of B. May I use the following code to access owner's properties and methods? function A( owner ) { this.value = function () { return ...
3
votes
1answer
170 views

JavaScript/PHP file uploader

I'm writing a JavaScript/PHP file uploader and I want to start this project off on the right track. I've started with this, a JavaScript Uploader object which will handle Ajax calls, display progress, ...
0
votes
0answers
107 views

“metaconstructors” for inheritance in js?

Edit - decl smokes dojo.declare - http://jsperf.com/dojo-declare-vs-decl The code has been updated a bit. decl now accepts object literals as well, although I still like "declaration functions" ...
1
vote
1answer
237 views

Is this JavaScript using objects properly?

I know this is a lot of code, but I'm not looking for any kind of detailed review of the code. I'm just hoping some nice Javascript guru can give it a once over and offer any needed advice for using ...
3
votes
3answers
843 views

Please review my first Object Oriented JavaScript/jQuery Code

This is my first script in Object Oriented Javascript (jQuery 1.5.2). It's purpose is to simply validate a form (nothing fancy at the moment just checks if any value is present on required fields) and ...
4
votes
2answers
533 views

Review my simple javascript canvas game

Here is a link to the code on jsfiddle. http://jsfiddle.net/caimen/kMkrW/ This is my first attempt at playing with canvas. Things I am looking for. Before I move on doing anything else it would be ...
1
vote
2answers
1k views

My Memory Game “Engine”

Mostly for the experience (but also so i could waste hours playing it) I made a simple memory card game in JavaScript. I built it so it's got a backbone framework that could be easily extended by ...