3 ms·
1. Because the semantics are quite different. See my other post. 2. It's still nice to separate the attributes from the content: <h1 title="hello"> "Foo"
by judofyr 11y ago
1. Because the semantics are quite different. See my other post.
2. It's still nice to separate the attributes from the content:
<h1 title="hello"> "Foo"
Why use a new syntax when everyone knows HTML/XML?
3. The lack of `var` in CoffeeScript is its worst feature ever IMO! Every time I write `someVariable = …` I'm terrified that I will accidentally overwrite a previous variable. Imba improves on JavaScript here and will correctly shadow multiple `var` in the same function.
- tracker1 11y agoPeople also know CSS query selectors... <label> <input:checkbox:checked#myCheckbox> <span> Some Text Might be nicer than actually spelling out the attributes and properties, if you're taking an already wrist friendly language and bolting on tags, then taking that a step farther would probably be a nice idea as well.
- judofyr 11y agoImba supports the syntax for IDs and classes: <label#foo.bar .baz=isBaz> "Label" compiles to: ti$('label','foo').flag('bar').flag('baz',this.isBaz()).setText("Label").end() where `flag` is a method which adds to the class list (unless the second argument is falsey).
- thom_nic 11y agoOk that is awesome.
- meowface 11y agoAfter reading more, I agree with you on 1 and 2. But for 3... so you never use languages like Ruby or Python? Variable assignment shadowing is always possible in those languages, yet for seasoned developers, it tends not to be a real issue.