Need advice about which tool to choose?Ask the StackShare community!
HAML vs Pug: What are the differences?
What is HAML? HTML Abstraction Markup Language - A Markup Haiku. Haml is a markup language that’s used to cleanly and simply describe the HTML of any web document, without the use of inline code. Haml functions as a replacement for inline page templating systems such as PHP, ERB, and ASP. However, Haml avoids the need for explicitly coding HTML into the template, because it is actually an abstract description of the HTML, with some code to generate dynamic content.
What is Pug? Robust, elegant, feature rich template engine for nodejs. This project was formerly known as "Jade." Pug is a high performance template engine heavily influenced by Haml and implemented with JavaScript for Node.js and browsers.
HAML can be classified as a tool in the "Languages" category, while Pug is grouped under "Templating Languages & Extensions".
"Clean and simple" is the top reason why over 66 developers like HAML, while over 118 developers mention "Elegant html" as the leading cause for choosing Pug.
HAML and Pug are both open source tools. It seems that Pug with 18.3K GitHub stars and 1.9K forks on GitHub has more adoption than HAML with 3.43K GitHub stars and 544 GitHub forks.
According to the StackShare community, Pug has a broader approval, being mentioned in 173 company stacks & 118 developers stacks; compared to HAML, which is listed in 113 company stacks and 40 developer stacks.
Pros of HAML
- Clean and simple68
- No html open/close tags49
- Easier to write than ERB39
- Forces clean and readable code36
- Simpler markup language34
- Open Source24
- HTML Templating16
- You'll love it if you like Haikus1
Pros of Pug
- Elegant html137
- Great with nodejs90
- Very short syntax59
- Open source58
- Structured with indentation54
- Free24
- Really similar to Slim (from Ruby fame)6
- It's not HAML6
- Gulp6
- Clean syntax5
- Readable code5
- Easy setup5
- Difficult For Front End Developers,learn backend5
- Disdain for angled brackets4
Sign up to add or upvote prosMake informed product decisions
Cons of HAML
- It's not Pug3