Hacker News new | ask | show | jobs
by andrei_says_ 2931 days ago
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/

3 comments

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.