Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
Mozilla The Internet News

JavaScript Inventor Speaks Out 267

Anonymous Coward writes "Brendan, on his mozillazine blog talks about JavaScript 1, 2, and in between in light of DHTML and AJAX. In an informal blog entry he answers frequently asked questions such as fixing Unicode in regular expressions, multi-threading, weak numeric typing, and obfuscating code."
This discussion has been archived. No new comments can be posted.

JavaScript Inventor Speaks Out

Comments Filter:
  • And why not? (Score:5, Insightful)

    by Saeed al-Sahaf ( 665390 ) on Wednesday June 15, 2005 @09:51PM (#12829257) Homepage
    but this stinks of DRM type shit. somewhat like that amazon fiasco that prevents the same user from viewing all the pages of a book.

    Honestly. Why should you be able to? Amazon SELLS books. It's not an on-line library. That's not the service they are offering.

  • by Eberlin ( 570874 ) on Wednesday June 15, 2005 @10:10PM (#12829346) Homepage
    Code obfuscation isn't really a "feature" per se. I think the main problem is what you've mentioned -- that a lot of folks don't believe in the "Open Source" philosophy and yet use such scripting languages that by their very nature, are "open source." (PERL rants aside)

    It's writing code and hoping nobody else can understand, modify, improve, or possibly circumvent it. To be perfectly honest, I don't think code should be more obfuscated than it already is. The simpler and easier to understand, the better.

    I did run into a vbscript worm once that did something like rotX itself when transporting (with a random shift, I believe, to try to avoid AV fingerprinting), then decode and execute upon launch. I must say that was pretty neat in a sick sort of way.
  • Re:JavaScript (Score:2, Insightful)

    by superpulpsicle ( 533373 ) on Wednesday June 15, 2005 @10:22PM (#12829384)
    The reason so many stayed away from Javascript was the revealing code. Any browser could have you peek at the developer's work. I knew alot of developers that had a problem with that. They would rather write a slow piece of shit java applet compiled. Javascript was always lightning fast.

  • by dwlovell ( 815091 ) on Wednesday June 15, 2005 @10:38PM (#12829443)
    I mostly agree, but we do need Javascript. If you look at the Strict XHTML spec, there is no target="" attribute allowed on anchor tags. So if you want to open a link in a new browser, the official way to do it requires client-script (something about targetting is a browser behavior not a document structure semantic, so it should be script, not html):

    <a href="http://www.slashdot.org" onclick="window.open(this.href,'_blank');return false;">Slashdot</a>

    So you can argue that XHTML blows, or that you shouldn't open links in a new window, but if you decide you want to be standards compliant, you are going to need some client script. This is not the only example.

    -David

  • by Anonymous Coward on Wednesday June 15, 2005 @11:03PM (#12829580)
    No web page should ever open up a new browser window when the user clicks on a link. That's rude! The world wide web is a set of documents, not an application. Web pages should not be making decisions of that sort for the user.
  • by Anonymous Coward on Wednesday June 15, 2005 @11:45PM (#12829714)
    Painters mask the meaning of paintings all the time. If they were completely obvious art would be dull.

    But seriously, it's not like a painter masking the meaning of a painting; it's like a painter masking the method of the painting -- how he achieved the results. And, really, no painter (or coder) should be _forced_ to tell you how he does his work, especially if he's trying to make a profit off the process.
  • by nxtw ( 866177 ) on Wednesday June 15, 2005 @11:53PM (#12829755)
    Blah blah blah. There are situations where that's actually the most user-friendly thing to do, like when you're editing or entering information and need to display detailed instructions without losing the form, along with some other situations.
  • by Paua Fritter ( 448250 ) on Thursday June 16, 2005 @01:10AM (#12830082)
    There are situations where [opening a new window is] actually the most user-friendly thing to do, like when you're editing or entering information and need to display detailed instructions without losing the form

    You can do this with CSS, and without having to call back to the server for the "help" content as another web page

    Define your help notes as divs which are hidden (display:none). Then you have your "help" hyperlinks point to those divs, which can then become visible (because they have the focus a different CSS rule applies and they can get display:block or whatever).

    Opening new windows is almost always a bad idea. "User-friendly" depends not just on the technique but also on the user. For some people it may work, in some circumstances, but for other people (people with visual impairments, for instance) it is never friendly.

  • by nacturation ( 646836 ) <nacturation AT gmail DOT com> on Thursday June 16, 2005 @02:06AM (#12830251) Journal
    All I know is that [javascript] has pissed me off more than any other "top 5" languages in the work place.

    And how many other languages do you use to write client-side code for web browsers? The problem is that the browsers don't all implement the same standards for their internal object models... but this is a result of using JavaScript to implement differing browser APIs, not a failure in JS itself. It's like saying that ANSI C is lousy because the same code for a graphical app will create errors if you compile it under Windows, Linux, and Mac. The language is fine it's just that those platforms, much like the browsers, implement different graphics APIs.
  • by Tim C ( 15259 ) on Thursday June 16, 2005 @02:25AM (#12830301)
    somewhat like that amazon fiasco that prevents the same user from viewing all the pages of a book.

    If Amazon didn't at least attempt to prevent you from accessing every page of each book, they'd be unable to offer the service at all as there's no way the publishers would agree to it. They'd essentially be providing a mechanism to get the text of the book for free.

    If enough people piss about with it, Amazon *will* be forced to either withdraw the service, or just put up (say) five pages of each book and leave it at that, which would greatly reduce its usefulness.
  • by Pieroxy ( 222434 ) on Thursday June 16, 2005 @03:52AM (#12830517) Homepage
    People are confusing the language and its more popular set of libraries.

    Javascript is a language

    The DHTML DOM (window, document, location, etc...) is merely an API. When you code in another environment, there is another API. For exemple, when ASP uses JScript (and not JavaScript, but it's pretty similar), APIs are such as ADODB, file system access, db access, etc...
  • JS rocks (Score:4, Insightful)

    by famebait ( 450028 ) on Thursday June 16, 2005 @04:50AM (#12830649)
    It never ceases to amaze me how people can do sometimes extensive work with JavaScript and still not spot what an elegant and powerful language it is. Sure, most of that work is about doing meaningless browser-related stuff and wrestling with bad APIs, but come on. I really do expect from an averagely talented real IT person to be able to separate that from the langauge, and be able to recognise the things it can do that their normal language can't. Its almost single-abstraction design that turns out to be able to do just about everything and still look nice and procedural and newbie-friendly totally rocks.
  • Relief at last! (Score:5, Insightful)

    by Qbertino ( 265505 ) <moiraNO@SPAMmodparlor.com> on Thursday June 16, 2005 @06:26AM (#12830854)
    Finally somebody who isn't a total dickhead speaks up on the Ajax craze.

    "With DHTML and AJAX hot (or hot again; we've been here before, and I don't like either acronym) ..."

    Bingo!
    The man's right on.

FORTRAN is not a flower but a weed -- it is hardy, occasionally blooms, and grows in every computer. -- A.J. Perlis

Working...