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

JS Parallels to Forth

P: n/a
aum
On Mon, 18 Sep 2006 06:16:29 -0700, Jake Barnes wrote:
In the end, [choice of Javascript programming idiom] comes down to
community, and how much support that community can offer.
Thanks for that, Jake, and for your more balanced take on the issue of
'dressing up' Javascript to resemble the style of other languages like
Python or Ruby.

In Javascript, I see a lot of philosophical similarity to Forth. Both
Forth and Javascript are extremely 'liberal' languages of immense
expressive power, which lend themselves to highly idiomatic styles. Lua
falls into this camp somewhat as well.

Contrast this to Java (the Pascal of the 1990s and the darling of
corporations); also Python, which goes so far as forcing homogeneity with
whitespace and indenting. Not to mention COBOL (for those crusty enough to
remember it).

Languages of such extreme liberal design as Javascript, Forth and Lua will
naturally give rise to diverse, fragmented communities, just as liberal
forms of music give rise to umpteen genres and sub-genres. Within these
fragmented communities, sharing and integration of code may become
difficult.

Is there a trade-off between a language's expressive idiomatic power, and
the readability of the average 1000 lines of code written in that language
by a stranger?

I've done quite a bit of both Forth and Python. But the average 1000 lines
of Python from a stranger is far more readable to me than the average 1000
lines of Forth, and integrates much more easily into my repository.

So to me, there's a balance here. The expressive power of a language is
one virtue, the ability for a language user community to share, understand
and integrate code easily is a different virtue, and it's damned hard to
get the two together in one language.

Cheers
aum
Sep 18 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a

aum написав:
On Mon, 18 Sep 2006 06:16:29 -0700, Jake Barnes wrote:
In the end, [choice of Javascript programming idiom] comes down to
community, and how much support that community can offer.

Thanks for that, Jake, and for your more balanced take on the issue of
'dressing up' Javascript to resemble the style of other languages like
Python or Ruby.

In Javascript, I see a lot of philosophical similarity to Forth. Both
Forth and Javascript are extremely 'liberal' languages of immense
expressive power, which lend themselves to highly idiomatic styles. Lua
falls into this camp somewhat as well.

Contrast this to Java (the Pascal of the 1990s and the darling of
corporations); also Python, which goes so far as forcing homogeneity with
whitespace and indenting. Not to mention COBOL (for those crusty enough to
remember it).

Languages of such extreme liberal design as Javascript, Forth and Lua will
naturally give rise to diverse, fragmented communities, just as liberal
forms of music give rise to umpteen genres and sub-genres. Within these
fragmented communities, sharing and integration of code may become
difficult.

Is there a trade-off between a language's expressive idiomatic power, and
the readability of the average 1000 lines of code written in that language
by a stranger?

I've done quite a bit of both Forth and Python. But the average 1000 lines
of Python from a stranger is far more readable to me than the average 1000
lines of Forth, and integrates much more easily into my repository.

So to me, there's a balance here. The expressive power of a language is
one virtue, the ability for a language user community to share, understand
and integrate code easily is a different virtue, and it's damned hard to
get the two together in one language.

Cheers
aum
It is all right. But I think the main target is the how the programmer
can tell his/her thoughts using particular language. IMHO JavaScript is
one of the best languages because it offers almost infinity od ways to
express your thougts using the way you want.
About sharing the code. I think that in any case you'll have to rewrite
the code for your application. Maybe just slightly modufy, but somtimes
complete rewrite. One of the main abailties of the language is an
ability to be transparent and understandable. I think JS is. You can
read other's program and write your own using the same algorithm (but
using the way that is better for you).

Val

Sep 18 '06 #2

P: n/a

aum wrote:
Languages of such extreme liberal design as Javascript, Forth and Lua will
naturally give rise to diverse, fragmented communities, just as liberal
forms of music give rise to umpteen genres and sub-genres. Within these
fragmented communities, sharing and integration of code may become
difficult.

Is there a trade-off between a language's expressive idiomatic power, and
the readability of the average 1000 lines of code written in that language
by a stranger?
It's absolutely true that such flexibile languages lead to radically
different styles. But Javascript's current position goes way past even
that. It is being picked up whole new industries that have nothing to
do with the web. It is being applied to completely new problem domains,
and it is being dressed up with new APIs that have nothing to do with
browser DOMs. Consider the fact that Adobe now uses Javascript as its
cross-platform scripting language. Last year my biggest freelance gig
was when I was hired to help a large jewelry company automate the
production of its print catalog. Below is a link to a script written
for the Adobe Photoshop Javascript API, how much of this makes sense
to you? There is no Folder.selectDialog when you're working on the web.
(I was paid to teach the graphic designers at that company how to
program in Javascript, so that they could modify my scripts after I'd
left. I decided to teach them programming by walking through scripts
one line at time, and explaining each line thoroughly. I also
documented the script much more thoroughly than is normal, and in a
simplified, not-so-techy language).

http://www.krubner.com/loop_through_...t_file_name.js

Sep 19 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.