5 ms·
> "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 par
by 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.
- catch23 17y agoTechnically speaking, Java can have mixins as well if you include libraries that provide it. Stuff like Spring AOP uses aspectj under the covers and you can mimic mixin-like functionality in your classes with a few annotations here and there.
- strlen 17y agoTechnically, you could also provide mixins through the decorator pattern and interfaces. IntelliJ (and I am sure Eclipse) can generate this for me. However, that's less elegant and more fragile than using a language (e.g. Scala) which has Mixins as a language feature: IntelliJ can write code for me, but it can't read for me, nor can it explain it to other developers. Likewise, I can use multiple inheritance in C++ exclusively only to mimic interfaces (as purely virtual classes) or Mixins (and in fact a lot of corporate style guidelines, e.g. Google's explicitly say that), but it isn't quite the same as having these as language features.
- encoderer 17y agoMixins can be as double-edged as operator overloading. Doesn't mean I don't love me some operator overloading in C# when the mood strikes, but neither are features that in anyway approach KISS principles nor are they essential. As for everything else, PHP can hang. I actually particularly like their implementation of closures. I know people fretted about NS but that is all much ado about nothing. Millions of keystrokes wasted complaining about which single keystroke is used as a NS delimiter. If you must do some PHP and you've come from Python, Ruby, Scala, etc, do check out the Flow3 framework. You'll feel closest to home.