SitePoint Sponsor

User Tag List

Page 4 of 5 FirstFirst 12345 LastLast
Results 76 to 100 of 113
  1. #76
    SitePoint Guru mwolfe's Avatar
    Join Date
    Mar 2005
    Posts
    912
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Precisely. I have worked on software designed by professionals for professionals, not by amatuers for amateurs. Case sensitivity in software did not exist until UNIX was spewed forth, and that was only because those bungling amateurs did not know what they were doing.
    Shouldn't you be posting on a microsoft website or something?

  2. #77
    SitePoint Evangelist
    Join Date
    Mar 2005
    Posts
    423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what is an opcode cache, and how will it benefit me?

  3. #78
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by skinny monkey
    what is an opcode cache, and how will it benefit me?
    opcode is the step between reading your PHP file, and doing something with it. If you can store opcode between requests, then you can get to the "do something" bit faster.

    Basically

    Douglas
    Hello World

  4. #79
    SitePoint Addict n0other's Avatar
    Join Date
    Feb 2005
    Posts
    290
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As far as I understand, PHP firstly compiles the source into what is called opcodes, the opcode is not a machine code, it's code to be executed by the PHP vm. Normaly, everything goes through same procedure over and over: compile, execute, but if opcodes are cached, compilation can be avoided unless necessary (the source has changed since last compilation), resulting in speeding script execution up to 20 times. This is basicaly what TurckMM Cache does, just that it will be implemented in PHP by default, with no need of additional extensions?

  5. #80
    eschew sesquipedalians silver trophy sweatje's Avatar
    Join Date
    Jun 2003
    Location
    Iowa, USA
    Posts
    3,749
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by skinny monkey
    what is an opcode cache, and how will it benefit me?
    Here is a link to various "after market" opcode caches.
    http://www.php.net/links.php#accelerators
    Jason Sweat ZCE - jsweat_php@yahoo.com
    Book: PHP Patterns
    Good Stuff: SimpleTest PHPUnit FireFox ADOdb YUI
    Detestable (adjective): software that isn't testable.

  6. #81
    SitePoint Wizard dreamscape's Avatar
    Join Date
    Aug 2005
    Posts
    1,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by n0other
    As far as I understand, PHP firstly compiles the source into what is called opcodes, the opcode is not a machine code, it's code to be executed by the PHP vm. Normaly, everything goes through same procedure over and over: compile, execute, but if opcodes are cached, compilation can be avoided unless necessary (the source has changed since last compilation), resulting in speeding script execution up to 20 times. This is basicaly what TurckMM Cache does, just that it will be implemented in PHP by default, with no need of additional extensions?
    As I understand it, PHP compiles scripts twice before it executes them. Is opcode the result of the 1st pass or the 2nd pass?

  7. #82
    SitePoint Addict n0other's Avatar
    Join Date
    Feb 2005
    Posts
    290
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hm, I've never heard of it, a quick glance at google gave no results eighter. Why would it compile twice?

  8. #83
    SitePoint Wizard dreamscape's Avatar
    Join Date
    Aug 2005
    Posts
    1,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by n0other
    Hm, I've never heard of it, a quick glance at google gave no results eighter. Why would it compile twice?
    Did some more research, and I guess compile twice is a bad way to say it. After PHP reads the script, it first makes a pass checking the syntax. This is why you get parse errors on parts of a script, even if they are not being used in the current execution. Then it makes a 2nd pass and translates the source to the intermediate code for the interpreter.

    So this would be the opcode then I guess, which nullifies my question.

    I notice PHP refers to it as "opcode" whereas several accelerators and encoders refer to is as "bytecode". Is there a difference between these 2, other than in name?

  9. #84
    SitePoint Guru
    Join Date
    May 2005
    Location
    Finland
    Posts
    608
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mgkimsal
    Coupla points
    Very good ones, too.

  10. #85
    SitePoint Addict n0other's Avatar
    Join Date
    Feb 2005
    Posts
    290
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Read this http://en.wikipedia.org/wiki/Opcode . I guess people refer to the same thing by both terms when talknig about PHP (and possibly some other interpreted languages).

  11. #86
    SitePoint Addict mgkimsal's Avatar
    Join Date
    Sep 1999
    Posts
    209
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ezku
    Very good ones, too.
    Hey thanks.

    One more that I wanted to get out there (I'd put this on phpweblogs.com some time ago, but this is a wider audience - maybe someone influential will pick up on this).

    I've come across a number of people who love the __get and __set stuff in PHP5, but it seems fairly useless to me because it only lets you override access to *non-declared* object properties. The *only* thing I've ever seen it used for are the examples of putting "special" properties into one "private" array (great example, doesn't do much in the real world, imo).

    http://us2.php.net/manual/en/languag...verloading.php has a comment indicating that accessing a defined private property when __get and __set are defined will now invoke them, but that's in PHP5.1.

    The biggest problem I had with this was that it's only *half* the job. You have a choice:

    1. Do cool things with __get and __set to allow useful functionality to be added when code accesses your properties
    or
    2. Document your class properly by defining the properties with public/protected/private.

    #2 gets you readable code which can be easily understood and even parsed by tools like the Zend IDE and phpdoc.
    #1 gets you nifty/useful functionality.

    Example:

    PHP Code:
        <?
        
    class foo {
           public 
    $n;
         
           public function 
    __get($name) {
               echo 
    "Getting $name<br/>\n";
           }
        
           public function 
    __set($name$val) {
               echo 
    "Setting $name to $val<br/>\n";
           }
        
        }
        
        
    $foo = new foo;
        
    $foo->11;
        
    $foo->100;
        echo 
    $foo->a;
        echo 
    $foo->n;
        
    ?>
    Output is
    Setting a to 100<br/>
    Getting a<br/>
    11
    The "n" property is defined but accessing it never calls the __set or __get methods. So, readable code or useful functionality - seems you can't have both.
    Michael Kimsal
    =============================
    groovymag.com - for groovy/grails developers
    jsmag.com - for javascript developers

  12. #87
    Afraid I can't do that Dave Hal9k's Avatar
    Join Date
    Mar 2004
    Location
    East Anglia, England.
    Posts
    640
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Tony Marston
    Wrong! Programs are designed to to read by humans but executed by computers.
    I am well aware of how high level programming languages use ifs and elses etc to make it easier for the human; to remove them from the complexities of assembly and machine code.

    I understand why someone would challenge what I said, but really the only point I wanted to make was that your slippery slope reasoning is flawed:

    Quote Originally Posted by Tony Marston
    Case does not change the meaning of a word in any spoken or written language, so there is no justification for doing so in a programming language.
    English is a language specifically revolving around allowing humans to communicate with each other, programming languages were designed to make it a little easier and remove low level language complexities, so you can't really compare the structures of the two. I just meant programming languages weren't designed explicitly to help humans communicate with each other. See my comment as:

    Quote Originally Posted by Hal9k
    Programming languages weren't designed to be _/read/_ by humans.
    if you want. It's not like you'd read a programming language like a book or play, for example.

    Quote Originally Posted by Edman
    It is the difference between "I helped my uncle Jack off a horse" and "I helped my uncle jack off a horse".
    And there's something that can be said for that too.

    Anyway, sorry for taking the thread a little off topic...

  13. #88
    SitePoint Wizard DougBTX's Avatar
    Join Date
    Nov 2001
    Location
    Bath, UK
    Posts
    2,498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Hal9k
    Programming languages weren't designed to be _/read/_ by humans.
    But they are, that's why programmers care about readability. If it wasn't meant to be read, you would just write $var1, $var2, $var3 etc. For the same reason that mixing $account and $ACCOUNT, whether they represent the same variable or not, is bad.

    Doulgas
    Hello World

  14. #89
    SitePoint Guru mwolfe's Avatar
    Join Date
    Mar 2005
    Posts
    912
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think its safe to say that programming languages were designed (and continue being designed) with importance on readability for both humans and computers. A programming language designed for humans only would be pseudo-code. A programming language for computers only would be machine code.

    There are reasons for programming languages to be case sensitive or not, and it all comes from preference. Many people think its better practice, and it helps enforce standards. If you fail to program with any kind of coding standards, we all know you'll end up with one ugly program that is much more dificult to debug. Some languages like to enforce that, others think it should be up to the users.
    Another point is that its easier and faster to parse, whether by a compiler or an interpreter, if the language enforces consistent case.

  15. #90
    SitePoint Zealot
    Join Date
    Oct 2004
    Location
    naperville
    Posts
    189
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Precisely. I have worked on software designed by professionals for professionals, not by amatuers for amateurs. Case sensitivity in software did not exist until UNIX was spewed forth, and that was only because those bungling amateurs did not know what they were doing.
    Wasn't nix pre-windows?

    Anyways, there is an interesting reaction here. What it comes down to, in my mind, is PHP needs to be taking steps towards enterprise level. Version five took steps in that direction, but, it's not quite there. Examine what 6 would have to offer:
    -An OPCode Cache, FINALLY
    -Unicode; possibly the singular most important for a multilingual app. Don't even pretend PHP's multilingual support, as it stands, is currently anything but poor.
    -Clean up functions and such (although, I wish they would just completely kill BC and standardize the library somehow)
    -Remove magic quotes - this makes life easier for us, at least.
    -Namespaces, maybe

    The major complaint here is, its to soon. Well, we want major code upgrades but not a version change? That doesn't make sense. Unicode + OpCode + BC Break is as much of a reason as 4->5 did, if not more.

    You want an enterprise platform? Heres some major steps towards it.

  16. #91
    SitePoint Addict pointbeing's Avatar
    Join Date
    Jun 2004
    Location
    London, UK
    Posts
    227
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Tony Marston
    Case does not change the meaning of a word in any spoken or written language
    Spoken languages don't have case, obviously, so the comparison is meaningless.

    Moreover, you mean don't see a difference between 'god' and 'God' in English? In German 'schuld' and 'Schuld' mean entirely different things.

    But what has this to do with computer programming in the first place? I don't see the relevance.

  17. #92
    SitePoint Enthusiast
    Join Date
    Jul 2003
    Location
    New York
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I was crazy enough to read php.internals and the only reason they want case sensitivity is for speed increases. If it can assume the case is the same, then the script will run faster. I generally don't care though. I use php functions all in lowercase and camelcase my own stuff so I have no need for case-insensitivity when it comes to that. If it makes php do its thing faster, then so be it.
    viveHosting.com
    Affordable Hosting, Reliable Service

  18. #93
    SitePoint Enthusiast
    Join Date
    Jun 2004
    Location
    Williamsport, PA
    Posts
    87
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    To the PHP Developement Team: SETTLE DOWN!

    In the interest of beating a dead horse, I'd like to say that regardless of what features PHP 6 might have, it's release is completely irrevelent to my daily workflow, and I'd surmise that the same applies to most of you. I have little to no control over the environment in which any of my sites are hosted; is it safe to say that the same applies to you as well?

    Even if I can connect to the server via ssh or whatever means, hoping for the ability to install or update software is a big pipe dream. And it's silly to think that hosts will jump to PHP 6 when most still haven't gone to PHP 5!

    I love PHP as much as the next guy, don't get me wrong; and I would adopt PHP 6 in a heartbeat if I could. PHP now has all the features of Java that I fell in love with years ago, but with the flexibility of the PHP language.

    But I'm not giving it another thought until I can code PHP and not give thought to backward compatibility.

  19. #94
    SitePoint Member
    Join Date
    Aug 2005
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    a couple of things - does anybody know if PHP 5.5/6 will implement Multiple Inheritence into their Object Oriented implemenation? When I saw the improvements that they made to their OOP implementation in php5, I was in awe, and immediately began making sites OOP style
    Of course I'm more or less trained in C++, and recognize a dilema in the software community: Web designers are often not trained in computer sciences as other types of programmers would be, and computer science types (C++ and Java type people) often know little about web development....I think the ultimate web developer lies in the middle, and I am trying to be that type of designer. With that said, I've been having a blast with 5.0's OOP implementation, and am looking forward to it improving even more - it seemed like the PHP makers were trying to make it into more of a "real" language, that is, more in line with other programming languages, and I think they've done well so far, with 5.0.

  20. #95
    SitePoint Addict
    Join Date
    Apr 2002
    Posts
    281
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    personally I wouldn't use different case for a variable, I would choose a name with certain case and after the declaration I would use the same case through-out. Regardless if the language allows different case or not.

    Also reading through someone's code and seeing that he or she has done this, I would yell at them right away because it defeats coding practices.

    usually all letters in uppercase to me looks like a constant so I'd be confused if I read a program written like this.

  21. #96
    SitePoint Zealot ShytKicka's Avatar
    Join Date
    Aug 2004
    Location
    New York
    Posts
    120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This doesn't seem to have too many features for a major release. If anything, this should be either 5.5 or 5.1, but 6.0 is extremely stretching it.

  22. #97
    Non-Member coo_t2's Avatar
    Join Date
    Feb 2003
    Location
    Dog Street
    Posts
    1,819
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Edman

    [snip]

    It is the difference between "I helped my uncle Jack off a horse" and "I helped my uncle jack off a horse".
    rep++

  23. #98
    SitePoint Addict
    Join Date
    May 2005
    Posts
    255
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by dreamscape
    >> It's the same reason why XML is case sensitive.

    What? XML is neither compiled nor is it a programming language, nor does it use any processing power on its own. XML is just a mark-up language.
    A markup language that is intended to be *processed by applications*.

    Also, programming languages are meant for humans. Computers have no use for the constructs that we do. That's why they read machine code. If programming languages weren't meant for humans, we'd just write binary for everything.

  24. #99
    SitePoint Enthusiast
    Join Date
    Apr 2005
    Posts
    45
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Hope For The Best

    Maybe php6 will evolve into something faster. ASP.NET is relying on conpiled code. That way, a .aspx page is an actual app rather than a script. This time, Microsoft got this one right.

  25. #100
    SitePoint Enthusiast
    Join Date
    Jul 2003
    Location
    New York
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's not too soon for PHP6 "DISCUSSION". They are only discussing it... it won't be out for a good year and php5 has been out for about a year itself... that's 2 years.
    viveHosting.com
    Affordable Hosting, Reliable Service


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
  •