In reading above (sorry for the C++ ref!) it read as if you recommended a PHP student should learn C or Pascal as a primer to understanding PHP as a "good programmer". Such an assertion is questionable. Not in fact, but in reality - who needs C to learn PHP? Is the time invested worth the benefit?BDKR wrote:If you haven't been programming long, then the last thing you need to do is jump into OO. Especially if this (PHP) is your first language. In order to be a truly good programmer, you need to understand some foundation stuff. Algorithms, data structures, memory allocation, etc.... It's possible to take the OO route right now and still be a good programmer, but you'll allways be at a loss when you start to consider issues relating to low level 'under-the-hood' operations and how they effect high level scripting languages like PHP.
One option would be to take both routes. Learn C or Pascal. Not C++ or Object Pascal. Do some research on algorithms and data structures and try to pay attention to some of the conversation on the PHP internals list. The more you chew, the more you understand.
Yeah its not ideal, but life's not perfect and somehow we manage to wing it... Theory is essential for progressing towards professional programming - but we left the "save every byte" days behind a decade or more ago. Most PHP developers today only require a basic understanding of typical PHP optimisation tips. There are far more important areas to study - like business modelling, useability, design patterns and all that other bozo rubbish...BDKR wrote:I don't feel it's good for individuals that really want to learn how to program to do so without an understanding of how their code is affecting the machine. On the other hand, if all you're concerened about is building web sites and apps for bozos in suits so they can get their reports faster, go right on ahead don't worry about what I'm saying.
That wasn't exact memory allocation I was referring to. I had thought BDKR was aiming a little lower with the C/Pascal refs. Memory management as a function of good design in a higher level language is important - but does not require a major in C. How hard can it be to equate big script with big memory? Overly simplistic - but in many cases the shoe doth fit...AKA Panama Jack wrote:By reducing the memory overhead you also increase execution speed in most cases. There is a form of memory allocation when programming in PHP. It's called efficient programming and not throwing code at a problem.
I keep thinking of the people who argue the benefits of double quotes vs single quotes for strings. Yay, we saved a whole microsecond...
13 years little man. Cower before my inflated ego in terror...Lets not compare the size of our keyboards, gentlemen. Keep it clean.
In conclusion to this interminable ramble of mine. Without saying you're wrong (not that stupid) your original response gave the impression that being a good programmer in PHP required C. Its entirely within the realm of possibility you meant no such thing - but I shot my cannon across your bow to point out its useful but hardly required. Knowing how to squeeze those bytes isn't really all that useful to a PHP programmer. PHP has its own body of optimisation tips that work for Joe Bloggs who think "C? Is that like C++?"