Markdown: Why are there numerous implementations of the "Markdown" markup language?
I was recently looking for a personal wiki and come upon Hatta, which uses Markdown simplify to editing and generate html. My question is why are there some many implementations of Markdown in Python, 开发者_如何学PythonJavascript, PHP, etc. when an official Perl implementation already exists? Is there some benefit to having this choice?
One point is that it's easier to rewrite than attempt to integrate a Perl script with whatever other language happens to be in use for development.
Another point is that John Gruber hasn't updated the original implementation in over five years, and quite a few people want something or other that isn't present in the original, so they add it themselves, often re-implementing it in the process.
Another point is that no matter how hard people push reuse of software, quite a few people have at least a little NIH attitude hidden somewhere, so they re-implement things unnecessarily. That's not entirely bad either -- it can help understanding, as well as lead to cleaner implementations over time (I have to say that -- I'm more guilty than most of writing my own instead of reusing what's already available).
People often start by writing something mostly for understanding -- but in the case of markdown, the specification is sufficiently simple that it's often hard to tell the difference between something written as an exercise for the author's own use, and code that's really suitable for production (a lot of web developers also lack the experience to know the difference, at least very well).
Because not everyone runs perl?
You may as well ask why there are cars and buses when you can use your feet to get places.
There are way too many implementations of Markdown for the same reason there are way too many implementations of the Scheme programming language:
It looks like a quick, fun project.
Markdown looks really good, but there's just one, little, tiny improvement I want to make...
The problem of converting readable ASCII to typeset documents or HTML has been around a long time. The first instance I know if is notech
, by Richard J. Lipton and Robert Sedgewick, in a 1990 technical report called "Typesetting Without Formatting". If anybody has a copy of that report, I would love to have one...
My favorite reimplementation of Markdown is pandoc, which interconverts a whole boatload of formats.
There's many reasons, blowdart mentioned the availability one, and I'm going to mention the one that makes me always reinvent the wheel: fun
Some people find it fun to write something all by themselves, either for fun or to improve their programming skills in that particular language or in general.
I've written IRC bots in about 8 different programming languages, and it helped me transfer old skills to new languages and carry back new skills to previous languages!
There aren't many things people have NOT copied for fun or because they just WANTED to do it, or because they weren't happy with the original implementation or idea.
There's clones of Pidgin, of OpenOffice, of entire Linux distributions and other operating systems just because people felt like doing it.
There's multiple implementations of programming languages like Ruby, Python, C, C++, Haskell, Basic and Javascript because people wanted to integrate them with Java (JRuby, Jython) or .NET (IronRuby, IronPython) or plainly wanted to write their own compilers and interpreters for learning.
Programming isn't just all business and "make it if it's not already made", it's a hobby for many people.
And I'm sure as hell gonna write my own Markdown implementation some time soon!
精彩评论