4 ms·
Do serious PHP developers use PHP's built-in template language? Yahoo and Facebook don't. PHP is also not tuned to some fitness function; it tunes its users.
by jrockway 17y ago
Do serious PHP developers use PHP's built-in template language? Yahoo and Facebook don't.
PHP is also not tuned to some fitness function; it tunes its users. In exchange for not having to understand abstraction or OO, you get to learn the wierd quirks of thousands of inconsistently-named functions that live in a shared global environment. Sure, the number of "concepts" you have to know is low (no closures, no MOP, no lexical scope, ...), but the number of inane details you have to know is high. PHP shows that people would rather understand the exact details of arguments to a function instead of understanding abstraction and metaprogramming. (Similarly, people like to cram for exams without really understand the subject matter.)
That is fine, but unless you are "people in general", you are missing out on a lot by "choosing" PHP.
(Deployment is always a big issue. Do you really want to market your app to people that can't even run a package manager, "cpan" or equivalent, and so on? I find Perl perfectly easy to deploy. If I can't "apt-get install" the app, I type "cpan AppName", wait a while, and my app works.
Additionally, users that find deployment too hard unless it's "untar this and click pictures" are going to require a lot of support but aren't going to contribute a lot of code back to you. So maybe this isn't the best optimization to make.
Finally, why not JSP for this? Startup Tomcat, edit code in a web page, and boom, your "app" works. It ain't pretty, but it's better than PHP. Tomcat is no harder to setup than Apache + mod_php either.)
- philfreo 17y ago> "PHP shows that people would rather understand the exact details of arguments to a function instead of..." I disagree. While yes, the function names and parameters are not always consistent and easy to remember, the point is they don't have to be, because it takes very little time to type "php.net/thefunctionorclosetoit" into a browser and quickly reference whatever you need. Add a smart IDE that gives parameter hinting into the mix and you don't even need to do that most of the time.
- jrockway 17y agoThis is where the term "code monkey" came from.
- didip 17y agoWhile php.net is a great reference tool, jrockway opinion still stands. By using PHP, the developer is missing out many abstraction patterns that make life easier.
- wvenable 17y agoWhat abstractions patterns would the average PHP developer missing out on? You can throw a rock in any direction and hit a PHP framework. Throw a second rock and you'll get one with an entirely different philosophy. Yes, PHP is a simple language but in many ways that's a virtue not a curse. Jrockway is right about PHP's inconsistency but that doesn't exclude one from building solid software in the language.
- dasil003 17y agoClosures, namespaces, objects, mixins, meta-programming, etc. Yes I realize PHP has made strides in some of those areas, but its mostly too little too late.
- wvenable 17y agoNone of those features are necessary (or even desirable) for building large scale software. Very few languages have that full set including C++, C, and Java.
- strlen 17y agoFirst, C++ has MI (which can be used as mixins, although they also give you enough power to shoot yourself in the foot if you so choose) and namespaces. Namespaces and mixins are vital for building large scale software projects. C++ also allows generic programming (via templates). Java has interfaces and namespaces. Both C++ and Java have static typing, which is a tool for building certain kinds of large scale software projects (dynamic typing -- combined with an actual type system -- as in Python, Ruby or Lisp -- is another tool). Lastly, Java (as well as PHP) are garbage collector. C and C++ don't -- yet many large scale software projects were created without a garbagage collector. Does this mean that you don't gain a lot of power from a garbage collector? C++ and Java are not examples of powerful programming languages either. You don't use them because they're the most powerful and elegant programming languages. Typically, they're used out of HR considerations ("it's easy to hire Java programmers"), performance requirements (C++ is fast; properly tuned JVM can be at most 10% behind C for applications which don't require a large heap) or libraries (although availability of other languages on the JVM overrules that argument as well in many cases). Hate to be blunt, but you're speaking as a Blub Programmer. Sure, you can get things done in PHP (or in Java, or in C++) but there are languages out there with a greater amount of power that you willingly neglect. That's sad.
- wvenable 17y ago> Do serious PHP developers use PHP's built-in template language? No. However, my template engine compiles to PHP's built-in template language. > In exchange for not having to understand abstraction or OO My PHP code is just as object-oriented as my C++, Java, or C# code. As for the functions, you memorize what you need and have a good IDE for the rest. One of the benefits of PHP is that there's a function for just about every common task and using them is really easy. Other languages may have the same functionality in a library, but the setup and calling is far more complicated. PHP is a get-things-done language and it always has been. You can dick around with all the abstractions, frameworks, and meta-programming you want but often that's just more complicated and a waste of time.
- wvenable 17y agoSo I've been voted down for having an opinion -- way to be open minded hacker news.
- strlen 17y agoI think your close minded attitude ("I don't want to learn anything outside of my comfort zone, as it isn't clear whether it will get me from point A to point B") and vulgarity ("dick around") is what got you the down votes.
- wvenable 17y agoGiven that I already stated a wide range of skills beyond PHP (and I use more languages than I even listed there) I hardly think my closed minded attitude is the problem. There are a lot of complaints about PHP from people who've never even used it. They have bullet-point list of features lacking or strangeness and think they can make an informed comment. But I have built several large scale projects in PHP and at the time I started them most everyone's pet language here was too immature in the web space to consider. Look at Ruby, the tools of choice for deploying it and serving it up are constantly changing. I don't have time for that fire and motion. Maybe for the next project I will choose something else. But I think developers here would rather fawn over the pet language of the week than hear from someone using PHP effectively.