SitePoint Sponsor

User Tag List

Page 2 of 3 FirstFirst 123 LastLast
Results 26 to 50 of 52
  1. #26
    Wanna-be Apple nut silver trophy M. Johansson's Avatar
    Join Date
    Sep 2000
    Location
    Halmstad, Sweden
    Posts
    7,400
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by trickie
    Not that i'm a guru or anything, but i seem to think that a lot of the discussion against PHP being a good PHP development environment is about concepts that are very rarely used or isn't even a requirement to write good OOP code.

    From my experience good OOP is constrained and developed by the Developer and not the language used. Do you now what i mean?

    .NET won't clean my room, but it is a tool that can be used to develop good OOP, it just depends on the developer.

    PHP won't clean my room either, but it is a tool that can be used to develop good OOP, it just depends on the developer.

    I know i repeated myself, but i just wanted to iterate that in the case of the high-level languages talked about in this thread, they are all just tools. If you are creative you can can develop GOOD OOP with any of them.

    By the way i don't want to dis anyone, cause i'm still struggling to understand the OOP way!
    It's true that PHP and .NET are just tools, jsut like any other language, and they could probably achieve the same things. A whiz-bang god-like programmer could probably whack up an enterprise application using QBasic, but the rest of us appriceate the help of good environments to help us develop stuff. I claim that .NET will save you lots of time compared to PHP - the features .NET offers really does help. You have to write a lot of extra stuff to achieve the same functionality of .NET when you are using PHP.

    And yes, "advanced" OOP concepts (such as interfaces) can definetly be used with great benefit in Web Applications. While web apps are rarely advanced enough to benefit from OO directly, web apps are often very similar to each other, meaning that you can benefit from reusing code from other projects.
    Mattias Johansson
    Short, Swedish, Web Developer

    Buttons and Dog Tags with your custom design:
    FatStatement.com

  2. #27
    SitePoint Enthusiast
    Join Date
    Apr 2002
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I claim that .NET will save you lots of time compared to PHP - the features .NET offers really does help. You have to write a lot of extra stuff to achieve the same functionality of .NET when you are using PHP.
    I'm just curious now. Can you elaborate on those features I'd have to write a lot of extra PHP code for?

  3. #28
    Wanna-be Apple nut silver trophy M. Johansson's Avatar
    Join Date
    Sep 2000
    Location
    Halmstad, Sweden
    Posts
    7,400
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by daholygoat

    I'm just curious now. Can you elaborate on those features I'd have to write a lot of extra PHP code for?
    Why, certainly! Check out my post in this thread:
    http://www.sitepointforums.com/showt...263#post616263

    All that is "Language Candy", of course, but will save you busloads of time.
    Mattias Johansson
    Short, Swedish, Web Developer

    Buttons and Dog Tags with your custom design:
    FatStatement.com

  4. #29
    SitePoint Enthusiast
    Join Date
    Apr 2002
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, interesting. I can see how that could have advantages. But not enough to make me switch

  5. #30
    SitePoint Evangelist
    Join Date
    Oct 2001
    Posts
    592
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why, certainly! Check out my post in this thread:
    http://www.sitepointforums.com/show...6263#post616263
    I must say I'm impressed by what you can do with .NET, but your examples don't count. You know that, don't you?

    As Harry has pointed out so often, you're showing off the library that comes with the language, not the language itself. It is true that such a great library is lacking from PHP (don't get me started on PEAR again), but that doesn't make your point valid: you can do exactly the same with PHP, if a proper library was there. No changes have to be made to PHP at all, and the language itself is perfectly capable of doing what you're doing with .NET. If only the library were written...

    Vincent

  6. #31
    SitePoint Wizard gold trophysilver trophy
    Join Date
    Nov 2000
    Location
    Switzerland
    Posts
    2,479
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Vincent is spot on - that link is simply a demo of ASP.NET's templating.

    My hands are tied from posting links to my own site, as Sitepoint has a rule about self promotion. But if someone were to do there and search for DOM, you'll find an article which is the foundations for reproducing the ASP.NET template system in PHP.

    In fact it's possible to use ASP.NET templates with PHP - all you need to do is parse their templates exactly the same way as you'd parse any template. As to "binding" to "code behind" (.NET speak) we're actually talking about placing markers in the template which say which class to load. To implement the .NET "controls" you could either use PHP's DOM extension (although that ties you to XHTML - well formed XML) or use one of many many alternatives e.g.;

    http://phphtmllib.newsblob.com/
    http://webcomp.sourceforge.net/

    And in fact, what the .NET controls do really isn't that impressive - that article I'm not allowed to talk about shows you how easy it can be to implement your own. No doubt PEAR will have something similar soon - they basically already did an equivalent to Java's Swing with PHP-GTK.
    Last edited by HarryF; Dec 3, 2002 at 15:46.

  7. #32
    Wanna-be Apple nut silver trophy M. Johansson's Avatar
    Join Date
    Sep 2000
    Location
    Halmstad, Sweden
    Posts
    7,400
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by voostind
    I must say I'm impressed by what you can do with .NET, but your examples don't count. You know that, don't you?

    As Harry has pointed out so often, you're showing off the library that comes with the language, not the language itself. It is true that such a great library is lacking from PHP (don't get me started on PEAR again), but that doesn't make your point valid: you can do exactly the same with PHP, if a proper library was there. No changes have to be made to PHP at all, and the language itself is perfectly capable of doing what you're doing with .NET. If only the library were written...
    Dammit - I thought I'd get away with that.

    Seriously, though, I just brought it up more as a demo of how "language candy" can save you time. Whether the candy (library) is in PHP or .NET.

    As for C# vs. PHP and the like - I'm not experienced enough to write extensive and good examples of how advanced OO can be sleeker and more efficient than "faking" it in in PHP, but I'm pretty bloody sure it can be done - I simply have a VERY hard time to believe that all those OO features that Java, C++ and C# has respectively are so useless.
    Mattias Johansson
    Short, Swedish, Web Developer

    Buttons and Dog Tags with your custom design:
    FatStatement.com

  8. #33
    SitePoint Addict
    Join Date
    Feb 2001
    Posts
    302
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by voostind
    Neither Java nor .NET support multiple inheritance. You said it yourself (more or less): 'multiple inheritance in the form of interfaces'. But that's not multiple inheritance. Not even close.

    The C++ you can write with .NET is called 'Managed C++'. It's C++ without (among others) multiple inheritance.

    Please do not believe Sun or Microsoft when they tell you 'interfaces are just as powerful as multiple inheritance', because it isn't true.
    As you noted I never stated .NET or JAVA support multiple inheritence, nor did I state that I believe interfaces are as powerful as multiple inheritence, perhaps I should of made it clearer PHP doesn't even give you the option of interfaces let alone multiple inhertience.

    I don't believe everything Sun or Microsoft tell me, as a company I trust microsoft about as far as I can throw Bill Gates and Sun are only mildly more trustworthy, likewise I don't believe everything Zend tell me either.

    Originally posted by voostind
    And if I'm not mistaken, operator overloading is not supported by .NET. It certainly isn't supported by Java...
    [/B]
    No Java doesn't support operator overloading but others do, as for .net you are mistaken C# supports operator overloading.

    Originally posted by voostind
    So what remains are static members, I guess. Tell me, how often do you use static members? I only do OO, and I almost never need them. But maybe that's just me.
    [/B]
    I use static members sometimes, the fact I don't use static members as much as I use some other features does not mean they are a waste of space, either way many people find them very useful.

    Originally posted by voostind
    Oh, another thing: PHP doesn't use handles. True, but neither does C++.
    [/B]
    Yes, but given the amount of complaints by people about the speed of PHP when it comes to objects, the ineffiecent way PHP deals with objects is relevent.

  9. #34
    SitePoint Addict
    Join Date
    Feb 2001
    Posts
    302
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by HarryF

    $this is like the "this" keyword in Java. Personally I like it as well - makes it easy to see what's happening where and so on.
    Yes but in Java I am given the option.

    Anyway yes the proposed changes in Zend 2 do look like a big improvement and will solve a good many of PHP's OOP shortcomings, however people have been banging on about Zend 2 for a long time now and yet we are still 10 or so months away from it's release, until then I can only judge PHP OO features on it's current implementation, which for me and many others is just not up to standard, hopefully next autumn Zend 2 will be released and it will be a pleasant suprise for me.

  10. #35
    Wanna-be Apple nut silver trophy M. Johansson's Avatar
    Join Date
    Sep 2000
    Location
    Halmstad, Sweden
    Posts
    7,400
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hmmmm...

    PHP:
    PHP Code:
    $TextDiv=$doc->get_element_by_id('TextDiv');
    $TextDiv->set_attribute('color','#99CCFF'); 
    C#:
    Code:
    TextDiv.Color = "#99CCFF";
    This could be remedied by writing even more PHP code, but then controls STILL wouldn't maintain state, handle events, or adjust themselves depending on the client browser. You would also miss out on the fact that form combo boxes and the like can accept lots of different data sources, such as arrays or datasets from database queries.

    Those problems could all be solved by writing even more PHP code and even more and more, but I'm not sure what such reinventing of the wheel would really prove, when you could just use an existing solution.
    Last edited by M. Johansson; Dec 3, 2002 at 16:35.
    Mattias Johansson
    Short, Swedish, Web Developer

    Buttons and Dog Tags with your custom design:
    FatStatement.com

  11. #36
    Super Ninja Monkey Travis's Avatar
    Join Date
    Dec 2001
    Location
    Sioux City, Iowa
    Posts
    691
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    TextDiv.Color = "#99CCFF"; seems to be the equivalent of TextDiv::Color = '#99CCFF'; but you should never access a class variable directly so that is why $TextDiv->set_attribute('color', '#99CCFF'); is used.
    Travis Watkins - Hyperactive Coder
    My Blog: Realist Anew
    Projects: Alacarte - Gnome Menu Editor

  12. #37
    ********* wombat firepages's Avatar
    Join Date
    Jul 2000
    Location
    Perth Australia
    Posts
    1,717
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by M. Johansson
    but I'm not sure what such reinventing of the wheel would really prove, when you could just use an existing solution.
    ....assuming you are on win32 , which 75% of us are not for whatever reason.

    You also assume that PHP coders just sit there writng forms or echo ... echo .... echo .... (ex PERL heads it must be said DO sit there all day with print .... print .... print ....) or whatever all day !, in fact I think a lot of ex PERl/ASP heads assume that the limitations they are used to have to apply to PHP when of course they don't.

    In fact it would be re-inventing the wheel for me anyway, I have eg my own form generator (badly) written in PHP that can build a full administration form (add/edit/delete) or straight input form , it grabs data from a db table )or tables) and displays the fields for me to add any HTML I wish to the form, allows me to link other tables for dropdown selects or use my own arrays etc, then punch 'go' and I have a ready to use no-stress-for server form complete with SQL/validation etc, literally a 5 minute job to build administration routines for DB table(s) of any size.

    The alternative you would have us use is to parse & rebuild the page from scratch on each and every view (yes I know it gets cached/compiled) , why would I do that ? , even in PHP , there is no point unless I am a sadist to my server.

    Thats a 'works for me' solution of course and not much use to later developers who appear to get a handwritten page but thats a different argument.

  13. #38
    FreeBSD The Power to Serve silver trophy pippo's Avatar
    Join Date
    Jul 2001
    Location
    Italy
    Posts
    4,514
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Trav,
    I have the suspect that what M.J. wrote is not as accessing "a class variable directly",
    but instead he is using something called "properties".
    It's something like:

    Code:
    public string Color 
        {
          get
          {
            return color;
          }
          set
          {
            color = value;
          }
        }
    so as you can see you could use them as methods....

    I never used C#,
    but M.J. could be more precise than me



    pippo
    Last edited by pippo; Dec 4, 2002 at 00:22.
    Mr Andrea
    Former Hosting Team Advisor
    Former Advisor of '03

  14. #39
    Wanna-be Apple nut silver trophy M. Johansson's Avatar
    Join Date
    Sep 2000
    Location
    Halmstad, Sweden
    Posts
    7,400
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by pippo
    Trav,
    I have the suspect that what M.J. wrote is not as accessing "a class variable directly",
    but instead he is using something called "properties".
    It's something like:

    Code:
    public string Color 
        {
          get
          {
            return color;
          }
          set
          {
            color = value;
          }
        }
    so as you can see you could use them as methods....

    I never used C#,
    but M.J. could be more precise than me



    pippo
    You are completely correct, pippo. I am using the get/set feature of C#. This is a very useful little feature, that I think it's pathetic that PHP doesn't support yet (5.0?) - geeez - even Visual Basic (urk) can do that one.
    Mattias Johansson
    Short, Swedish, Web Developer

    Buttons and Dog Tags with your custom design:
    FatStatement.com

  15. #40
    Wanna-be Apple nut silver trophy M. Johansson's Avatar
    Join Date
    Sep 2000
    Location
    Halmstad, Sweden
    Posts
    7,400
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by firepages
    ....assuming you are on win32 , which 75% of us are not for whatever reason.
    If you must use *nix for some reason, then you can use JSP with Jakarta Struts, from which Microsoft got the Web Forms idea in the first place. You are still reinventing the wheel.

    You also assume that PHP coders just sit there writng forms or echo ... echo .... echo .... (ex PERL heads it must be said DO sit there all day with print .... print .... print ....) or whatever all day !, in fact I think a lot of ex PERl/ASP heads assume that the limitations they are used to have to apply to PHP when of course they don't.
    Most PHP/ASP.old beginners will indeed do this for the first year or so (I know I did), before they learn the power of templating. This will not be the case with ASP.NET beginners (if there are such things), since they get it right from the start.

    In fact it would be re-inventing the wheel for me anyway, I have eg my own form generator (badly) written in PHP that can build a full administration form (add/edit/delete) or straight input form , it grabs data from a db table )or tables) and displays the fields for me to add any HTML I wish to the form, allows me to link other tables for dropdown selects or use my own arrays etc, then punch 'go' and I have a ready to use no-stress-for server form complete with SQL/validation etc, literally a 5 minute job to build administration routines for DB table(s) of any size.
    So it wouldn't be reinventing the wheel for you, since you have already (badly) reinvented it?

    The alternative you would have us use is to parse & rebuild the page from scratch on each and every view (yes I know it gets cached/compiled) , why would I do that ? , even in PHP , there is no point unless I am a sadist to my server.
    You'd do it because it is an extremely elegant solution which saves you lots of time. And parsing XML is not that slow:

    From another thread:
    Originally posted by mgkimsal


    I currently am running some (... PHP ...) development code outlining the basic functionality of what I described. The parsing of a small HTML section into an object takes around 15-50 ms of time (Athlon 800mhz). This is then cached to disk, and on subsequent runs, it's about 1-2ms to retrieve it into memory, and another 2-3 to parse. I'm dealing in small scale runs currently, but it's not *slow*, ime. Certainly gives other templating engines out there a run for the money, in my limited testing and opinion (but I'm biased, of course!).

    This has been a slow work in progress, on and off, since bumping into XMLC a couple years ago.
    Mattias Johansson
    Short, Swedish, Web Developer

    Buttons and Dog Tags with your custom design:
    FatStatement.com

  16. #41
    ********* wombat firepages's Avatar
    Join Date
    Jul 2000
    Location
    Perth Australia
    Posts
    1,717
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    .....strain...

    PHP:
    $obj->color='blue';

    jeez that was hard.. hang on while I catch my breath

    ok back now,

    Why would I wanna use JSP ? even many JAVA heads think JSP is inefficient and defeats the point of design/logic seperation, of course the JVM comes into the speed equation.

    "And parsing XML is not that slow"

    well of course it is ! at least compared to a system that produces static content where possible and server overhead when required.

  17. #42
    SitePoint Addict richard_h's Avatar
    Join Date
    May 2002
    Location
    London
    Posts
    301
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is a very useful little feature, that I think it's pathetic that PHP doesn't support yet
    It strikes me that your comments are intentionally antagonistic; you obviously get lonely in your .NET forum

  18. #43
    SitePoint Evangelist
    Join Date
    Oct 2001
    Posts
    592
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You are completely correct, pippo. I am using the get/set feature of C#. This is a very useful little feature, that I think it's pathetic that PHP doesn't support yet (5.0?) - geeez - even Visual Basic (urk) can do that one
    Did you forget the smiley, or did you really mean it?

    Those get- and set-features are fairly new. One of the first languages to support it was Delphi, which is Object Pascal with some extensions. It added properties to classes, like this:

    PHP Code:
    property colorread getColor write setColor
    You still had to write a function getColor and a procedure setColor, just like you always did. In code, instead of calling them directly, you just read or write the property. Note that calling the original function/procedure is still possible as well. It's just syntactic sugar: a shorthand for not having to write a function or procedure call.

    Personally, I'm not that happy with properties. Even though technically everything is still neatly encapsulated, you cannot see in code whether a programmer is accessing a real property (and thus actually still calling some set- or get-method) or a public member variable. In an ideal world, everything is encapsulated so nobody accesses member variables directly, but as history has taught us: we don't live in an ideal world...

    PHP Code:
    $obj->color='blue'
    This is a bad example, because it is accessing a member variable directly, instead of setting a property. PHP doesn't have properties. I wouldn't mind if it did, but I don't mind that it doesn't either (for reasons I've just explained).

    And parsing XML is not that slow:
    As firepages already said: of course it is.

    XML allows for a very efficient LL(1) parser, but still the parsing itself takes a lot of time, for the simple reason of having to process every character in the input stream (the XML file) at least once. Parsing always takes time, and it's a real shame to do so if it isn't necessary.

    But I'm bordering on a dangerous subject again: templates. I still think templates are not the answer, and I think I will be proved right in a couple of years...

    Vincent

  19. #44
    Wanna-be Apple nut silver trophy M. Johansson's Avatar
    Join Date
    Sep 2000
    Location
    Halmstad, Sweden
    Posts
    7,400
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by voostind
    But I'm bordering on a dangerous subject again: templates. I still think templates are not the answer, and I think I will be proved right in a couple of years...Vincent
    As I've said earlier - time will tell. I do think the aprroach ASP.NET Web Forms have will become very popular. With the compilation and caching ASP.NET offers, I think the(minor?) performance drop will be worth it to many people. It's all about Human time vs. Computer Time.

    Personally, I think performance is rather low on any priority list when building web applications, since they are so simple and both .NET and PHP being incredibly fast.

    Did you forget the smiley, or did you really mean it?
    Mean what? That VB 6.0 has get/set?
    Mattias Johansson
    Short, Swedish, Web Developer

    Buttons and Dog Tags with your custom design:
    FatStatement.com

  20. #45
    SitePoint Wizard gold trophysilver trophy
    Join Date
    Nov 2000
    Location
    Switzerland
    Posts
    2,479
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As I've said earlier - time will tell. I do think the aprroach ASP.NET Web Forms have will become very popular
    I must whip up that PHP "parser" compatible with ASP.NET templates I've been pondering

  21. #46
    Wanna-be Apple nut silver trophy M. Johansson's Avatar
    Join Date
    Sep 2000
    Location
    Halmstad, Sweden
    Posts
    7,400
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by HarryF


    I must whip up that PHP "parser" compatible with ASP.NET templates I've been pondering
    Please do! Make sure you also code in the Repeater/DataList/DataGrid, and I'll dandily switch back to PHP.
    Mattias Johansson
    Short, Swedish, Web Developer

    Buttons and Dog Tags with your custom design:
    FatStatement.com

  22. #47
    Wanna-be Apple nut silver trophy M. Johansson's Avatar
    Join Date
    Sep 2000
    Location
    Halmstad, Sweden
    Posts
    7,400
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by richard_h

    It strikes me that your comments are intentionally antagonistic; you obviously get lonely in your .NET forum
    What can I say, I'm feisty. But it IS pretty lame that PHP doesn't have it, since it's not exactly the most complicated functionaity to implement.
    Mattias Johansson
    Short, Swedish, Web Developer

    Buttons and Dog Tags with your custom design:
    FatStatement.com

  23. #48
    ********* wombat firepages's Avatar
    Join Date
    Jul 2000
    Location
    Perth Australia
    Posts
    1,717
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Isnt there an opposite argument to the lameness of requiring web-forms ?

    I wonder how we all survived thus far

  24. #49
    Wanna-be Apple nut silver trophy M. Johansson's Avatar
    Join Date
    Sep 2000
    Location
    Halmstad, Sweden
    Posts
    7,400
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by firepages
    Isnt there an opposite argument to the lameness of requiring web-forms ?
    Huh? Who requires web forms?
    Mattias Johansson
    Short, Swedish, Web Developer

    Buttons and Dog Tags with your custom design:
    FatStatement.com

  25. #50
    SitePoint Wizard silver trophy Karl's Avatar
    Join Date
    Jul 1999
    Location
    Derbyshire, UK
    Posts
    4,411
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by M. Johansson
    You'd do it because it is an extremely elegant solution which saves you lots of time. And parsing XML is not that slow
    Oh man, I severely have to disagree with you, when compared to serving pre-cached output, rendering XML is slow, take it from someone who has extensively tried both and runs several servers - I'm well aware of the effects that redundant processing can have on a server
    Karl Austin :: Profile :: KDA Web Services Ltd.
    Business Web Hosting :: Managed Dedicated Hosting
    Call 0800 542 9764 today and ask how we can help your business grow.


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
  •