yea, it's quite amazing when I read js pattern, especially chapter 3, the below
format writing a class is very useful, and it make me understand js more better.
var Book = ({
//private static attributes
var **
//private static method
function**(){}
//return the constructor
return function(){
//private attributes
var .**
//privileged method
this.**= function(){}
//constructor code
}
})()
//public static method
Book.** = function(){}
//public ,non-priviledged method
Book.prototype.** = function(){}
On Jan 17, 2011, at 3:59 AM, Derek Watson wrote:
> I am really enjoying this thread about js books. I found Oreilly's
> Javascript Patterns to be quite useful, though not as much so as this
> list. Has anyone else read Javascript Patterns and would you mind
> sharing your opinions about it?
>
> D
>
> On Sun, Jan 16, 2011 at 2:02 PM, Garrett Smith <[email protected]> wrote:
>> On 1/16/11, SteveYoungGoogle <[email protected]> wrote:
>>> On Jan 16, 4:15 am, Garrett Smith <[email protected]> wrote:
>>>
>>>> Specs, implementations, implementation docs (MDC, MSDN), and
>>>> programming books are too. But not javascript books; I don't know of
>>>> any that are good enough to recommend. And so I continue to recommend
>>>> against reading books on javascript.
>>>
>>> That's a bit over the top isn't it, banning books is usually though of
>>> as a bad thing Ok you're not saying ban books but recommending against
>>> reading them is almost the same thing. My personal opinion, for what
>>> its worth, is that there are some JavaScript books worth reading if
>>> you don't take every word as gospel. I personally have found David
>>> Flanagan's "JavaScript The Definitive Guide" and Douglas Crockford's
>>> "JavaScript: The Good Parts"
>>
>> And I recommend against reading the good parts for reasons given in
>> threads on c.l.js. The definitive guide had some good parts in it but
>> had a number of mistakes and seemed strangely organized. Online
>> resources have several advantages over books.
>>
>> Interactive discussions have an even greater advantage in that anybody
>> can point out mistakes about anything. I've written a couple of wrong
>> things already on this group. Specifically, I recall being corrected
>> by kangax, Dalton, and Balazs (dunno how to put the accent on the
>> "a"). GOod thing I didn't publish those in a book!
>>>
>>>> A question isn't necessarily an attack, nor is it necessarily an
>>>> admission of ignorance.
>>>
>>> I'm sorry, but I really don't see where this is coming from. I can't
>>> remember saying or implying that a question might be an attack or an
>>> admission of ignorance
>>>
>>
>> It is a conceptual derivation from your observation of newbies getting
>> "roasted". It's not right to read too much into questions.
>>
>>>
>>> Ditto. I am wondering why you think you have to explain something so
>>> obvious to me.
>>>
>> I think I agree with you and elaborating on my own views. Just my .02.
>> --
>> Garrett
>>
>> --
>> To view archived discussions from the original JSMentors Mailman list:
>> http://www.mail-archive.com/[email protected]/
>>
>> To search via a non-Google archive, visit here:
>> http://www.mail-archive.com/[email protected]/
>>
>> To unsubscribe from this group, send email to
>> [email protected]
>>
>
> --
> To view archived discussions from the original JSMentors Mailman list:
> http://www.mail-archive.com/[email protected]/
>
> To search via a non-Google archive, visit here:
> http://www.mail-archive.com/[email protected]/
>
> To unsubscribe from this group, send email to
> [email protected]
--
To view archived discussions from the original JSMentors Mailman list:
http://www.mail-archive.com/[email protected]/
To search via a non-Google archive, visit here:
http://www.mail-archive.com/[email protected]/
To unsubscribe from this group, send email to
[email protected]