I'm looking at creating my own JS library. Your probably thinking, why? Experience/Show employer, and I want 100% control over my websites. Anyways, I'm a huge fan of JS, yes, I said that, and I'm asking people who have done it, what are the major pitfalls and what should I look out for during the process? Experiences will vary, but trying to get some incite before moving forward.

Thanks for that link, it's given me a good foundation and idea of how to go forward. I might take a look at the jQuery library to see how the code is structured and functions. But of course make my library unique to everything that is currently out there. Not an easy task, I know. Like you, I am also a fan on JS.

How can you prove? As in, how can you prove that it's working as you expect it to be, by applying some tests to it?

Jason__C
—
2011-03-23T22:25:19Z —
#6

paul_wilkins said:

How can you prove? As in, how can you prove that it's working as you expect it to be, by applying some tests to it?

Oops, I mean can I improve the code. Is their a better archetucture? Design Pattern?

Paul_Wilkins
—
2011-03-23T22:31:33Z —
#7

USPaperchaser said:

Oops, I mean can I improve the code. Is their a better archetucture? Design Pattern?

You are mixing data and methods together, which tends to be a no-no.

You also have a function to read a cookie value, as well as a storage location from which the value can be read. That's two different ways to obtain the same information, which can be a design issue too.

Jason__C
—
2011-03-23T22:45:00Z —
#8

paul_wilkins said:

You are mixing data and methods together, which tends to be a no-no.

You also have a function to read a cookie value, as well as a storage location from which the value can be read. That's two different ways to obtain the same information, which can be a design issue too.

So, basically my design pattern sucks. Do you have a recommendation of a library design pattern? The link you sent me was interesting, I might just design something similar.

Paul_Wilkins
—
2011-03-23T22:54:00Z —
#9

The techniques that jQuery use seem to be solid and stable. Other ones such as YUI can be worth looking at too, in terms of how they do things.

whisher
—
2011-03-24T14:39:32Z —
#10

USPaperchaser said:

So, basically my design pattern sucks. Do you have a recommendation of a library design pattern? The link you sent me was interesting, I might just design something similar.