Javascript or Java ?

T

Tom de Neef

I have done one Javascript project. It ended up with 1000 lines of code. The
next one will be 10-20 times as big and my question is whether I should
switch to Java.

I have always programmed in Pascal, the last 10 years using Delphi. (And I
will stick with that for non-web based applications.) What I missed most in
the Javascript project was a good development environment with integrated
debugger. So, an important part of the question about Javascript/Java is
about the ease of development when the project gets bigger. Is there a good
environment for Javascript? And what other considerations would you have?

Kind regards,
Tom
 
C

Charles

debugger. So, an important part of the question about Javascript/Java is
about the ease of development when the project gets bigger. Is there a good
environment for Javascript? And what other considerations would you have?

To develop Java you have several good IDEs such as Eclipse. To code
Javascript you can use any text editor with code highlighting but you
will always have to test in several browsers (IE7, IE6, Opera, Firefox
or Seamonkey, Safari or Konqueror). Javascript is definitely better
than using a Java applet. Who in this room has JRE installed on his
computer, in the first place? :)
 
J

Joost Diepenmaat

Tom de Neef said:
I have done one Javascript project. It ended up with 1000 lines of code. The
next one will be 10-20 times as big and my question is whether I should
switch to Java.

To do what? For "client-side" programming, Javascript is the closest
thing with near-universal support (followed by Flash, I'd think). I
would not use Java for that unless you have very specific requirements.

Also, 10,000 lines of code isn't that much. You just need to structure
it well. And I'd be surprised if swiching to java wouldn't at least
double the LOC count.
I have always programmed in Pascal, the last 10 years using Delphi. (And I
will stick with that for non-web based applications.) What I missed most in
the Javascript project was a good development environment with integrated
debugger. So, an important part of the question about Javascript/Java is
about the ease of development when the project gets bigger. Is there a good
environment for Javascript? And what other considerations would you
have?

For client-side programming, I use emacs with a decent javascript mode
for writing the code: http://joost.zeekat.nl/wp-content/javascript.el

Since client-side javascript can only be realistically be tested and
debugged in a complete brower, you can do a lot worse than use firefox
with firebug for that: http://getfirebug.com - it has breakpoints, a
REPL, a dom inspector, script-accessible console/logging facilities, and
a profiler. It's just bloody useful.

And then you'd have to test it in all the other browsers you want to
support. The MSIE developer toolbar is useful too (but not nearly as
useful as firebug).

For server-side programming, I've never used javascript, but I have used
Java and I didn't like it much. The development tools are very good
though, if you're into that kind of thing. I just really don't like the
type system, the insistence on dumping classes everywhere and the lack
of first-order functions & closures.

Personally, I prefer perl, ruby and even php over Java for most web
programming (and I'm currently looking at Common Lisp too - development
with emacs + Slime mode is amazingly cool).


Joost.
 
T

Tom de Neef

McKirahan said:
What can you tell us about the application and its users?
The application is to assist children (and their parents) with the spelling
intricacies of Dutch verbs. I developed one 10 years ago but it was server
based. Now I want it:
browser based; stand-alone; no back-end, no external database, single
session.

Tom
 
T

Tom de Neef

McKirahan said:
Were you planning on using one or more HTML files for the application?
Yes, for fixed texts such as pieces of theory.
Was it going to require a Web server? Does it use the file system?
No, no.
Are you aware of (or have you considered) an HTML Application?

What are HTML Applications (HTA)?
http://www.c-point.com/javascript_tutorial/HTML_Applications.htm

That looks very interesting. Will hta's load and start as if they were a
htm? (i.e. is there any extra action required from the user?)
The Javascript Editor mentioned on your reference seems most impressive. Is
there anyone in this NG who has hands-on experience with it?

Tom
 
T

Tom de Neef

MikeB said:
Tom,

To do an HTA properly, you need to have all the properties of the HTA
in the head of the document, but if you simply rename the HTML file from
*.htm to *.hta, the MSHTA.EXE will still host it.

The Host, Mshta.exe is basically a stripped down IE without all the
security stuff for WAN interaction.

Is it then restricted to Windows?
Tom
 
T

Thomas 'PointedEars' Lahn

Tom said:
I have done one Javascript project. It ended up with 1000 lines of code.
The next one will be 10-20 times as big and my question is whether I
should switch to Java.

Rule of thumb: use the right language for the right purpose.
[...] What I missed most in the Javascript project was a good development
environment with integrated debugger.

I'd say Eclipse's AJAX Tools Framework (ATF) from the Web Tools Platform
(WTP) Project is quite good in that. What's more, it's open source and
for free.

http://www.eclipse.org/projects/project_summary.php?projectid=webtools.atf


PointedEars
 
J

Jeremy J Starcher

Is it then restricted to Windows?
Tom


Yes, HTAs are a MS Windows only beast -- that is explained on one of the
links given above.

http://www.c-point.com/javascript_tutorial/HTML_Applications.htm

Based on what I understand, you should be able to write the whole thing
in a cross-platform JS without too much work. It will load in a browser
window and run in a browser window, but it could be downloaded and run
offline (if that is something your user-base needs.)

If it must look like a real program (instead of inside a browser) and you
can live with IE only, then you can create an HTA.

I'd agree with most of the folks here and try to avoid Java. Seems like
so few people have a (good) Java plugin on their machines. In addition,
the content could not be saved and used offline easily. (This may be an
advantage, depending.)
 
T

Thomas 'PointedEars' Lahn

Tom said:
MikeB said:
[...]
To do an HTA properly, you need to have all the properties of the HTA
in the head of the document, but if you simply rename the HTML file from
*.htm to *.hta, the MSHTA.EXE will still host it.

The Host, Mshta.exe is basically a stripped down IE without all the
security stuff for WAN interaction.

Is it then restricted to Windows?

Windows and Windows emulators. The open-source free-software alternative
for HTA is XUL, which does not have that restriction.

http://en.wikipedia.org/wiki/XUL
http://developer.mozilla.org/en/docs/XUL

I have problems with Web access right now, so I don't know for sure if
either URL would work.


PointedEars
 
J

Jeremy J Starcher

Windows and Windows emulators. The open-source free-software
alternative for HTA is XUL, which does not have that restriction.

http://en.wikipedia.org/wiki/XUL
http://developer.mozilla.org/en/docs/XUL


I've heard of XUL before but I've not really looked into it much.

The examples that I see make it look like quite a different language and
setup all together that would make it less attractive than re-using an
existing skillset.

< URL: http://www.xulplanet.com/tutorials/xulqa/q_tmpl_child-cross-
grid.html >

Or is this a whole different same-named beast?
 
T

Thomas 'PointedEars' Lahn

Jeremy said:
I've heard of XUL before but I've not really looked into it much.

The examples that I see make it look like quite a different language and

In short, XUL is XML-based CSS-formatted markup that defines the
look of the interface, and JavaScript to define its functionality.
setup all together that would make it less attractive than re-using an
existing skillset.

< URL: http://www.xulplanet.com/tutorials/xulqa/q_tmpl_child-cross-
grid.html >

Or is this a whole different same-named beast?

It is one dim view at what XUL can do, which is best demonstrated by
applications that are built on it, such as Mozilla Firefox and
Thunderbird. Try the DOM Inspector add-on on them, and you will see.


PointedEars
 
T

Tom de Neef

Thank you all very much.
I will stick to Javascript and install some tools.
Tom
 

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
474,145
Messages
2,570,826
Members
47,373
Latest member
Desiree036

Latest Threads

Top