Discussions

News: Object Oriented JavaScript Demonstrated

  1. Object Oriented JavaScript Demonstrated (13 messages)

    Scripting languages don't usually lend themselves to easy use of object-oriented concepts, but author Stoyan Stefanov offers an extensive tutorial in how to combine JavaScript with object-oriented concepts to get the benefits of object-oriented programming while creating complex scripts. Read article

    Threaded Messages (13)

  2. Object Oriented[ Go to top ]

    Either Stoyan Stefanov has no clue what object oriented is or the article is misstated. There is nothing object oriented in that article, other than the use of a typeof operator. You should definitely change the title to "Introduction to basic javascript for 12 year olds".
  3. Re: Object Oriented[ Go to top ]

    Sorry, I guess I didn't realize that this is a first chapter of a book. Guess the use of the world chapter throughout the post. Either way, the title should be changed to reflect that it's the first chapter of the book and has nothing to do with OO. Ilya
  4. Re: Object Oriented[ Go to top ]

    Got to admit, the snow flake is pretty cool
  5. Jeez, if this is an excerpt from a book as a way to promote the book... Well you should have chosen a chapter that talks about OO IN JavaScript! Come on... Aren't there enough "basic-as-basic-can-be" introductions to JavaScript? If this is a good book, you've definitely picked that absolutely worst chapter to demonstrate that. Jeez.
  6. Have to admit that didn't read the book but the only known to me OO in JavaScript is GWT from Google. Why even try to bother with something else?
  7. Because there is a world outside of GWT.
  8. Of course there is... but that word is very cumbersome in the JavaScript area. So far GWT is the best way to avoid JavaScript nightmare and still be able to run under any JS engine.
  9. I'm not sure everyone thinks javascript is a nightmare though:-) I must say, it definitely lacks many modern language features, but it's also very simple and flexible. The biggest downside is the lack of reusable facilities, which GWT covers very well. I'm not arguing against GWT. I love GWT, not as much as Flex, but it definitely has its place. Ilya
  10. @ALL-Overly-Knowledgeable: Yes, because WE! already know java script why other people should write books, teach or even learn it? We, very knowledgeable people and wise already know much better than that and everyone else is uneducated.
  11. The Good Parts[ Go to top ]

    I think Douglas Crockford sums it all up extremely well in JavaScript: The Good Parts - http://www.amazon.com/JavaScript-Good-Parts-Douglas-Crockford/dp/0596517742. Or, the short-short version: http://javascript.crockford.com/javascript.html Hopefully, Mr Stefanov will add to this knowledge rather that reiterate it.
  12. Scripting languages don't usually lend themselves to easy use of object-oriented concepts
    Who came up with that idiotic statement? Scripting languages don't lend themselves to OO? Huh? There is a world outside of JavaScript and the C shell where scripting languages like Ruby (for the sake of it, not that I like it), Groovy, Python and others demonstrate perfectly valid object orientation in a scripting language....
  13. Scripting languages don't usually lend themselves to easy use of object-oriented concepts


    Who came up with that idiotic statement? Scripting languages don't lend themselves to OO? Huh? There is a world outside of JavaScript and the C shell where scripting languages like Ruby (for the sake of it, not that I like it), Groovy, Python and others demonstrate perfectly valid object orientation in a scripting language....
    The funny thing even is that Javascript has decent OO base mechanisms, it is missing the high level patterns like inheritance. The biggest issue with it simply is that it exposes the low level mechanisms (the prototype function map) which is similar to the vtable in C++ compilations, but lacks the high level stuff like inheritance and namespaces (I omit classes here, javascript has class like constructs) But saying scripting languages don't usually lend themselves to easy use of object-oriented is absolutely bull... Smalltalk sort of the grandfather of most OO languages (yes I know Simula was earlier) basically could be described as a scripting language after modern criteria, and languages like groovy and ruby or python which borrow heavily from Smalltalk are definitely OO. Javascript with the proper libraries like the Dojo toolkit also is on the easy to apply oo side of things (although core javascript is not)
  14. Javascript OO != Dojo[ Go to top ]

    Javascript does make inheritance availalbe, it's prototypical inheritance instead of class inheritance. But it works very well, even if it's not like java. Dojo is more of a UI library that works with the DOM rather than javascript (it uses javascript to interact with the DOM). Prototype and JQuery are more script libraries while DOJO, YUI, and ExtJS are DOM libraries. They javascript driven, but their big value add is what they do to the DOM rather than the way you work with javascript. OO is easy in javascript without any libraries.