9 ms·
Clojure 1, PHP 0
- JoelSutherland 18y agoThis is pretty much incoherent. The author is really comparing Clojure to Wordpress. His concluding segment is literally called: A Brief Comparison: Clojure vs. Wordpress. Clojure is a language (dialect) and Wordpress is an application. This is worse than the common mistake of comparing a language to a framework.
- swannodette 18y agoYou can treat WordPress as a PHP based content management framework, and that is in fact what many people do. Also he is in fact using a Clojure web framework- Compojure. In anycase, contrary to what you are saying, his point is coherent.
- catch23 18y agoWell in the end, he was actually comparing compojure to wordpress, which is still wrong, but a little better. Clojure is a pretty nice language and if you need to do anything related to concurrency, it's probably the best fit. For example, I recently wrote an app that would handle a request, and executed heavier background tasks in a java executor pool using just 20 lines of clojure in compojure.
- deleted 18y ago[deleted]
- sanswork 18y agoI don't think it is fair to compare loc on an application that needs to support the needs of many thousands of individuals with an application that needs to support 1. The more users of something like wordpress that you have the more edge cases you find. I can write a blog in 1200 lines of PHP but I don't think I could convince myself it has anywhere near the features, considerations or polish that something like wordpress will have. As for the cloud plugin I haven't looked at it but it appears as though the boilerplate is just a way to add an easy method for customization something his lacks. So we end up with less code but less features and more difficult to get up, keep up or customize. I fail to see how this is a point for Clojure.
- jrockway 18y agoWordpress doesn't have polish. It has some HTML that looks nice, but doesn't perform well and is completely unmaintainable. FWIW, I am also writing a real replacement for Wordpress: http://blog.jrock.us/articles/Ernst,%20Angerwhale,%20the%20Future%20of%20Perl%20Web%20Frameworks,%20and%20Deleted%20Email.pod http://blog.jrock.us/articles/Ernst,%20Angerwhale,%20the%20F... (that article also rambles on and on and on about unrelated things).
- sanswork 18y agoWordpress has a lot of features that most people overlook when implementing their own blog platforms. I'm not saying it is a great system to develop with but it handles a lot more use cases than most systems I see people comparing it with. People regularly compare things like the Rails demo blog with wordpress as an example of why PHP/wordpress is bad. It could certainly be better but it's understandable as to why it's not pretty under the hood. Trying to be everything for everyone usually results in ugly systems.
- jawngee 18y agoIf wordpress is unmaintainable then why do they keep releasing new versions of it? How come so many people use it? And you're writing it in Perl? Sounds maintainable!
- jrockway 18y agoSome people like hacking things, making them work, and then leaving it even more broken for the next person. I don't, which is why I can't work on Wordpress. Every time you change the code, it should be cleaner than it was before, especially if the code is a project that you expect other people to be able to easily start working on. As to your other point, nice troll.
- jawngee 18y agoBut other people work on Wordpress all of the time. The sheer number of plugins, themes, etc. all testify to that. And if it's so broken, then why do so many people deploy it day after day? Can you cite specific examples of where it is broken? Or why don't you say what you really mean: Because it's written in PHP it must be junk. And, seriously, who is trolling who? You posted how broken it was, and that you're building something new and better, but don't provide any examples of how Wordpress is broken exactly. I can have Wordpress installed and working in under 15 minutes. I'm not sure how that is broken.
- jrockway 18y agoClojure is definitely better than PHP, but this article does not show that. The two code snippets compare two different things -- the Lisp calculates the tag cloud, while the PHP declares some configuration options for the UI. How could comparing those two completely different problems tell you anything?
- emilis_info 18y agoWordpress is the best example of spaghetti code I've ever seen. You can compare any code you write yourself to it and you'll find your code better. Last year I gave a conference talk at our local PHP web developer conference analyzing technical details of WP, Joomla and Drupal. I found WP a piece of spaghetti, Joomla a bloatware and Drupal somewhat cleaner than the other two and with some interesting ideas. However if you look at the UI, you have to admit that WordPress really shines there. I haven't yet used anything that easy to publish a blog. Taking all this into consideration I think the article title is greatly misleading. It really should be "Compojure 1, Wordpress 0". And the value of reading that article for me was zero.
- midnightmonster 18y agoWordpress code is amazingly awful, but Wordpress is also a general-purpose blogging/publishing platform meant to be installed anywhere, be extended by plugins and themes, and serve the needs of many, many people. If you write your own blogging platform that does just what you need without worrying about drop-in installation, plugins, themes, or anyone else, and you don't end up with a "pretty nice reduction in code", you're in sad, sad shape.
- jrockway 18y agoIt is easy to allow plugins, themes, and easy installation without resorting to Wordpress' horrible architecture.
- midnightmonster 18y agoNo kidding. My point was that the line count difference is probably not principally a matter of Wordpress being terrible or PHP being inferior to Clojure, but mainly of having a radically simpler feature set.
- jrockway 18y agoYes, definitely. Now that I think about it, your point is especially relevant in light of the examples the article chooses.
- pilif 18y agoI especially didn't like the rant about the "horrible boilerplate array declarations at the top of the Wordpress plugin". That array looks like it provides some declarative information to the backend on how to display the configuration UI. So the 226 lines of PHP code plugin does incredibly much more than his ~25 lines of code: It has runtime configuration settings and it provides a HTML UI to set said configuration options. All that in addition to the actual functionality. I would even go as far as to say that rebuilding all the Wordpress functionality in Clojure would not take significantly more or less lines of code than what WP already has. Or in other words: If I only need a small defined subset of Wordpresses functionality and if I have the time to actually write a blogging engine from scratch, then it will always have significantly fewer lines of code than WP - regardless of language. Once I add features, the line count will increase - regardless of language. This article is comparing apples to oranges: It's comparing a small, custom-built solution to a configurable out-of-the-box solution designed to satisfy the needs of the whole blogging community. Of course that's more complex. But it spares you the procedure the author later describes as "When I find a bug, I SSH in, re-attach to screen, fix it in Emacs, hit C-c C-c to recompile just the functions I need to update, and then detach from screen again.".
- jonknee 18y agoRegarding a glaring XSS vulnerability in the comments, Wordpress 1, Clojure 0.
- TweedHeads 18y agoTrying to give clojure some expojure starting a flame war? Nice try...
- jrockway 18y agoI've noticed something really interesting about articles that criticize Java or PHP. The comments defending Java or PHP are always attacks, they are never technical arguments. (This is a perfect example. It's clear that the parent is a PHP fan, but can't think of any technical grounds to argue on.) This is really sad -- if you like something, you should know why. You should also like things for reasons other than "it's the only thing I know". (As for Java, I wrote an article about things I don't like about Java on my blog, and all of the comments were either "I agree" or literally, "U are the dumbest person in the world." Maybe, but at least I can spell "you".)