Hacker News new | ask | show | jobs
by dansingerman 2931 days ago
I know I'm very likely to be in a minority here, but I hate both Haml and Markdown.

I much prefer HTML and erb.

5 comments

I think Markdown is great for what it is, a simple way to mark up text with some simple html, in a way that's still easily readable as plain text. I dislike most extensions to markdown, since the point, for me, is simple use cases only.

Haml is almost the complete opposite IMO, since reading a document formatted with Haml does not result in elegant plain text, and it's not designed specifically for simple use cases.

This mixture of the two really irks me, as a result.

I also preferred the clarity of unambiguous plain code.

Then I found slim. It eliminates most of the markup, reducing it to its humanly readable essence, producing clean well-formed html.

Writing, and more importantly, reading only the meaningful part of the markup has helped my productivity skyrocket.

My eyes don’t have to struggle to figure out the document structure.

http://slim-lang.com/

Slim seemed extremely similar to Haml to me — the primary difference IIRC is that Haml uses more sigils (probably due to influence from Ruby). They both have that quality of basically reducing your document to a minimal syntax tree.
Seems pretty similar to pug/jade, other than not needing parentheses for tag attributes? (which admittedly, has annoyed me in pug) If I had to go to Ruby-land, I would use slim...
Looking at both and their timelines, I’d think pug may be based on slim which is a great thing.

Slim has been around for years, steadily improving and addressing corner cases.

I absolutely love it. Reduces typing by 50%, reading by 1000+%(as I re-read the code multiple times and it eliminates the multiple takes and looking for closing tags) and matches how my human brain thinks about markup.

Slim v0.1: Sep 15, 2010

Pug (actually Jade at the time) v0.1: Jul 5, 2010

I'm thinking these are "convergent evolution", especially since they arose in different language communities.

I totally agree that this is the best way to generate HTML. I use pug even for really tiny pages and templates. It amazes me that people like JSX, which seems like a total regression from building elements with function calls like React originally had. When I code Cycle.js in coffeescript it looks and feels a lot like pug; which is great.

I've used slim too. I have the same opinion of it as Haml.
I can understand that.

For me, typing full html is no longer an option. Even with emmet I’d have to read it, multiple times, with all the markup syntax poking my eyes.

You're not alone. I hate non-HTML languages for generating HTML. It's a perfectly fine syntax.
Try turning it over to non-technical people. You will be surprised at how non-intuitive html can be, and what extremely nasty things they will do when they decide to learn just a little bit, ie style attribute hacking galore. If you want dead simple, consistently styled content to be written by non-technical folks, Markdown is much better IMHO.
This is something that can change with a bit of training.

All the "plain text" formatting languages tend to break down. They work until they don't and then somebody invents yet another text-based pseudo-markup language. Asciidoc is best of the worst but fundamentally it's a bad idea. If you're willing to make the investment in tools and training there's a lot of value in enabling people to write real HTML (and MathML) or, better, Docbook + domain-relevant XML that produces real UI-agnostic structured information.

The problem here is that the tools are terrible or expensive or bloated. There's no reason why this should be the case and it's likely a real market opportunity.

>If you want dead simple, consistently styled content to be written by non-technical folks, Markdown is much better IMHO.

The spec for Markdown's syntax includes HTML in its entirety, though...

Oh, markdown is great. I meant the things that are just different syntax for HTML.
Agreed! If I need to debug it in chrome inspector (or similar) I don't like to have to think in terms of the abstraction I'm using to get the result I want.

Web development is complex enough (server side, js, css) without adding an abstraction layer to your markup too.

I prefer to code in bits.

The problem with HTML is it’s verbose. So folks like to save some keystrokes (and mistakes).

With SGML it's not an either-or. You can have both angle bracket markup syntax with HTML empty element rules, tag inference, and other short forms, as well custom Wiki syntax at the same time.

For example, you can say in SGML that the character '-' at the begin of a line when appearing below a particular parent element should start a line item, using a SGML shortref map/use declaration.

Blends particularly well with markdown eg. where in regular markdown you can use literal HTML, in markown+SGML you can make use of full SGML.

I'll save some people some typing and just post the next few comments in this conversation here:

> I prefer just vanilla javascript, css, and html. They work fine, no bloated frameworks!

> What do you do for templates?

> Oh you just pipe it through a really simple shell script I devised. It's just a few lines

> ಠ_ಠ