By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,299 Members | 1,242 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,299 IT Pros & Developers. It's quick & easy.

Javascript building blocks

P: n/a
Are there any simple javascript building blocks available? Like,
Google web toolkit. But, I don't want to write code in java and then
compiled into javascript. I am just looking for portable ajax/
javascript libraries. Thanks in advance.

Oct 16 '07 #1
Share this Question
Share on Google+
11 Replies


P: n/a
On Oct 16, 5:03 am, v4vijayakumar wrote:
Are there any simple javascript building blocks available?
Like, Google web toolkit. But, I don't want to write code
in java and then compiled into javascript.
That may no be a wise direction to go in regardless. The obvious
problem would be that no matter how good you may be at Java, and how
well you wrote the Java code, the javascript that it would be compiled
into would never be better than what Google is capable of. And you
don't have to do any more than use 'view source' on a Google groups
page to see that Google's javascript authoring is so bad as to be
laughable. An impression that is rapidly re-enforced by hading IE pop
up its error dialog whenever an error happens and then using Google
groups for more than a few minutes.
I am just looking for portable ajax/
javascript libraries. Thanks in advance.
Do you mean AJAX (the thing involving the handling of multiple
asynchronous sources of input) or do you just mean an XML HTTP request
library?

Oct 16 '07 #2

P: n/a
v4vijayakumar wrote:
Are there any simple javascript building blocks available? Like,
Google web toolkit. But, I don't want to write code in java and then
compiled into javascript. I am just looking for portable ajax/
javascript libraries. Thanks in advance.
Java does not "compile into javascript". They are quite different
languages and have no real relationship.
Oct 16 '07 #3

P: n/a
On Oct 16, 9:55 am, The Magpie <use...@pigsinspace.co.ukwrote:
v4vijayakumar wrote:
Are there any simple javascript building blocks available? Like,
Google web toolkit. But, I don't want to write code in java and then
compiled into javascript. I am just looking for portable ajax/
javascript libraries. Thanks in advance.
Java does not "compile into javascript". They are quite different
languages and have no real relationship.
You should first understand what the Google Web Toolkit is before
making such a statement.

Matt Kruse

Oct 16 '07 #4

P: n/a
On Oct 16, 9:55 am, The Magpie <use...@pigsinspace.co.ukwrote:
v4vijayakumar wrote:
Are there any simple javascript building blocks available? Like,
Google web toolkit. But, I don't want to write code in java and then
compiled into javascript. I am just looking for portable ajax/
javascript libraries. Thanks in advance.
Java does not "compile into javascript". They are quite different
languages and have no real relationship.
You should first understand what the Google Web Toolkit is before
making such a statement.

Matt Kruse

Oct 16 '07 #5

P: n/a
In comp.lang.javascript message <11*********************@q5g2000prf.goog
legroups.com>, Tue, 16 Oct 2007 16:22:39, Peter Michaux
<pe**********@gmail.composted:
>
If you do not aggregate your JavaScript code into files (aka
libraries) then you will be asking the client to make many downloads
for even a moderately complex page. That is far slower than
downloading a single file with all the functions you need in it. You
should bundle your functions into libraries even if those libraries
are specific to a particular page.
IMHO a Library (in computing) is something from which the relevant parts
are extracted at the authoring stage. In Pascal/Delphi, for example,
one can include many Units in the program source set, but only the
necessary routines will be included in the distributed EXE (approximate
statement).

A Javascript Library should be treated similarly; but the task is not
normally automated. The author should repackage what is appropriate, so
that no more than is reasonable is downloaded to each user.

So an author must neither put all possible routines in one vast file,
not put each routine in its own file; but must strike a happy mean :
that is an art.

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v6.05 IE 6
news:comp.lang.javascript FAQ <URL:http://www.jibbering.com/faq/index.html>.
<URL:http://www.merlyn.demon.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
Oct 16 '07 #6

P: n/a
Matt Kruse wrote:
On Oct 16, 9:55 am, The Magpie <use...@pigsinspace.co.ukwrote:
>v4vijayakumar wrote:
>>Are there any simple javascript building blocks available? Like,
Google web toolkit. But, I don't want to write code in java and then
compiled into javascript. I am just looking for portable ajax/
javascript libraries. Thanks in advance.
Java does not "compile into javascript". They are quite different
languages and have no real relationship.

You should first understand what the Google Web Toolkit is before
making such a statement.
Not really Matt - its simple fact.

I will give you every credit and presume that you are referring to
cross-compilation features I understand are in Google Toolkit, but
even so that is no more relevant than to presume BBC Basic can be
"compiled" into PL/1 or Fortan into Cobol.

Maybe they can - its what cross-compilers are for, after all - but it
does not change the facts that the languages are unrelated.
Oct 17 '07 #7

P: n/a
On Oct 17, 11:10 am, The Magpie <use...@pigsinspace.co.ukwrote:
Matt Kruse wrote:
On Oct 16, 9:55 am, The Magpie <use...@pigsinspace.co.ukwrote:
v4vijayakumar wrote:
Are there any simple javascript building blocks available? Like,
Google web toolkit. But, I don't want to write code in java and then
compiled into javascript. I am just looking for portable ajax/
javascript libraries. Thanks in advance.
Java does not "compile into javascript". They are quite different
languages and have no real relationship.
You should first understand what the Google Web Toolkit is before
making such a statement.

Not really Matt - its simple fact.

I will give you every credit and presume that you are referring to
cross-compilation features I understand are in Google Toolkit, but
even so that is no more relevant than to presume BBC Basic can be
"compiled" into PL/1 or Fortan into Cobol.
I think your definitions of compiler does not line up with the
majority of programmers.

"A compiler is a computer program (or set of programs) that translates
text written in a computer language (the source language) into another
computer language (the target language)." - http://en.wikipedia.org/wiki/Compiler

So GWT is a perfect example of a compiler because it translates Java
to JavaScript.

Peter

Oct 17 '07 #8

P: n/a
On Oct 17, 11:10 am, The Magpie <use...@pigsinspace.co.ukwrote:
Matt Kruse wrote:
On Oct 16, 9:55 am, The Magpie <use...@pigsinspace.co.ukwrote:
v4vijayakumar wrote:
Are there any simple javascript building blocks available? Like,
Google web toolkit. But, I don't want to write code in java and then
compiled into javascript. I am just looking for portable ajax/
javascript libraries. Thanks in advance.
Java does not "compile into javascript". They are quite different
languages and have no real relationship.
You should first understand what the Google Web Toolkit is before
making such a statement.

Not really Matt - its simple fact.

I will give you every credit and presume that you are referring to
cross-compilation features I understand are in Google Toolkit, but
even so that is no more relevant than to presume BBC Basic can be
"compiled" into PL/1 or Fortan into Cobol.
I think your definitions of compiler does not line up with the
majority of programmers.

"A compiler is a computer program (or set of programs) that translates
text written in a computer language (the source language) into another
computer language (the target language)." - http://en.wikipedia.org/wiki/Compiler

So GWT is a perfect example of a compiler because it translates Java
to JavaScript.

Peter

Oct 18 '07 #9

P: n/a
On Oct 16, 3:36 pm, Dr J R Stockton <j...@merlyn.demon.co.ukwrote:
In comp.lang.javascript message <1192551759.809434.28...@q5g2000prf.goog
legroups.com>, Tue, 16 Oct 2007 16:22:39, Peter Michaux
<petermich...@gmail.composted:
If you do not aggregate your JavaScript code into files (aka
libraries) then you will be asking the client to make many downloads
for even a moderately complex page. That is far slower than
downloading a single file with all the functions you need in it. You
should bundle your functions into libraries even if those libraries
are specific to a particular page.

IMHO a Library (in computing) is something from which the relevant parts
are extracted at the authoring stage. In Pascal/Delphi, for example,
one can include many Units in the program source set, but only the
necessary routines will be included in the distributed EXE (approximate
statement).

A Javascript Library should be treated similarly; but the task is not
normally automated. The author should repackage what is appropriate, so
that no more than is reasonable is downloaded to each user.

So an author must neither put all possible routines in one vast file,
not put each routine in its own file; but must strike a happy mean :
that is an art.
Bundling up your scripts into a file without too many excess files is
a perfectly valid way to approach. Scripts that require no extra
dependencies are attractive because they can be optimized for the
intended purpose. The result is a small, self-contained script.

On the other hand...

Large apps that have the functionality distributed in various ways can
benefit from reuse of components. Things like DOM utilities, Event
Registry, Ajax Transport, Data Structures, Plain old Objects (POJSO?)
like URLBuilder or Color, Widgets, et c. With this approach, code
maintenance becomes an unavoidable issue. Breaking things down into
cohesive units makes testing and maintenance easier; you don't have to
worry about a failure case in one page, then changing the code to
create another failure case on another page. Instead, you just write
isolated tests for all uses of the bit of code.

With the "small objects" approach, an automated task can be used to
"build" to "compile" the scripts into one. That way, you can maximize
cohesion and avoid the headaches associated with copy-paste
maintenance.

--
(c) John Stockton, Surrey, UK. ?...@merlyn.demon.co.uk Turnpike v6.05 IE 6


Oct 18 '07 #10

P: n/a
Randy Webb wrote:
>
And that is, precisely, why Matt wrote what he wrote.
I believe I made that point, Randy. Please do not presume criticism
where there is none.
>
And the fact that the languages are unrelated isn't what Matt was
referring to.
I know, and as I said I mentioned that. However, my point was to the
OP who, unlike Matt, did seem to be confused on that point.
Oct 20 '07 #11

P: n/a
Peter Michaux wrote:
>
I think your definitions of compiler does not line up with the
majority of programmers.

"A compiler is a computer program (or set of programs) that translates
text written in a computer language (the source language) into another
computer language (the target language)." - http://en.wikipedia.org/wiki/Compiler
Peter, there are a number of definitions and sub-definitions of
"compiler" and it is often important to distinguish between them to
avoid confusion. It was to avoid such possible confusion, if there was
any, in the mind of the OP that I commented as I did.

If I may quote - from your own source - a section of the same article
which makes the same point that I made, but in a rather more
long-winded way:-

<<The name "compiler" is primarily used for programs that translate
source code from a high-level programming language to a lower level
language (e.g., assembly language or machine language). A program that
translates from a low level language to a higher level one is a
decompiler. A program that translates between high-level languages is
usually called a language translator, source to source translator, or
language converter. A language rewriter is usually a program that
translates the form of expressions without a change of language.>>
<<<http://en.wikipedia.org/wiki/Compiler>>>
Oct 20 '07 #12

This discussion thread is closed

Replies have been disabled for this discussion.