SearchSearch   

Great Examples of JavaScript code

 
   Webmaster Forums (Home) -> Javascript RSS
Next:  IE7 Does Not Support Some Unicode?  
Author Message
Jang

External


Since: Jun 15, 2007
Posts: 8



(Msg. 1) Posted: Thu Jul 26, 2007 5:55 pm
Post subject: Great Examples of JavaScript code
Archived from groups: comp>lang>javascript (more info?)

Does anyone have an example of well written JavaScript applications
that they know about? I would prefer the code to be readable. I
particularly like YUI's code. Does anyone have any more applications/
examples? Thanks .
Back to top
David Mark

External


Since: Aug 06, 2007
Posts: 358



(Msg. 2) Posted: Thu Jul 26, 2007 5:55 pm
Post subject: Re: Great Examples of JavaScript code
Archived from groups: per prev. post (more info?)

On Jul 26, 2:01 pm, Matt Kruse <m....TakeThisOut@mattkruse.com> wrote:
> On Jul 26, 12:55 pm, Jang <jangc....TakeThisOut@gmail.com> wrote:
>
> > Does anyone have an example of well written JavaScript applications
> > that they know about? I would prefer the code to be readable. I
> > particularly like YUI's code. Does anyone have any more applications/
> > examples? Thanks .
>
> Look at any of the big libraries - jQuery, Prototype, YUI, etc.
> What kinds of things are you trying to learn from the code/style?
>
> Matt Kruse

I gather the OP likes reading applications written for YUI, rather
than the YUI code itself.

If you want to learn to write good JavaScript applications, you need
to learn to write good JavaScript. Using somebody else's bloated,
browser-sniffing library is no substitute.
Back to top
David Mark

External


Since: Aug 06, 2007
Posts: 358



(Msg. 3) Posted: Thu Jul 26, 2007 5:55 pm
Post subject: Re: Great Examples of JavaScript code
Archived from groups: per prev. post (more info?)

On Jul 26, 3:19 pm, Randy Webb <HikksNotAtH... RemoveThis @aol.com> wrote:
[snip]

Oops. Previous response cut short by real world distraction. Now
back to the surreal world this thread has become.

>
> How do you read "I particularly like YUI's code" and interpret it as "I
> like applications written for YUI"? Sounds more like the OP is

You are quoting out of context. The OP asked for examples of "well
written JavaScript applications" and specifically ones that were
"readable." YUI is not an application, not well-written and, from
what I have seen of it, unreadable. In contrast, libraries like YUI
claim to enable application developers to write concise, readable
code.

Furthermore, it is hardly a stretch to call a YUI application "YUI
code." It is in the same vein as "MFC code." If you follow this
link, you will see that "YUI code" is used to describe code written
for YUI as often as it is to describe the actual library code.

http://www.google.com/search?sourceid=navclient&ie=UTF-8&rls=GGLD,GGLD...05-18,G

Clear?
Back to top
Randy Webb

External


Since: Aug 24, 2004
Posts: 4981



(Msg. 4) Posted: Thu Jul 26, 2007 5:55 pm
Post subject: Re: Great Examples of JavaScript code
Archived from groups: per prev. post (more info?)

David Mark said the following on 7/26/2007 2:27 PM:
> On Jul 26, 2:01 pm, Matt Kruse <m....TakeThisOut@mattkruse.com> wrote:
>> On Jul 26, 12:55 pm, Jang <jangc....TakeThisOut@gmail.com> wrote:
>>
>>> Does anyone have an example of well written JavaScript applications
>>> that they know about? I would prefer the code to be readable. I
>>> particularly like YUI's code. Does anyone have any more applications/
>>> examples? Thanks .
>> Look at any of the big libraries - jQuery, Prototype, YUI, etc.
>> What kinds of things are you trying to learn from the code/style?
>>
>> Matt Kruse
>
> I gather the OP likes reading applications written for YUI, rather
> than the YUI code itself.

How do you read "I particularly like YUI's code" and interpret it as "I
like applications written for YUI"? Sounds more like the OP is looking
for libraries to view/review and that puts Matt's questions dead in line
with being proper and right.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Back to top
David Mark

External


Since: Jul 08, 2007
Posts: 80



(Msg. 5) Posted: Thu Jul 26, 2007 5:55 pm
Post subject: Re: Great Examples of JavaScript code
Archived from groups: per prev. post (more info?)

"Randy Webb" <HikksNotAtHome DeleteThis @aol.com> wrote in message
news:eIidnW_Zp9VWbjXbRVn_vw@telcove.net...
> David Mark said the following on 7/26/2007 2:27 PM:
>> On Jul 26, 2:01 pm, Matt Kruse <m... DeleteThis @mattkruse.com> wrote:
>>> On Jul 26, 12:55 pm, Jang <jangc... DeleteThis @gmail.com> wrote:
>>>
>>>> Does anyone have an example of well written JavaScript applications
>>>> that they know about? I would prefer the code to be readable. I
>>>> particularly like YUI's code. Does anyone have any more applications/
>>>> examples? Thanks .
>>> Look at any of the big libraries - jQuery, Prototype, YUI, etc.
>>> What kinds of things are you trying to learn from the code/style?
>>>
>>> Matt Kruse
>>
>> I gather the OP likes reading applications written for YUI, rather
>> than the YUI code itself.
>
> How do you read "I particularly like YUI's code" and interpret it as "I
> like applications written for YUI"? Sounds more like the OP is looking

YUI is clearly not an application.

> for libraries to view/review and that puts Matt's questions dead in line
> with being proper and right.
>

Even if it was. I wouldn't recommend reading the library code to how write
well-written JS applications.
Back to top
Matt Kruse

External


Since: Jun 15, 2007
Posts: 7



(Msg. 6) Posted: Thu Jul 26, 2007 6:01 pm
Post subject: Re: Great Examples of JavaScript code
Archived from groups: per prev. post (more info?)

On Jul 26, 12:55 pm, Jang <jangc....DeleteThis@gmail.com> wrote:
> Does anyone have an example of well written JavaScript applications
> that they know about? I would prefer the code to be readable. I
> particularly like YUI's code. Does anyone have any more applications/
> examples? Thanks .

Look at any of the big libraries - jQuery, Prototype, YUI, etc.
What kinds of things are you trying to learn from the code/style?

Matt Kruse
Back to top
David Mark

External


Since: Aug 06, 2007
Posts: 358



(Msg. 7) Posted: Sat Jul 28, 2007 1:57 am
Post subject: Re: Great Examples of JavaScript code
Archived from groups: per prev. post (more info?)

On Jul 28, 4:32 am, Randy Webb <HikksNotAtH... RemoveThis @aol.com> wrote:
> David Mark said the following on 7/26/2007 4:57 PM:
>
> > On Jul 26, 3:19 pm, Randy Webb <HikksNotAtH... RemoveThis @aol.com> wrote:
> > [snip]
>
> > Oops. Previous response cut short by real world distraction. Now
> > back to the surreal world this thread has become.
>
> I have no reason to doubt that....
>
> >> How do you read "I particularly like YUI's code" and interpret it as "I
> >> like applications written for YUI"? Sounds more like the OP is
>
> > You are quoting out of context.
>
> I quoted directly what the OP wrote and what you wrote as a response to
> that, how that it is "out of context" is elusive at best.

You quoted one sentence out of a context that gives further indication
of its meaning. What is elusive about that concept?

>
> > The OP asked for examples of "well written JavaScript applications"
> > and specifically ones that were "readable."
>
> Yes, as anyone that reads the original post will be aware of.

I assume you didn't read it or you would never have posted your
question about my thought process.

>
> > YUI is not an application, not well-written and, from what I have
> > seen of it, unreadable.
>
> Nobody said it was. They didn't even come close to implying it.

But, again, if you understood the original post, you wouldn't have
been confused about by response. The OP was clearly not talking about
the code inside YUI as YUI is none of the things he expressed
admiration for. Get it now?

>
> > In contrast, libraries like YUI claim to enable application developers
> > to write concise, readable code.
>
> Most libraries make that false claim, one that I have never believed.

Nobody sane person would believe it. That is beside the point.

>
> > Furthermore, it is hardly a stretch to call a YUI application "YUI
> > code." It is in the same vein as "MFC code."
>
> The OP did not say "YUI Code", the OP wrote "YUI's code" and YUI's is
> possessive and implies the code in YUI itself, not code written to work
> with YUI. And hence my question as to how you got from one to the other.

This isn't a forum for inquiries about my thought process. The OP got
his answers and is apparently not in need of further assistance.

Don't you have a FAQ to work on?
Back to top
Randy Webb

External


Since: Aug 24, 2004
Posts: 4981



(Msg. 8) Posted: Sat Jul 28, 2007 4:32 am
Post subject: Re: Great Examples of JavaScript code
Archived from groups: per prev. post (more info?)

David Mark said the following on 7/26/2007 4:57 PM:
> On Jul 26, 3:19 pm, Randy Webb <HikksNotAtH... RemoveThis @aol.com> wrote:
> [snip]
>
> Oops. Previous response cut short by real world distraction. Now
> back to the surreal world this thread has become.

I have no reason to doubt that....

>> How do you read "I particularly like YUI's code" and interpret it as "I
>> like applications written for YUI"? Sounds more like the OP is
>
> You are quoting out of context.

I quoted directly what the OP wrote and what you wrote as a response to
that, how that it is "out of context" is elusive at best.

> The OP asked for examples of "well written JavaScript applications"
> and specifically ones that were "readable."

Yes, as anyone that reads the original post will be aware of.

> YUI is not an application, not well-written and, from what I have
> seen of it, unreadable.

Nobody said it was. They didn't even come close to implying it.

> In contrast, libraries like YUI claim to enable application developers
> to write concise, readable code.

Most libraries make that false claim, one that I have never believed.

> Furthermore, it is hardly a stretch to call a YUI application "YUI
> code." It is in the same vein as "MFC code."

The OP did not say "YUI Code", the OP wrote "YUI's code" and YUI's is
possessive and implies the code in YUI itself, not code written to work
with YUI. And hence my question as to how you got from one to the other.

> If you follow this link, you will see that "YUI code" is used to
> describe code written for YUI as often as it is to describe the
> actual library code.

Again, the OP did not say "YUI Code", he said "YUI's code". Small but
very distinct difference.

> http://www.google.com/search?sourceid=navclient&ie=UTF-8&rls=GGLD,GGLD...05-18,G
>
> Clear?

What is clear is that you didn't understand my question, nor the impact
of YUI's versus YUI.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Back to top
Randy Webb

External


Since: Aug 24, 2004
Posts: 4981



(Msg. 9) Posted: Sat Jul 28, 2007 7:50 am
Post subject: Re: Great Examples of JavaScript code
Archived from groups: per prev. post (more info?)

David Mark said the following on 7/28/2007 4:57 AM:
> On Jul 28, 4:32 am, Randy Webb <HikksNotAtH....DeleteThis@aol.com> wrote:
>> David Mark said the following on 7/26/2007 4:57 PM:
>>
>>> On Jul 26, 3:19 pm, Randy Webb <HikksNotAtH....DeleteThis@aol.com> wrote:
>>> [snip]

<snip>

>>> Furthermore, it is hardly a stretch to call a YUI application "YUI
>>> code." It is in the same vein as "MFC code."
>> The OP did not say "YUI Code", the OP wrote "YUI's code" and YUI's is
>> possessive and implies the code in YUI itself, not code written to work
>> with YUI. And hence my question as to how you got from one to the other.
>
> This isn't a forum for inquiries about my thought process.

Nothing about your "thought process" has any sense to it anyway. But,
your inability to realize the difference between "YUI Code" and "YUI's
code" - even after it is pointed out to you - speaks volumes about your
mental processes.

> The OP got his answers

If he did, then it came from Matt Kruse as nothing else has been posted
to answer that question.

> and is apparently not in need of further assistance.

Or can't find his way back to this group.
Or is on vacation and can't post back yet.
Your assumptions are amusing sometimes.

P.S. YGCIB
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Back to top
David Mark

External


Since: Aug 06, 2007
Posts: 358



(Msg. 10) Posted: Sun Jul 29, 2007 1:50 pm
Post subject: Re: Great Examples of JavaScript code
Archived from groups: per prev. post (more info?)

On Jul 29, 3:25 pm, Peter Michaux <petermich....DeleteThis@gmail.com> wrote:
> On Jul 26, 1:57 pm, David Mark <dmark.cins....DeleteThis@gmail.com> wrote:
>
> > YUI is not an application,
>
> Agreed
>
> > not well-written
>
> What have you seen that you don't like?

Browser sniffing for one. And I recall that it is the most bloated JS
library out there. I have a lot of experience writing cross-browser
widgets and I don't see why that library has to be so heavy.

>
> > and, from
> > what I have seen of it, unreadable.
>
> It takes some time but I think it is pretty readable. The fact that
> the API is quite well documented at least gives the reader the sense
> of how the pieces fit together before analyzing the details.

I haven't read the documentation, but I spent some time looking at its
code. As I recall, it seemed needlessly complex. I have seen a lot
of YUI apps that cause errors, but I don't know who was to blame for
those. Perhaps the authors didn't read the documentation either.
Back to top
Peter Michaux

External


Since: Jun 01, 2007
Posts: 122



(Msg. 11) Posted: Sun Jul 29, 2007 7:16 pm
Post subject: Re: Great Examples of JavaScript code
Archived from groups: per prev. post (more info?)

On Jul 26, 10:55 am, Jang <jangc....DeleteThis@gmail.com> wrote:
> Does anyone have an example of well written JavaScript applications
> that they know about? I would prefer the code to be readable. I
> particularly like YUI's code. Does anyone have any more applications/
> examples? Thanks .

Hi Jang,

If you are interested in OOP application design, I recommend reading
books on design patterns.

The classic book is "Design Patterns" by Gamma, Helm, Johnson,
Vlissides and this is a book worth having on your desk.

Before I studied that book I read "Head First Design Patterns" by
Freeman, Freeman, Bates, Sierra which is really just a reformatting
and possibly more accessible version of the Gamma et al. book.

A more direct answer to your question may be to read the Model-View-
Controller chapter of "Essential ActionScript 2.0" by Moock.
ActionScript is only a small step away from JavaScript and they are
both ECMAScript implementations (each with some extensions). I think
Moock's chapter on MVC is the best description I've read about using
MVC in the browser. There is now a new edition of Moock's book called
"Essential ActionScript 3.0" which I haven't seen yet. I've done quite
a bit of experimentation with Moock's framework in JavaScript and it
works well. If you want more info about my experimentations let me
know.

Peter
Back to top
Peter Michaux

External


Since: Jun 01, 2007
Posts: 122



(Msg. 12) Posted: Sun Jul 29, 2007 7:25 pm
Post subject: Re: Great Examples of JavaScript code
Archived from groups: per prev. post (more info?)

On Jul 26, 1:57 pm, David Mark <dmark.cins... DeleteThis @gmail.com> wrote:
> YUI is not an application,

Agreed

> not well-written

What have you seen that you don't like?

> and, from
> what I have seen of it, unreadable.

It takes some time but I think it is pretty readable. The fact that
the API is quite well documented at least gives the reader the sense
of how the pieces fit together before analyzing the details.

Peter
Back to top
Andreas M.

External


Since: Oct 15, 2007
Posts: 1



(Msg. 13) Posted: Mon Oct 15, 2007 12:26 am
Post subject: Re: Great Examples of JavaScript code
Archived from groups: per prev. post (more info?)

Also make sure to read these:

http://javascript.crockford.com/

He (Douglas Crockford) is one of the main architects behind YUI!.

--
Andreas M.
Back to top
Peter Michaux

External


Since: Jun 01, 2007
Posts: 122



(Msg. 14) Posted: Mon Oct 15, 2007 3:07 am
Post subject: Re: Great Examples of JavaScript code
Archived from groups: per prev. post (more info?)

On Oct 14, 3:26 pm, "Andreas M." <foo....TakeThisOut@invalid.invalid> wrote:
> Also make sure to read these:
>
> http://javascript.crockford.com/
>
> He (Douglas Crockford) is one of the main architects behind YUI!.

I know he works at Yahoo! but is he intimately involved in the design
of YUI? I have not seen any evidence that is true. For example, The
YUI style of JavaScript OOP does not seem inline with the types of
JavaScript OOP Crockford promotes.

Peter
Back to top
Randy Webb

External


Since: Aug 24, 2004
Posts: 4981



(Msg. 15) Posted: Mon Oct 15, 2007 4:27 pm
Post subject: Re: Great Examples of JavaScript code
Archived from groups: per prev. post (more info?)

Peter Michaux said the following on 10/15/2007 1:11 AM:
> On Oct 14, 3:26 pm, "Andreas M." <foo....DeleteThis@invalid.invalid> wrote:
>> Also make sure to read these:
>>
>> http://javascript.crockford.com/
>>
>> He (Douglas Crockford) is one of the main architects behind YUI!.
>
> I know he works at Yahoo! but is he intimately involved in the design
> of YUI? I have not seen any evidence that is true. For example, The
> YUI style of JavaScript OOP does not seem inline with the types of
> JavaScript OOP Crockford promotes.

Try running the YUI libraries through JSLint.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Back to top
Display posts from previous:   
       Webmaster Forums (Home) -> Javascript
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum