I have heard similar arguments that C is better than Java, or assembler
language is better than C .... :-)

I use JavaScript in my app because of two things. One, strangely, is
portability. For some reason, I couldn't find a good JVM (or any JVM!) for
the iPhone.

Second is easy of development. I structured my app in the "heavy duty" part,
which needs to handle all the thread synchronization issues, etc, that you
mentioned, and wrote those in Java (or ObjectiveC). Then, there's the
'quick-and-dirty' part, which I use JavaScript for.

Just an example of improving my productivity: during development, all of the
JavaScripts are hosted on a local web server. When I edit a JavaScript file,
I hit reload in my app. It takes 1 second to reload the script. When I edit
a Java file, it takes at least 15 seconds to rebuild in eclipse, reinstall
in emulator, restart activity, etc.

For the GUI? Well, my entire GUI is presented in HTML using a WebView, so
JavaScript is a natural choice. Sure, that's specific to my app, and
JavaScript may not be a good choice in every situation.

In my case, I wrote a semi-decent RSS feed reader in JavaScript and HTML in
about 4 nights while bottle feeding and chaging diapers. I figure it would
take at least 3 to 4 times as much if I were to code that in Java and
"proper" Android UI widgets.

See http://nubinewsblog.blogspot.com/2009/03/rss-reader-coming-soon.html

I would challenge anyone for writing an RSS reader with the same
functionality in Java using the same amount of time and changing the same
number of diapers :-)

You're right about the need for a fast CPU. But my target platforms (Android
and iPhone) are fully capable of running JavaScript. It would be a waste of
the CPU's ability (and my time :-) if I don't take advantage of what's
available to me.

On Sun, Apr 12, 2009 at 11:21 PM, ShrinkRay <[email protected]> wrote:

>
> Obviously you're not too familiar with the Java regular expression
> library, any of the Java XML processing libraries or many of the
> string processing functions in Java.
>
> JavaScript is slow and inefficient and is only made a useful solution
> for doing things like processing XML because of fast CPUs and large
> amounts of memory.
>
> JavaScript is not any easier to write than Java.  It has a number of
> convenience features, but with a modern refactoring IDE, Java is a
> much more capable and easier to develop, debug and test in.
>
> No scripting languages will magically fix your GUI component,
> threading or optimization issues, or testing of those issues, which
> are the major problems when writing front end applications.
>
> On Apr 13, 5:33 am, Mattaku Betsujin <[email protected]>
> wrote:
> > I use JavaScript A LOT in my app. It works like a charm. You just need to
> > create a WebView and load HTML data that contains JavaScript.
> >
> > Now, JavaScript is pretty lame, but for what I need to do (string
> > processing, XML parsing), it's a lot easier to write than Java. I must
> say
> > the use of JavaScript has increased my productivity by at least 5 fold
> for
> > such tasks.
> >
> > On Sun, Apr 12, 2009 at 10:41 AM, Evil Mushroom Lord <
> >
> > [email protected]> wrote:
> >
> > > Quite frankly (pardon me, I'm not trying to be rude-- I'm completely
> > > confused)--- why do you want to take a web development language like
> > > php--- and use it to make a mobile app?
> >
> > > Square + round hole? Java is a very easy programming language to use
> > > as it is.
> >
> > > While I'm primarily a C/C++/Java developer I do a lot with php as
> > > well......... and I am dumb founded on why I would ever even
> > > contemplate using php for anything besides a website.
> >
> > > Please enlighten me. What on any mobile device would you use php for
> > > where it would be a better fit than Java or C*?
> >
> > > ~Evil Mushroom Lord
> >
> > > Mushroom Wars: The Splatting
> > > On the android market now!
> > >http://www.evilmushroomempire.com/splat/screenshots.html
> >
> > > On Apr 12, 6:08 am, Roy M <[email protected]> wrote:
> > > > Are there any planned to support scripting language such as python,
> > > > perl or even php for Android apps development?
> >
> > > > It will definitely be make the development more easier.
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Android Discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/android-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to