5 ms·
From my own experience, developers, particularly inexperienced developers, when learning something new have an insatiable need to implement their new found know
by xd 14y ago
From my own experience, developers, particularly inexperienced developers, when learning something new have an insatiable need to implement their new found knowledge .. no matter if it's a good fit or not for the problem at hand (myself included .. I remember abusing the hell out of recursion for example).
One of the worst examples I've seen is the functional programming paradigm being crowbarred out of PHP .. why.
- mootothemax 14y agoOne of the worst examples I've seen is the functional programming paradigm being crowbarred out of PHP .. why. Most likely related to the Innter-platform effect: ...the tendency of software architects to create a system so customizable as to become a replica, and often a poor replica, of the software development platform they are using. http://en.wikipedia.org/wiki/Inner-platform_effect http://en.wikipedia.org/wiki/Inner-platform_effect One of the classic PHP examples being the Smarty templating system: Smarty has been criticized for replicating features that PHP does natively very well, which leads to inefficiency: http://en.wikipedia.org/wiki/Smarty http://en.wikipedia.org/wiki/Smarty
- billpatrianakos 14y agoGetting functional programming from PHP and Smarty are two very different things. I don't know how people shoehorning PHP into the functional paradigm is an example of the inner platform effect. I could see where it fits with Smarty but in defense of pretty much all PHP templating engines, they really are helpful despite mimicking native functionality. If you work with someone who is a front-end only person they'll appreciate being able to get up and running with Smarty quickly as its similar to templating languages for most other languages and you'll be happy not to have straight up PHP code in your HTML. Granted, the PHP does what the Smarty tags do but the cleanliness of the code really does make a noticeable difference and Skarty tags are far easier to pick out than PHP tags within HTML. So it really isn't all about the functionality there which is why I think your argument is weak.
- anthonyb 14y agoHey bill - looks like you've been hellbanned. Something that you said on http://news.ycombinator.com/item?id=4213223 http://news.ycombinator.com/item?id=4213223 ticked someone off. Maybe talk to info@ycombinator.com and get it sorted out. PHP still sucks though ;)
- debacle 14y agoThe implementation of higher-order functions in PHP has saved me hundreds if not thousands of lines of code, and that's only in the last six months. It's not perfect, but it's better than what we had before.
- xd 14y agoIf you're talking about PHP's anonymous functions then yes I agree they have made life a lot easier. I was talking more about projects like Swiftmailer for instance, example: // Create a message $message = Swift_Message::newInstance('Wonderful Subject') ->setFrom(array('john@doe.com' => 'John Doe')) ->setTo(array('receiver@domain.org', 'other@domain.org' => 'A name')) ->setBody('Here is the message itself') ;
- debacle 14y agoThat's called a 'fluent interface.' It's useful in some instances, and is a bit different than currying because PHP doesn't really support proper currying.
- napillo 14y agoI think good developers do it also. I'll give a somewhat related example from my own life. My second wife spoke Italian. I learned Italian, so when I visited I could go to shops, order coffee and food, etc - however she spoke English very well. As a result, I learned to understand Italian, but never to speak it. My third wife speaks Russian. I learned Russian, so we could talk to each other. She speaks no English. As a result, I learned not only to understand Russian, but also to speak it. I feel that it's the same with new technology / design patterns. You have to use it to really understand it. Sure, you should choose the best fit for it, but really you don't know until you try it and fail. P.S. Yes, I know I've been married too many times.