I am a Ruby on Rails developer, working on this technology from past 7 months. while working on Rails many times i encountered yaml
files.
As i encountered yaml(yet another mark-up language)
is used to store the static content that needed to load before the server starts( like in I18n
language translation ) and some are used as a switch to store 'boolean'
values.
Recently in some of SO questions i saw haml
used in rails, As far as i know both are mark-up languages. What is the difference between these two and what to prefer and not-to while using rails.
Please shed some light on this :)
They have nothing to do with each other.
HAML is a markup language for semi-structured documents. Its semantics are essentially equivalent to HTML, and its usage domain is the same. In addition, HAML is also a template language, it allows embedding of arbitrary code in a general-purpose programming language (typically Ruby), similar to ERb.
YAML is a data language. Its semantics are a bit higher-level than JSON (in fact, as of YAML 1.2, YAML is a proper superset of JSON, i.e. every JSON document is also a YAML 1.2 document) and somewhere below XML (as a pure data language, not a document markup language), but its usage domain is the same as both of those.
In short: HAML is a replacement for HTML (and ERb), YAML is a replacement for JSON and XML.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments