5 ms·
I find it humbling to look at these lists and see what most people do. At work we have had the occasional debate about Scala versus Clojure. I was for Clojure a
by lkrubner 13y ago
I find it humbling to look at these lists and see what most people do. At work we have had the occasional debate about Scala versus Clojure. I was for Clojure and I mostly lost (I didn't convince anyone).
Perhaps mistakenly, I thought we were arguing about one of the big issues facing the tech world right now. What is the correct way to move forward in our new, functional, multi-core world?
Then I look TIOBE. Scala is in 33rd place with a 0.326% share.
Clojure is not even listed -- it might as well not exist.
Lists like this remind me how easy it is to think that the thing you are excited about also has other people excited. But that is not necessarily the case.
I've been using PHP since early 2000, when PHP 4.0 was still in beta. For awhile I loved PHP. It was my main language for most of 10 years. But the world has changed. I find it amazing that anyone would still use PHP for a project, given the wealth of great alternatives that have sprung up.
Let's go back in time. Here is what the world looked like in the spring of 2000: I want to build a dynamic website. What should I use? I wanted to use open source so that ruled out Microsoft and ASP. I could use Perl, but Perl took assembly -- every module I could want was in CPAN but you had to know them and understand them and it was a bit of a hassle to assemble them (there was nothing quite as easy as modern package managers). Java seemed like overkill. The people who loved Java were, at that time, very focused on the enterprise and they were loudly promoting the benefits of the Struts framework (which in the end turned out to be overkill for every single type of application that anyone could ever actually want to build). And Java needed to be compiled, and there were none of the tools then that make life so much easier now. And when debugging the stack traces were fearsome. Then there was PHP. It was simple and it was all in one. No assembly required -- a huge built in library. No need to compile, just edit a text file and then hit "reload" in your browser to see the change. When debugging, the error messages were crystal clear and always told you what line, in which file, needed to be fixed.
PHP was an obvious choice then.
But things changed.
In 2004, Basecamp was launched, and the world noticed Ruby On Rails. (Bruce Eckel wrote a great essay at the time about how this effected the thinking of a certain portion of elite programmers: http://www.artima.com/weblogs/viewpost.jsp?thread=141312 http://www.artima.com/weblogs/viewpost.jsp?thread=141312 )
Starting around 2005 there was a revolution happening in the land of the Java Virtual Machine. Dozens of innovative new languages sprang up (among the ones I worked with and admire: Groovy, Scala, Clojure). The tools improved dramatically: for debugging and profiling, Java had long had the edge, and now you could use those same tools with dynamic languages that were fun to work with. Modern package managers arrived, which made it easy to assemble libraries, and greatly reduced the benefit of PHP's all-in-one approach.
Many of the new languages offer a REPL to make it easy to play with the language and assemble the code in a live environment -- this is even more interactive than the fast edit/reload cycle that made PHP seem so special in 2000.
Meanwhile, PHP was going the other direction, towards more complexity. There was clearly a desire on the part of the core PHP team to imitate aspects of Java. I now work at a company that has a large CMS built with Symfony -- this is a very large code base full of classes that have what I would think of as "classic" OOP features such as variables with limited visibility outside of the class. This is not a bad thing, but please note, PHP is now, in 2013, the only language that I work with that gives me no way to automatically create getters and setters for class variables. (Some of you will say Symfony has tools that will auto-generate these classes for me, which is true, and if you like having your code auto-generated from other sources, like YAML files, then of course this is a fine approach.)
What drew me to PHP, in 2000, was its flexibility, ease of debugging, ease of assembly (all-in-one philosophy) and the fast edit/reload cycle. It's important to note that PHP is no longer the leader of the pack in any of these dimensions. All of the same considerations that drew me to PHP in 2000 now draw me to Clojure -- its a dynamic language that does not get in my way, debugging is easy thanks to many debugging tools, assembly of parts is easy thanks to Leiningen, which is an amazing build tool, and the fast edit/reload cycle is replaced by the even better REPL experience.
What draws people to PHP now? I loved it once but I can not imagine choosing it now.
- nbouscal 13y agoGreat post, I have also thought quite a bit about the fact that the big issues I spend time considering aren't even on the radar of the majority of developers, let alone the majority of humans. To answer your question about PHP: I think you're phrasing the question in a way that makes it seem more confusing than it really is. People aren't, generally speaking, drawn to PHP. People code in PHP, and have been coding in PHP, and change is hard, and rationalizing the familiar is easy. Those people then hire other people, and train them to use PHP. I would wager that for a majority of PHP projects, there was never even a 'choose what language to use' phase in the planning. Edit: Another reason that I forgot to mention, which I've seen used several times in practice — PHP developers are replaceable. It's the same argument pointy-haired bosses have been making for using Java for a long time now.
- smacktoward 13y ago> I would wager that for a majority of PHP projects, there was never even a 'choose what language to use' phase in the planning. And if the language you know does what you want, why would there be? Most code is written for business, and in business bringing in a new language is like re-tooling a factory: an expense you take on when you have to, not something you do just because you can.
- nbouscal 13y agoThat's fine, and I don't think that using PHP for a project is necessarily a bad decision. That said, there are a lot of factors to consider. PHP developers and say, Ruby or Python developers are generally rather different types of people. You'll get a lot more exposure to new ideas and practices from the latter. Unit testing is still a 'weird new thing' in the PHP community, at least where I'm living. If you aren't even considering what language to use, you're going to miss out on a lot of potential benefits. Further, the cost is not on par with re-tooling a factory. Any competent developer can switch languages, especially between very similar languages like PHP/Python/Ruby/Perl, in a pretty quick window. Learning the tools that go along with that language does take some time, but I think that amount of time is generally overstated.