tags:

views:

170

answers:

4

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, Javascript, PHP, etc. when an official Perl implementation already exists? Is there some benefit to having this choice?

+9  A: 

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.

blowdart
Sorry if this is a stupid question but this still isn't obvious to me. When I type in some text in my wiki, which is implemented in PHP, couldn't the text be saved onto a file and disk and preprocessed with the perl markdown? Maybe that's just not how things work and my question makes no sense. To me installing perl doesn't seem like a big deal.
wp123
It isn't installing perl that's the big deal, it's getting it to work with PHP, or Python, or whatever. It's usually easier to keep to one language.
Paul Tomblin
So rather than have it implemented in place you want to have a spawned process, which costs processing time and install another language which opens up potential attack vectors? Oh and take a dependency on another language and that sometime outside of your control never changes? That's not a good combination at all. Then of course you're assuming that all software can save to disk and call perl, which is simply not the case.
blowdart
Ok those are all things that I didn't think about. I just saw it as recoding the wheel and some of the implementations don't match the specifications, etc. It seemed like more hassle than it is worth but now I see there are some benefits especially when used outside the context of a personal wiki. Thanks.
wp123
+5  A: 

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!

LukeN
If I shared half your enthusiasm I think I would be a much better programmer. Thanks for your input.
wp123
+2  A: 

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).

Jerry Coffin
+4  A: 

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.

Norman Ramsey
Thanks for the link.
Camilo Martin