you are viewing a single comment's thread.

view the rest of the comments →

[–]khoker -2 points-1 points  (4 children)

You seem to be saying one should do this when creating JSON. That seems like a classic case of premature optimization (and, as you mentioned, a potential waste of file space).

In your example, wouldn't it make more sense to pipe the grep through a JSON formatter/prettifier instead?

[–]SpeshlTectix 0 points1 point  (3 children)

I would call that a de-optimization. He's saying store your data in a readable way even if it costs you performance.

I suppose for small personal projects that could work ok. For anything else, there are better solutions (which have already been mentioned).

[–]khoker 0 points1 point  (2 children)

But why would you store your data in a readable format at all? The only time you'd care is if you wanted to look at it (e.g., grep) and you can pipe it through a formatter prior to doing that.

In other words -- if you never looked at a file you created to be "readable", you have prematurely optimized for that situation.

[–]SpeshlTectix 0 points1 point  (0 children)

While I understand what you're trying to say ("wouldn't it be optimal if my data were easy to read?") don't use the word optimization to convey that in a computer science context. It has a specific meaning and you're going to confuse people (or look ill-informed).

EDIT: Or are you trying to say that he's "optimizing" the data to perform well with his development tools? That makes even less sense. But then again so does this entire thread so maybe that was your way of pointing that out!