SitePoint Sponsor

User Tag List

Page 3 of 4 FirstFirst 1234 LastLast
Results 51 to 75 of 87
  1. #51
    SitePoint Member
    Join Date
    Mar 2006
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ezku
    This I have trouble understanding. Who says objects aren't "accessible" and on what grounds does he base the argument on?
    Sorry for not elaborating on that statement. There are of course a lot of reasons why PHP has been a popular (most used if I'm not mistaken) choice among webdevs:

    • It was specifically written for web development (way back when )
    • It's relatively easy to install / set up
    • It's fast (me thinks)

    Amongst the other 200+ reasons is that it was based on procedural (correct term? still confused about the other 200 paradigms) code. At least, that's what I think. I'm not saying this perfect Web Language should cater to everyone, but if we/you/Harry want this language to get (as) popular as PHP is, I'm not sure "objects all the way" would get as big a following as PHP did. Okay, that's implying getting a big user base would actually be a goal, which it might just aswell not be. Hmmz

    That said, Ruby does it fine in not shoving objects down your throat.
    Agreed, so it can be done.

  2. #52
    SitePoint Addict
    Join Date
    Jan 2005
    Location
    Ireland
    Posts
    349
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by XoloX
    Okay, that's implying getting a big user base would actually be a goal, which it might just aswell not be. Hmmz
    A big user-base would of course be a goal. With out a big user base it would not be:

    • Accepted by the business world.
    • Be designed for the programming community general in question
    • Supported by multiple-platforms, webservers, etc.


    And the list goes on. There is no point in having a perfect web language without the support for it to flourish.

  3. #53
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ren
    Isn't that....
    PHP Code:
    class SomeObj
    {
        public 
    $AA 42;
    }
    $o = new SomeObj();
    echo 
    $o->{'A' 'A'}; 
    ?
    Of course it is (cannot believe I missed this )
    However, it's still limited (e.g. $o::{'A' . 'A'} isn't possible)

  4. #54
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by XoloX
    I'm not saying this perfect Web Language should cater to everyone, but if we/you/Harry want this language to get (as) popular as PHP is, I'm not sure "objects all the way" would get as big a following as PHP did.
    Javascript is an example of language which is purely object oriented (even more OO than ruby) but still popular (actually more popular than PHP). I fail to see any correlation between popularity and OOP.

    Okay, that's implying getting a big user base would actually be a goal, which it might just aswell not be
    The only goal of any developer is perfection. nothing less, nothing more.

  5. #55
    SitePoint Guru
    Join Date
    May 2005
    Location
    Finland
    Posts
    608
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here are some things I came up with:
    • A modern object model in the fashion of Ruby
    • Functional programming (take Javascript for a good example): closures, callbacks, event listeners
    • Easy configuration (at least somewhat) native to the language: YAML for instance (is JSON good enough?)
    • Native support for XML, for both input and output. XSL transformations!

    Quote Originally Posted by stereofrog
    Javascript is an example of language which is purely object oriented (even more OO than ruby) but still popular (actually more popular than PHP). I fail to see any correlation between popularity and OOP.
    Indeed. Not many understand OO in Javascript, though. Ruby and Javascript are nevertheless languages I look at for guidance.

  6. #56
    SitePoint Guru BerislavLopac's Avatar
    Join Date
    Sep 2004
    Location
    Zagreb, Croatia
    Posts
    830
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ezku
    Here are some things I came up with:
    • A modern object model in the fashion of Ruby
    • Functional programming (take Javascript for a good example): closures, callbacks, event listeners
    • Easy configuration (at least somewhat) native to the language: YAML for instance (is JSON good enough?)
    • Native support for XML, for both input and output. XSL transformations!
    Basically, that's Javascript...

  7. #57
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by BerislavLopac
    Basically, that's Javascript...
    I like the functions-first design of javascript, but I don't think it's everybodys cup of tee. But perhaps JS2.0, which introduce classes. This would naturally have to lead to a model, where methods are bound to the object instances, in contrast to the looser prototype-approach of JS1.X. I can't say I'm excited about that, but it would make the language more accessible.

    Quote Originally Posted by Ezku
    • Easy configuration (at least somewhat) native to the language: YAML for instance (is JSON good enough?)
    • Native support for XML, for both input and output. XSL transformations!
    e4x ?

  8. #58
    SitePoint Addict mx2k's Avatar
    Join Date
    Jan 2005
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    there is serverside javascript, but to what extent on how good it is, i'm clueless SSJS

  9. #59
    SitePoint Guru BerislavLopac's Avatar
    Join Date
    Sep 2004
    Location
    Zagreb, Croatia
    Posts
    830
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by kyberfabrikken
    But perhaps JS2.0, which introduce classes. This would naturally have to lead to a model, where methods are bound to the object instances, in contrast to the looser prototype-approach of JS1.X.
    I'm not really sure what you mean by this. How are methods not bound to object instances in prototype based Javascript?

    Also, there is mod_js by the wxJS project, which I haven't tried yet.

  10. #60
    SitePoint Addict
    Join Date
    Jan 2005
    Location
    Ireland
    Posts
    349
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by BerislavLopac
    I'm not really sure what you mean by this. How are methods not bound to object instances in prototype based Javascript?
    I don't know what he means, but if I had to guess I would think he meant that a method is not bound to object instances of any class. Because you have prototypes, you can put a method into any object instance at runtime, without the modification of the class for which the instance originated. Of course, that is a guess, and even if that is the meaning, I still don't get his point.

  11. #61
    SitePoint Addict mx2k's Avatar
    Join Date
    Jan 2005
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by RyanWray
    I still don't get his point.
    i believe this is a thread for intriguing pointless discussion, so basically an episode of seinfeld for the web.

  12. #62
    SitePoint Addict
    Join Date
    Jan 2005
    Location
    Ireland
    Posts
    349
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Looking at wxJS and more specifically the mod_wxjs, it looks like it has a long way to go before being useful in development. I also don't like how there is a headers_out property in the HttpRequest class (nitpicking! Also, why headers_out rather then headersOut, following the scheme of the rest of the properties). Another thing that would probably bug me is the wx prefix to the names of general classes, for instance, wxFile.

    What I do like about the project that is it relatively new and clean and if thought out cleary it could turn into a very useful langauge. One important thing though is JS needs to get packages (or some sort of namespace support). At least then we can avoid many of PHP's problems.

  13. #63
    SitePoint Addict mx2k's Avatar
    Join Date
    Jan 2005
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ryan Wray
    Looking at wxJS and more specifically the mod_wxjs, it looks like it has a long way to go before being useful in development. I also don't like how there is a headers_out property in the HttpRequest class (nitpicking! Also, why headers_out rather then headersOut, following the scheme of the rest of the properties). Another thing that would probably bug me is the wx prefix to the names of general classes, for instance, wxFile.

    What I do like about the project that is it relatively new and clean and if thought out cleary it could turn into a very useful langauge. One important thing though is JS needs to get packages (or some sort of namespace support). At least then we can avoid many of PHP's problems.

    i noticed what some are doing with objects in javascript as far as having their own namespace is something like following, keep in mind i'm using the prototype library and this example is for a lazy loaded class

    Code:
    var vivus = Class.create();
    
    vivus = {
          initialize:  function() {
               this.version = "0.1.0.0"
          }
    }
    var Vivus = new vivus();
    
    /* underscore for classes that are loaded by default */
    Vivus._Images = Class.create();
    Vivus._Images.prototype = {
            initialize: function() { 
                 /* logic here */
             },
            add: function() { 
                 /* logic here */
             },
             preload: function (){ 
                 /* logic here */
             }
    }
    
    Vivus.Images = new Vivus._Images();
    
    Vivus.Images.add('images/btn.png', 'images/btnOv.png');
    
    Vivus.Images.RollOver = Class.create();
    Vivus.Images.RollOver.prototype = {
                initialize: function(img, imgOv, imgDn, imgSel) { 
                 /* logic here */
             }, /* more methods*/
    }
    
    var someRollover = new Vivus.Images.RollOver('images/btn.png', 'images/btnOv.png', 'images/btnDn.png', 'images/btnSel.png');

  14. #64
    SitePoint Addict
    Join Date
    Jan 2005
    Location
    Ireland
    Posts
    349
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It also appears that wxJS is Windows only, though it really shouldn't be, considering most of it's components (SpiderMonkey, wxWidgets, expat) are cross-platform. A bit disappointing.

  15. #65
    SitePoint Addict
    Join Date
    Jan 2005
    Location
    Ireland
    Posts
    349
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mx2k
    i noticed what some are doing with objects in javascript as far as having their own namespace is something like following, keep in mind i'm using the prototype library and this example is for a lazy loaded class

    Code:
    var vivus = Class.create();
    
    vivus = {
          initialize:  function() {
               this.version = "0.1.0.0"
          }
    }
    var Vivus = new vivus();
    
    /* underscore for classes that are loaded by default */
    Vivus._Images = Class.create();
    Vivus._Images.prototype = {
            initialize: function() { 
                 /* logic here */
             },
            add: function() { 
                 /* logic here */
             },
             preload: function (){ 
                 /* logic here */
             }
    }
    
    Vivus.Images = new Vivus._Images();
    
    Vivus.Images.add('images/btn.png', 'images/btnOv.png');
    
    Vivus.Images.RollOver = Class.create();
    Vivus.Images.RollOver.prototype = {
                initialize: function(img, imgOv, imgDn, imgSel) { 
                 /* logic here */
             }, /* more methods*/
    }
    
    var someRollover = new Vivus.Images.RollOver('images/btn.png', 'images/btnOv.png', 'images/btnDn.png', 'images/btnSel.png');

    Interesting. That is the great thing with JavaScript, there is alot of flexibility to pull off alot of functionality. All the same, a standard EMCAScript defined way of doing this would be much better.

  16. #66
    SitePoint Addict mx2k's Avatar
    Join Date
    Jan 2005
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ryan Wray
    Interesting. That is the great thing with JavaScript, there is alot of flexibility to pull off alot of functionality. All the same, a standard EMCAScript defined way of doing this would be much better.
    yes, i agree, but we must use what we have today and in the mean dream big and start building for tomorrow.

  17. #67
    SitePoint Guru BerislavLopac's Avatar
    Join Date
    Sep 2004
    Location
    Zagreb, Croatia
    Posts
    830
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ryan Wray
    I don't know what he means, but if I had to guess I would think he meant that a method is not bound to object instances of any class. Because you have prototypes, you can put a method into any object instance at runtime, without the modification of the class for which the instance originated. Of course, that is a guess, and even if that is the meaning, I still don't get his point.


    Anyway, if I understood what both of you said, he meant that methods are not bound to any class. Which is perfectly alright -- people often forget that OOP is all about objects, and not about classes. Classes are just an clean way to implement objects, easily understandable by a "traditional" (i.e. C) developer, being essentially structs with methods. Prototypes are a completely different approach to OOP, which has its own advantages and disadvantages, but it keeps most of the abilities of class-based OOP. There's quite a lot about that at www.crockford.com/javascript/.

  18. #68
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ryan Wray
    I don't know what he means, but if I had to guess I would think he meant that a method is not bound to object instances of any class. Because you have prototypes, you can put a method into any object instance at runtime, without the modification of the class for which the instance originated. Of course, that is a guess, and even if that is the meaning, I still don't get his point.
    Not intirely sure what I meant either - just pretend I didn't say that in the first place

  19. #69
    SitePoint Guru
    Join Date
    May 2005
    Location
    Finland
    Posts
    608
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ryan Wray
    I don't know what he means, but if I had to guess I would think he meant that a method is not bound to object instances of any class. Because you have prototypes, you can put a method into any object instance at runtime, without the modification of the class for which the instance originated.
    Hmm. Now that I think of it, Ruby has this as well. It's still a more traditional design, though, with proper classes et al. I guess the line between prototype and class based languages isn't as clear as I thought.

  20. #70
    SitePoint Guru BerislavLopac's Avatar
    Join Date
    Sep 2004
    Location
    Zagreb, Croatia
    Posts
    830
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ezku
    Hmm. Now that I think of it, Ruby has this as well. It's still a more traditional design, though, with proper classes et al. I guess the line between prototype and class based languages isn't as clear as I thought.
    Yep, that's pretty similar to mixins in Ruby, I gather. Guess no need for Dependency Injection here.

  21. #71
    SitePoint Guru
    Join Date
    May 2005
    Location
    Finland
    Posts
    608
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by BerislavLopac
    Yep, that's pretty similar to mixins in Ruby, I gather. Guess no need for Dependency Injection here.
    Not quite. Indeed, "mixins" can be achieved in Javascript merely by copying the properties of a prototype to another; however, this was not what was meant, but instead the fact that you can do
    Code:
    object.property = function() {
       do something entirely else;
    }
    at any given time to any given object. It's related, but no the same thing, mind you. In Ruby, this is achieved with
    Code:
    o = some object
    def o.property
       do something entirely else
    end
    Furthermore, there is need for Dependency Injection in Ruby.

  22. #72
    SitePoint Guru BerislavLopac's Avatar
    Join Date
    Sep 2004
    Location
    Zagreb, Croatia
    Posts
    830
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Then I misunderstood Ruby mixins. Care for a pointer where I could learn more?

  23. #73
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just to break this "php-ruby-javascript" vicious circle, groovy and especially io look (at least syntactically) very promising.

  24. #74
    SitePoint Addict
    Join Date
    Jan 2005
    Location
    Ireland
    Posts
    349
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by stereofrog
    Just to break this "php-ruby-javascript" vicious circle, groovy and especially io look (at least syntactically) very promising.
    Throw Jython in the mix to keep things interesting. This is very similar to Groovy, just your working with the Python language. Is Python syntax (or the language itself) not favourable to web development?

    As for the io language, looks interesting. I don't like the :=, but I can get over that.

  25. #75
    SitePoint Guru
    Join Date
    May 2005
    Location
    Finland
    Posts
    608
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ryan Wray
    Interesting. That is the great thing with JavaScript, there is alot of flexibility to pull off alot of functionality. All the same, a standard EMCAScript defined way of doing this would be much better.
    The only thing he seems to be using Prototype for is the constructor method "initialize". A plain JS solution wouldn't differ that much.
    Quote Originally Posted by BerislavLopac
    Then I misunderstood Ruby mixins. Care for a pointer where I could learn more?
    You've probably read it already, and if not - you should: modules in Programming Ruby.
    Quote Originally Posted by stereofrog
    Just to break this "php-ruby-javascript" vicious circle, groovy and especially io look (at least syntactically) very promising.
    Hello world
    Code:
    "Hello world!" print
    Implement a singleton
    Code:
    Foo := Object clone
    Foo clone := Foo
    Uh. Looks like programming in io would require some serious reorientation.

    I've ran into Groovy before, and it does indeed look nice. It compiles to Java bytecode, and seems like a pleasant mix of Ruby and Java in terms of syntax and features. They even have Groovy on Rails.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •