7,416 karma · joined Oct 23, 2009 (17y ago) · 1,582 submissions
Email: charles@codemix.com
comment 13y ago · link · parent
comment 13y ago · link · parent
comment 13y ago · link · parent
A possible solution is to keep your business logic framework agnostic, and write thin wrappers to plug into the framework where required. In theory it should be possible to change frameworks without incurring a major rewrite. This is easier said than done of course.
comment 13y ago · link · parent
JSON.stringify(JSON.parse(foo))
Presumably you'd say that it should return a plain JSON object without comments, right? However, with the current implementation this will return a JSON document that is identical to the input, modulo whitespace. This makes it easy to write tools that can, for example, increment the version number in a nodejs package.json file programatically. Doing this in a world where comments exist becomes extremely awkward or at the very least annoying, because either you have to write your own JSON parser that preserves comments, or you have to simply discard the comments when you're writing the file.If you go with the first option, you'll inevitably run into a scenario where you have a document like this contrived example:
{
// this is the first ever version!
"version": "1.0.0"
}
And your tool goes off and increments the version number, so you end up with: {
// this is the first ever version!
"version": "2.0.0"
}
and now your comment is a lie.If you go with the second option, you destroy all comments whenever you write data back to the file, so they can be deemed temporary at best.
What benefit do you actually get from having comments in either scenario?
comment 13y ago · link · parent
comment 13y ago · link · parent
comment 13y ago · link · parent
[0] https://developer.mozilla.org/en-US/docs/Web/HTML/Element/if...
comment 13y ago · link · parent
comment 13y ago · link · parent
[0] http://raganwald.com/2013/01/03/function_and_method_decorato...
comment 13y ago · link · parent
<article itemscope itemtype="/article">
<h1 itemprop="title">My Title</h1>
<div class="related-thing" itemscope itemtype="/author" itemprop="author">
<h1>
<span itemprop="firstName">John</span>
<span itemprop="lastName">Smith</span>
</h1>
</div>
<aside class="incidental-unrelated-thing" itemscope itemtype="/sausage">
<span itemprop="type">Cumberland</span>
<span itemprop="ingredients">Mystery Meat</span>
</aside>
</article>
in the example above, we define an article that has a related author property, that author property is its own scope so has firstName and lastName properties of its own. We also define an unrelated itemscope (unrelated because it has no itemprop) that happens to be nested in the same element, so this would parse to: [
{
"type": "/article",
"properties": {
"title": ["My Title"],
"author": [{
"type": "/author",
"properties": {
"firstName": ["John"],
"lastName": ["Smith"]
}
}]
}
},
{
"type": "/sausage",
"properties": {
"type": ["Cumberland"],
"ingredients": ["Mystery Meat"]
}
}
]comment 13y ago · link · parent
Bustle.pageData.article.title
couldn't have been extracted from <article itemscope itemtype="/article">
<h1 itemprop="title">Why We Should Root for Lamar Odom</h1>
...
</article>comment 13y ago · link · parent
comment 13y ago · link · parent
comment 13y ago · link · parent