Javascript Library

D

David Mark

So sell it. <g>

I have, in the past, considered selling JavaScript libraries and
widgets, but it seems to me that too many people are giving them
away. Factor in that most potential customers are unable to evaluate
code quality and you get a pretty lousy market outlook.
 
M

Matt Kruse

Because I don't want to give it to him.

Why not? What would it hurt?
Why would you care?

Because maybe I would switch to it if it was better than what I'm
already using.

Until a better alternative _actually exists_, people will continue to
use the library that they find best suited for their task.

Your argument sounds like:
1. All libraries suck
2. I know the better way to do it
3. I have a library that is better than any other out there
4. You can't have it

It's really a pretty simple question that the critics here never want
to answer:

Let's say a group of developers are building a webapp that needs some
Javascript development. There is no in-house library to start with,
and all of the developers are just average at javascript, at best.
What would be your recommendation? I see some possibilities:

1. Use a freely-available library that isn't perfect, but has lots of
examples, speeds up development, and doesn't appear to break in any
cases
2. Write everything from scratch, which might be lower quality than
the libraries and take too long
3. Hire a competent developer to write everything from scratch, which
again might take too long and may not be an option financially
4. Make a post to comp.lang.javascript asking which library to use and
be told that they all suck, and awesome library code exists but you
can't have it.
5. ???

In a real case like this, how would you recommend that people proceed?

Matt Kruse
 
T

Thomas 'PointedEars' Lahn

vbgunz said:
there needs to be a DOM library. anyone know of one?

For example, I have been distributing http://PointedEars.de/scripts/dhtml.js
as free software under the GPL v2 (or later) for almost five years now, and
I update it frequently (as the build version indicates) with regard to
backwards-compatibility to previous versions. What it still lacks is a
decent Web site (there is only a directory index), but it is documented
inline, and can be found by and with search engines.


HTH

PointedEars
 
D

David Mark

Why not? What would it hurt?

What makes you think that modules developed for my own use would be
appropriate for somebody else? I already mentioned that perhaps I
will post some of the low-level reusable functions. If and when I
find the time to document them for the masses, I will do so.
Because maybe I would switch to it if it was better than what I'm
already using.

I think you misunderstand my intention. I have no plans to publish
the next free library. I might post some low-level functions, which
could be of interest to people who need a foundation to start their
own libraries.
Until a better alternative _actually exists_, people will continue to
use the library that they find best suited for their task.

I don't think jQuery is suited for any task (same goes for Prototype
and Dojo.) People who ask about those libraries in here rarely
mention a specific task anyway. They know they want to sell an "Ajax
site", but they don't want to learn how to script a browser.
Your argument sounds like:
1. All libraries suck
2. I know the better way to do it
3. I have a library that is better than any other out there
4. You can't have it

You just don't get it. There is no single library that is appropriate
for every task. That is what jQuery, Prototype, etc. try to be and
they fail miserably at it. I build modules from reusable functions
that are specific to the task at hand. Yes, some of these modules
mirror the functionality that is lumped together in the publicly
available libraries. No, I didn't make the sort of ridiculous
mistakes that cripple these libraries. And no, I am not interested in
publishing and supporting my codebase as a free library. Sorry.
It's really a pretty simple question that the critics here never want
to answer:

Let's say a group of developers are building a webapp that needs some
Javascript development. There is no in-house library to start with,
and all of the developers are just average at javascript, at best.
What would be your recommendation? I see some possibilities:

1. Use a freely-available library that isn't perfect, but has lots of
examples, speeds up development, and doesn't appear to break in any
cases

What library do you know of that fits that description?
2. Write everything from scratch, which might be lower quality than
the libraries and take too long

I am tired of hearing the "write everything from scratch" argument.
That is not the only other choice.
3. Hire a competent developer to write everything from scratch, which
again might take too long and may not be an option financially

A competent developer would not write everything from scratch.
4. Make a post to comp.lang.javascript asking which library to use and
be told that they all suck, and awesome library code exists but you
can't have it.

For the last time, there is no "magic bullet" general purpose library
that is suitable for all tasks.
5. ???

In a real case like this, how would you recommend that people proceed?

Real in the sense that you made it up? These "real" people should
proceed to either hire competent developers or learn JavaScript
themselves. In the latter case, the FAQ would be a good starting
point. If neither of these works for them, perhaps they shouldn't
write a Web app at all.
 
M

Matt Kruse

For example, I have been distributinghttp://PointedEars.de/scripts/dhtml.js
as free software under the GPL v2 (or later) for almost five years now

this.isIE4DOM = typeof document.all == "object" && !this.isOpera;

Really?

Matt Kruse
 
J

Jeff North

| > [jQuery criticisms]
| > Enough is enough. If you use jQuery after reading this, you are
| > deserve everything you get.
|
| Thank you for your detailed reply. I am going to investigate these
| things further and find out if jQuery can be improved.
|
| I haven't done an extensive look "under the hood" of jQuery, but I
| have looked at some of the code. I've also noticed examples of
| questionable code, but I assumed there was a reason for them doing
| things the way they do. I've never had a problem with jQuery not
| functioning correctly. As long as I see the expected behavior right
| now, the underlying code can be streamlined and improved. All the
| issues you mention can be fixed and improved while still maintaining
| the same API, making the library more solid without the end-user even
| knowing about the changes.
|
| > If
| > you take an average JavaScript developer and give them this mess to
| > play with, are you really empowering them to write competent
| > applications?
|
| I still think so, yes. Having a developer program to the API to
| simplify their development is a good thing. It's a layer over the low-
| level stuff, but that enables them to be much more productive. If
| there is a problem found in the library behavior, it can be fixed.
|
| > If you use or advocate jQuery after today, you are stupid.
|
| I will continue to use it and advocate it. I'll also try to improve
| it.
|
| I guess I'm stupid.
|
| > > (Previous time to develop functionality) - (current time to develop
| > > similar functionality) = Time Savings
| > > Time Savings * Pay Rate = Money Saved
| > Oversimplification.
|
| Really?
|
| > > You would recommend that we stop using it and start coding from
| > > scratch?
| > Why do library-advocates invariably see just those two choices?
|
| Because library-critics rarely provide any real answers or
| suggestions. Just criticisms.
|
| It's easy to question everything. It's much harder to provide a real
| answer.
|
| I have little respect for people who constantly bitch about what
| everyone else provides for free to the world, yet never actually
| provide anything themselves.
|
| If everyone else is doing it wrong, and you know how to do it right,
| why don't you show the world how it should be done? Those who are the
| supposed "experts" that bash everyone else rarely put their own
| libraries and code up for public consumption and criticism. I have
| respect for people like Peter who is obviously an intelligent and
| knowledgeable contributor to this group and has also put his own
| library out there. If the more vocal critics would do the same,
| perhaps these other "horrible" libraries would die out and the world
| would be a better place.
|
| Matt Kruse

Couldn't agree more.
What better place (c.l.j.) to show novice programmers the correct way
to code and also provide a resource of a robust library.
-- -------------------------------------------------------------
(e-mail address removed) : Remove your pants to reply
-- -------------------------------------------------------------
 
T

Thomas 'PointedEars' Lahn

Matt said:
this.isIE4DOM = typeof document.all == "object" && !this.isOpera;

Really?

If you had quoted properly and would have used common sense, you would have
known that it is there for backwards compatibility to previous versions of
the library. If you would have looked further, you would have found the
value being used in the current version only sparsely, where it does little
to no harm. You may rest assured that I will continue to review and, where
necessary, refactor the code on a regular basis.


PointedEars
 
T

Thomas 'PointedEars' Lahn

Thomas said:
[...] You may rest assured that I will continue to review
and, where necessary, refactor the code on a regular basis.

I would like to add that any constructive feedback regarding my code
between review cycles is appreciated of course. Thank you in advance.


PointedEars
 
D

Doug Miller

I have, in the past, considered selling JavaScript libraries and
widgets, but it seems to me that too many people are giving them
away. Factor in that most potential customers are unable to evaluate
code quality and you get a pretty lousy market outlook.
Free stuff is often worth not much more than the price paid. If yours is
enough better than the free stuff, your market might be larger than you think.
 
D

David Mark

Free stuff is often worth not much more than the price paid. If yours is
enough better than the free stuff, your market might be larger than you think.

But don't you think a large portion of that market would just steal
the code?
 
B

Brian Adkins

You just don't get it. There is no single library that is appropriate
for every task.

The several recent threads about JavaScript libraries has seemed quite
confrontational to me. I'm sure I've contributed to that myself, so I
apologize. Maybe it was perceived that I was being difficult on
purpose, but I can say that it was out of frustration, and not out of
intent. I feel it's an important topic though, so I'd like to give
everyone the benefit of the doubt and try to work through what I think
are some communication issues.

David, is it possible you're misunderstanding Matt's intention? It may
be that he's not looking for a single library to be used for every
task, but is simply interested in being able to leverage preexisting
code written by others. Isn't this a common desire for programmers? If
we begin a networking project which requires C programming, we don't
start by developing a TCP/IP library, right?

For example, if someone wanted to utilize regular expressions in
Common Lisp, one option would be to write their own regular expression
library, and another option would be to simply use CL-PPCRE. There is
a web site: http://www.weitz.de/cl-ppcre/ which provides
documentation, etc. This library has received great reviews from the
Common Lisp community. It's important for newcomers to Common Lisp to
be aware that such libraries exist to avoid reinventing the wheel.

In the other thread, I was truly trying to discover if a similar
situation existed in the JavaScript world i.e. well known public
libraries that are worthwhile to use. Do you think it's reasonable for
JavaScript programmers (of any level) to be interested in reusing
preexisting code written by others in this way - not to shield them
from learning JavaScript, but to simply save some coding/testing/
debugging time?
I am tired of hearing the "write everything from scratch" argument.
That is not the only other choice.

Maybe there have been multiple "from scratch" posts because that
phrase has a different meaning with different people. I think other
people have been frustrated from this as well. I won't speak for Matt,
but when I see "write everything from scratch", I think the author is
referring to writing code themselves instead of utilizing preexisting
code from other sources.

So, when several people make the assertion that "you don't have to
write everything from scratch" or "you don't have to write it all
yourself", but don't provide a means for accomplishing that (i.e. a
source of preexisting code), it sounds like a circular argument and is
frustrating - for both parties I expect.
For the last time, there is no "magic bullet" general purpose library
that is suitable for all tasks.

I doubt that anyone would disagree with that statement. I also agree
that the larger a library is, the greater the possibility that you
won't need a large portion of it for a particular task. I think it's
probably common for people to inquire about large, general purpose
libraries such as Prototype, JQuery, Dojo, YUI, etc. because those are
the only ones they're familiar with because of the "press" they
receive.

It's possible that they aren't looking for that in particular (e.g. a
large bloated library), but feel the only way they can reuse
preexisting code written by others is by utilizing one of them, and so
are interested in trying to determine if learning/using one is a good
investment.
These "real" people should
proceed to either hire competent developers or learn JavaScript
themselves.

Do you think learning JavaScript and utilizing someone else's
preexisting code is mutually exclusive? I'm not trolling, it's a
serious question. In every other language I've developed in
(Assembler, C, C++, Java, Ruby, Common Lisp, etc.) I've utilized
libraries written by others - not to avoid learning those languages,
but to be efficient. JavaScript running in a browser has some
challenges those other languages don't share with respect to library
use, but in principle, I would still think the benefits of library use
would apply.
 
T

tony.gurnick

you could also argue that an "Ultimate Javascript Library" that I cant
have is infinitley more useless than a badly coded, in-efficient
library that I can have.
 
R

Richard Cornford

Douglas said:
I would urge many of the regulars to reconsider
their positions.

Urgings would not be nearly as effective as sound reasoned arguments.
Some of the Ajax libraries have gotten quite good lately.

That is a matter of opinion. One of the things that seems absent from
'Ajax libraries' is the middle layer between the XML HTTP requests and
the user interface; the layer that manages the coordination of the two
independent sources of asynchronous input (the user's actions and the
XML HTTP responses). Increasingly I am seeing web sites 'handling' the
issues in that area by switching to synchronous XML HTTP requests, which
is such a bad idea that 'Ajax libraries' really should not offer an
option to do synchronous requests.
They eliminate most of the browser inconsistencies,

No they don't, and they don't even appear to be trying to as most pick a
small set of 'supported' browsers and will just fall apart if exposed to
anything outside of that set.
relieving one of the major pain points in browser
programming. And they shift the level of programming up
a level, so that you can focus more on your application,
and less on the browser's many limitations.

Maybe, but in some cases that shift may just be an abdication of
responsibility for the cross-browser issues.
The biggest problems with the libraries are that there
are too many of them,

I would say that a bigger problem is that these libraries are being
created by individuals who have not yet taken the time to learn
javascript, let alone browser scripting, and so are inevitably making
design mistakes, which then become entrenched because fixing them would
offend people already using the libraries.
and that there are some problems with the browser
architecture (particularly with security) that are
unsolvable, given the current state of standards and
browser implementations.

That is not really a problem with the libraries, except maybe some of
them make it easy to provoke security issues.
It looks like the too many problem will solve itself with
a shake out.

Probably, but not necessarily driven by rational criteria.
I am predicting that the winners of the shake out will be
Dojo and YUI because they are the best supported and
documented.

You might be right, and it might be 'support' and 'documentation' that
decide the question, but that outcome would be a tragedy given how
utterly atrocious dojo actually is. There are just too many examples of
code like:-

| if(
| elem == null ||
| ((elem == undefined)&&(typeof elem == "undefined"))
| ){
| dojo.raise("No element given to dojo.dom.setAttributeNS");
| }

- in dojo for anyone to regard its authors as anything other than inept.
You know the logic of that code as well as I do, and can see that the
final - (typeof elem == 'undefined') - just cannot ever be evaluated,
and that the (elem == undefined) expression can only have one result
whenever it is evaluated (making its evaluation pure runtime overhead to
no purpose). It is a basic failure to understand javascript, and the
fact that it is there for all to see means that it marks the panicle of
javascript understanding among all the contributors to the dojo code.
This has obvious implications for the nature of 'support' available, and
where the authors don't actually understand the code they are writing
you also have to wonder how useful their documentation of their code
will prove.
Good use of an Ajax library can improve your productivity
and improve the portability of your application.

Can and will are not the same thing, and that action is not the only way
of achieving that outcome.
The library makers scramble when every new browser ships

I bet they do, at least if it is a new version of one of the browsers
they chose to recognise in the first place. Most of the attempts to
handle multiple browsers that I have seen in this code is extremely
brittle and won't adapt at all well to changes in those browsers.
to find the workarounds for the new bugs and gotchas.
They are much better at that game than you want to be.

Better is very relative. If there is one thing that is obvious in the
common library's code it is that their authors have little knowledge of
cross-browser techniques, are not particularly good at pinning down the
cause and effect relationships of the issues they encounter and are
stuck in a mindset where each new browser/issue means another branch in
their code. With the bulk of that branching driven by browser sniffing.

Richard.
 
P

Peter Michaux

The several recent threads about JavaScript libraries has seemed quite
confrontational to me. I'm sure I've contributed to that myself, so I
apologize. Maybe it was perceived that I was being difficult on
purpose,

This is why I gave the logging example "library." It is not clear what
size, scope, and purpose of code you want to reuse and the criteria
keeps changing yet you still want an answer. If any size, scope and
purpose is sufficient then the logging example is sufficient. If the
size, scope and purpose matter even a bit then they must be specified
and you will get a much more useful answer.

but I can say that it was out of frustration,

I was more confused than frustrated when I started JavaScript but had
similar discussions when I first participated in comp.lang.javascript.
This newsgroup is the only public online community that I've found
where the regulars generally do not recommend using the big name
libraries. Most of the other communities are dedicated to a particular
library so it is no surprise that they recommend a library.

Since the beginning for me, I could see the discussions on
comp.lang.javascript contained more valid information about JavaScript
and browser scripting than those other forums. That got me thinking
"those surly, rude, socially incapable programmers must know
something." I don't really think those adjectives apply quite as much
as I initially thought. It is good that at least somewhere on the
internet there are a group of people that aren't afraid to call it
like they see it and hurt some feelings.

When I've been involved with other online communities related to
libraries, I get a sense of "I don't want to learn JavaScript and if
we all band together and keep telling each other we are doing a good
job we will be fine." Generally criticism is not welcome in large
doses. The Prototype library group is a perfect example. That library
initially augmented Object.prototype which is about the worst possible
namespace you could append properties if you care about namespace
clashes and for-in enumerations (no I don't buy the hasOwnProperty()
stuff.) In the end the Prototype group saw the wisdom that others were
offering by telling them to stop doing that. But in the mean time
there were battles and arguments about it. The Prototype community
were defending their flag of honour and critics were derided and
labeled heretics. It took a long time to make that change. That
library is slowly changing it's ways. The library still augments other
built-in objects and it has caused problems with new browser releases,
the library is still distributed in one huge file and does all sorts
of contortions with the language. Do you want to wait for them to fix
that stuff too? You could learn JavaScript and write your own library
perfectly applicable to your situation without any of their legacy
restrictions far faster than they can change.

and not out of
intent. I feel it's an important topic though,

Code reuse is an important topic.

so I'd like to give
everyone the benefit of the doubt and try to work through what I think
are some communication issues.

David, is it possible you're misunderstanding Matt's intention? It may
be that he's not looking for a single library to be used for every
task, but is simply interested in being able to leverage preexisting
code written by others. Isn't this a common desire for programmers? If
we begin a networking project which requires C programming, we don't
start by developing a TCP/IP library, right?

Starting a JavaScript project without a library is not quite like
starting a C project without TCP/IP library or stdlib or something
similarly fundamental. Even for a big project, the JavaScript library
code that you would need to write would be only a few thousand lines.
This is part of the reason so many JavaScript libraries exist: the
entry cost is low. To start a C project with no libraries would mean
tens of thousands of lines of libraries to write and I'd say those
libraries would be individually far more complex than any of the
JavaScript libraries. You would literally be operating at the bit
level at times and writing malloc would be no treat I'm sure.

For example, if someone wanted to utilize regular expressions in
Common Lisp, one option would be to write their own regular expression
library, and another option would be to simply use CL-PPCRE. There is
a web site:http://www.weitz.de/cl-ppcre/which provides
documentation, etc. This library has received great reviews from the
Common Lisp community. It's important for newcomers to Common Lisp to
be aware that such libraries exist to avoid reinventing the wheel.

There are different priorities in browser scripting than the tasks for
which other languages are used. For example, code size matters much
more in browser scripting and perhaps doesn't matter much at all in
most other tasks.

In the other thread, I was truly trying to discover if a similar
situation existed in the JavaScript world i.e. well known public
libraries that are worthwhile to use.

You can easily find people that will answer yes. There must be a
reason you stayed here.

Do you think it's reasonable for
JavaScript programmers (of any level) to be interested in reusing
preexisting code written by others in this way - not to shield them
from learning JavaScript, but to simply save some coding/testing/
debugging time?

I first used YUI to learn many things. I've read some jQuery code and
ext to learn how they do CSS selectors. Using those libraries as
educational resources has been helpful.

The fundamental libraries seem to be for events and Ajax. Really with
those two libraries you can build everything else quite easily. I
wrote my own event and Ajax libraries (roughly based on the YUI API)
and you can even find them available on the web. It has worked out
much better than using one of the big name libraries. I still receive
emails from the YUI and Prototype ticket systems for tickets I created
over a year and a half ago. I didn't have time to wait for that long.
I also don't have any of the bloat of features that I don't use and
don't even think are a good idea to use.

Even if I had used a publicly available library for events and Ajax, I
have never had the opportunity to reuse widgets like a tabbed pane,
drop down menu, etc in my job. The main reason is I always need custom
features. High level components are just less reusable. However with a
base events library is it very easy to write a custom widget that has
exactly the necessary functionality and nothing more. The widgets I've
written have typically been a tenth the size of publicly available
widgets that do many things but not what I need.

Maybe there have been multiple "from scratch" posts because that
phrase has a different meaning with different people. I think other
people have been frustrated from this as well. I won't speak for Matt,
but when I see "write everything from scratch", I think the author is
referring to writing code themselves instead of utilizing preexisting
code from other sources.

Using preexisting code probably means different things to different
people.

So, when several people make the assertion that "you don't have to
write everything from scratch" or "you don't have to write it all
yourself", but don't provide a means for accomplishing that (i.e. a
source of preexisting code), it sounds like a circular argument and is
frustrating - for both parties I expect.



I doubt that anyone would disagree with that statement. I also agree
that the larger a library is, the greater the possibility that you
won't need a large portion of it for a particular task. I think it's
probably common for people to inquire about large, general purpose
libraries such as Prototype, JQuery, Dojo, YUI, etc. because those are
the only ones they're familiar with because of the "press" they
receive.

It's possible that they aren't looking for that in particular (e.g. a
large bloated library), but feel the only way they can reuse
preexisting code written by others is by utilizing one of them, and so
are interested in trying to determine if learning/using one is a good
investment.

Sometimes they might not like the answer they receive.


Do you think learning JavaScript and utilizing someone else's
preexisting code is mutually exclusive?

You need to understand JavaScript to use any of the publicly available
big name libraries. The more you understand and the more you look
around then I think the code in the libraries becomes less appealing.

At the next level above whether or not a library works or not is how
does it work. Libraries generally encourage particular style of
programming. jQuery is a good example. "Find stuff and do stuff to
it." I experimented with jQuery for a while and read examples on the
web. With jQuery, it is so easy (just characters of code) to find
stuff that people do it all the time. jQuery seems to have encouraged
it's users to write inefficient code. This is a problem beyond the
actual bugs and hacks that are in jQuery that may break with new
browser releases and may not have any substitutable solutions at all
when they do (eg the window.onload problem) due to the code that the
library has encouraged.

I'm not trolling, it's a
serious question. In every other language I've developed in
(Assembler, C, C++, Java, Ruby, Common Lisp, etc.) I've utilized
libraries written by others - not to avoid learning those languages,
but to be efficient. JavaScript running in a browser has some
challenges those other languages don't share with respect to library
use, but in principle, I would still think the benefits of library use
would apply.

There is a feeling that the average ability of library writers in
JavaScript/browser scripting is far lower than the average abilities
of programmers in other languages/contexts. This is likely due where
JavaScript programmers come from in life. Without stats I would guess
less have computer science degrees and more are self-taught. This
makes your comparison less apples-to-apples as the libraries in the
other languages may have been more worthy of reuse.

Peter
 
B

Brian Adkins

This is why I gave the logging example "library." It is not clear what
size, scope, and purpose of code you want to reuse and the criteria
keeps changing yet you still want an answer. If any size, scope and
purpose is sufficient then the logging example is sufficient. If the
size, scope and purpose matter even a bit then they must be specified
and you will get a much more useful answer.

I'm sorry Peter, but if you continue to insist that what you provided
was a realistic solution to my question (regardless of how ill-formed
you may have felt it was), I think it may be difficult for us to have
a conversation. I noticed you put "library" in quotes, so maybe you
sensed it was not a reasonable solution also.

If you honestly feel that you would consider creating a web site, for
example, to offer that code to the public as a "library", then I
apologize, but I seriously doubt that is the case. Do you now
understand why I included "publicly available" as a criteria?

Anyway, if any library/module authors who were proud of their code
were reading any of these threads, I expect they would have mentioned
their offerings by now, so we're probably beyond beating a dead horse
at this point, I think it's probably a bloody pulp :)
When I've been involved with other online communities related to
libraries, I get a sense of "I don't want to learn JavaScript

I believe you, and others, may have projected that attitude onto
people who don't share it. That's probably where the "straw man"
arguments keep coming from - not from maliciousness, but from not
bothering to actually understand where people are coming from and
simply assuming.
Code reuse is an important topic.

Do you reuse code from others? If so, what are the sources of code
that you've found valuable.
The fundamental libraries seem to be for events and Ajax. Really with
those two libraries you can build everything else quite easily. I
wrote my own event and Ajax libraries (roughly based on the YUI API)
and you can even find them available on the web.

Well, why the heck didn't you mention those instead of the logger
thing ?! :) What's the URL?
It has worked out
much better than using one of the big name libraries. I still receive
emails from the YUI and Prototype ticket systems for tickets I created
over a year and a half ago. I didn't have time to wait for that long.
I also don't have any of the bloat of features that I don't use and
don't even think are a good idea to use.

If I end up writing a lot of code myself, that's fine, but it doesn't
make sense to reinvent the wheel if you don't have to. I have to say
the effort to have a dialog here has been much more than any other
newsgroup. Discovering some valuable, time saving libraries for Common
Lisp was straightforward.
Using preexisting code probably means different things to different
people.

Yes, but "preexisting code from other sources" should be pretty clear,
even in this crowd, right? "preexisting" => "it has already been
written"
"from other sources" => "I didn't write it"

Brian
 
M

Matt Kruse

What makes you think that modules developed for my own use would be
appropriate for somebody else?

Do you think you are solving extremely unique problems?
I think you misunderstand my intention. I have no plans to publish
the next free library. I might post some low-level functions, which
could be of interest to people who need a foundation to start their
own libraries.

I assume you have assembled your low-level functions into high-level
functionality at some point, so surely you have developed enough
functionality to accomplish complex tasks. Why not post all the code
you have - even if undocumented - as a great jump-start to anyone want
to assemble those pieces into something they would find useful?
You just don't get it. There is no single library that is appropriate
for every task. That is what jQuery, Prototype, etc. try to be and
they fail miserably at it.

I think you misjudge the intent. IMO, these libraries intend to be a
solid framework that combine low-level reusable functions with an
intuitive API. They don't try to solve every problem. They give the
developer a different set of tools to use. Tools which are often more
compact, easier to use, and provide good browser abstraction.

Inserting jquery.js into a page will do nothing for you. It's just a
tool. You still need to write code.

How is this approach any different from your own set of low-level
functions? Libraries like jQuery just assemble the most often-used set
of tools and give them a consistent API. In under 30k of code, you
have a large set of functionality that you know will always be
available without having to piece together various functions to do
exactly what you want. How is that bad?
And no, I am not interested in
publishing and supporting my codebase as a free library. Sorry.

Which is ridiculous. So you have nothing to really offer anyone except
bashing the solutions others are developing. Great approach!
I am tired of hearing the "write everything from scratch" argument.
That is not the only other choice.

What _is_ the other choice? Could you be more specific?
If you don't get a library or set of functions from someone else, will
it magically write itself?
For the last time, there is no "magic bullet" general purpose library
that is suitable for all tasks.

I don't see anyone claiming that there is.

But there are general purpose libraries that provide a set of tools
and framework that will be beneficial in many common tasks.

Matt Kruse
 
P

Peter Michaux

I'm sorry Peter, but if you continue to insist that what you provided
was a realistic solution to my question (regardless of how ill-formed
you may have felt it was)

No offense but it was ill formed and that has been the problem all
along. Other respondents tried to get you to specify your requirements
but it hasn't happened. I was just giving an extreme example that
satisfied your request perhaps prompting a refined request. Please
state the exact specifications of the type of code you would like to
reuse and for what purpose.

I think it may be difficult for us to have
a conversation. I noticed you put "library" in quotes, so maybe you
sensed it was not a reasonable solution also.

It was intended to be obviously unreasonable. It is for debug logging
after all. That isn't even done in production code.

If you honestly feel that you would consider creating a web site, for
example, to offer that code to the public as a "library", then I
apologize, but I seriously doubt that is the case.

You are right. I wouldn't.

Do you now
understand why I included "publicly available" as a criteria?

Your specs keep changing and several people have pointed to this
problem. Is a having a website the only way to be satisfactorily
public? Does having a website mean a library is better?

Anyway, if any library/module authors who were proud of their code
were reading any of these threads, I expect they would have mentioned
their offerings by now, so we're probably beyond beating a dead horse
at this point, I think it's probably a bloody pulp :)


I believe you, and others, may have projected that attitude onto
people who don't share it.

I was fresh meat and equally new to other communities and to
comp.lang.javascript. I don't have any personal connections to anyone
programming in JavaScript. I was relatively unbiased. That was the
impression I got especially in the Rails/Prototype community where
there is a movement to hide all JavaScript in Ruby wrappers.

That's probably where the "straw man"
arguments keep coming from - not from maliciousness, but from not
bothering to actually understand where people are coming from and
simply assuming.


Do you reuse code from others? If so, what are the sources of code
that you've found valuable.

comp.lang.javascript faq and faq notes
comp.lang.javascript archives
google.com search results
YUI and other libraries

All are just educational resources for me. After I understand the
problem I write my own version specific to my task with the API I
like.

The most important page I've read about doing browser scripting well
is

http://www.jibbering.com/faq/faq_notes/not_browser_detect.html

but I haven't used any of that code as is.

Well, why the heck didn't you mention those instead of the logger
thing ?! :)

I was being an ass, making a mild joke and also a point to try to get
a better question from you so that you would get a more useful answer.

What's the URL?

http://forkjavascript.org

It works for me in my work situation and the way I handle degradation
paths.

If I end up writing a lot of code myself, that's fine, but it doesn't
make sense to reinvent the wheel if you don't have to. I have to say
the effort to have a dialog here has been much more than any other
newsgroup. Discovering some valuable, time saving libraries for Common
Lisp was straightforward.

Perhaps "valuable, time saving libraries" are readily available in the
Common Lisp world but not in the JavaScript world.

Yes, but "preexisting code from other sources" should be pretty clear,
even in this crowd, right? "preexisting" => "it has already been
written"
"from other sources" => "I didn't write it"

Somewhere communication has broken down. It seems you think you have
clearly stated your library specs. You've assumed people will imply
the same things you have implied in you requirements but that hasn't
appeared to be the case. What do you want? Do you need a large user
base for the library? Do you need tutorials and documentations? Do you
need code that works on IE4 or cell phones or only in Opera 9? Do you
want event and Ajax libraries or do you only need to be able to
validate form inputs? Do you need code that has a larger chance of
working in future browsers or browser you have not tested? Do you have
a perfectionist in you that just can't stand seeing bad practices in
code that works now but likely will cause you grief down the road?
Perhaps you are writing a website for lower income people or people in
the third world with very slow connections so download times matter
more? Are you writing as site for blind people? Perhaps you are
writing for an internal app behind a login? How much money do you have
for development and testing? Does a particular library style/syntax
appeal to you? Is your website mission critical like a banking site or
is it a hobby site? If a bug appears how quickly will you need it
fixed in the library code? How do you weight all these requirements?
Some of these requirements will automatically negate YUI, Dojo,
Prototype, jQuery etc. There are likely people on comp.lang.javascript
that work in a wide variety of these situations so their priorities
will vary from yours and impact their answers if left to implications.

If you like the answers you receive or not is a different story and
apparently so far you haven't liked them.

I don't think that many people in JavaScript/browser scripting are
pleased with the missing aggregation of knowledge. At least an
outstanding book should exist. Currently it takes a newcomer an
unreasonably long time to gather all the information. The really
knowledgeable developers are busy working which pays much more money
than book writing.

Right now what I would like the most is an example from Richard
Cornford about how he implements and documents his library style with
an interface having several implementations. It is quite clear after
his explanation but an example may show some subtle things he has
learned working with such a library system.

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top