Live data from Hacker News

TOML, Tom's Own Markup Language

github.com

161–170 of 173 posts

Re: TOML, Tom's Own Markup Language

#161

Earlier quoted context omitted.

If doing: #define BEGIN { #define END } were such a bad idea, then why is it so easy?

Maybe the language is poorly designed.

Or maybe the connection between being able to do something and it being a good idea to do something is just in your head.

Re: TOML, Tom's Own Markup Language

#162

Earlier quoted context omitted.

Maybe the language is poorly designed.

Or maybe the connection between being able to do something and it being a good idea to do something is just in your head.

In my experience, making obviously bad things difficult or impossible improves reliability. This idea certainly resides within my cranial cavity, but that doesn't necessarily make it wrong.

Re: TOML, Tom's Own Markup Language

#163

Earlier quoted context omitted.

Or maybe the connection between being able to do something and it being a good idea to do something is just in your head.

In my experience, making obviously bad things difficult or impossible improves reliability. This idea certainly resides within my cranial cavity, but that doesn't necessarily make it wrong.

How could:

  HashMap = HashTable = Map = Table = Dictionary = Hash
possibly not qualify as "obviously bad"? The only reason you've offered up is because it is easy...

Re: TOML, Tom's Own Markup Language

#164

Earlier quoted context omitted.

In my experience, making obviously bad things difficult or impossible improves reliability. This idea certainly resides within my cranial cavity, but that doesn't necessarily make it wrong.

How could: HashMap = HashTable = Map = Table = Dictionary = Hash possibly not qualify as "obviously bad"? The only reason you've offered up is because it is easy...

I think this is fine. The obviously bad part is being able to remove/change constants, especially as these changes are global.

Re: TOML, Tom's Own Markup Language

#165

About the use of mark up language as config file. I see that in most Python apps, the config file is just another Python script and not using another markup language. This way makes sence in a dynamic language and it feels natural. I understand it is a habit to use yaml in Ruby apps for config. Is it not possible to just use Ruby script as config file since the script can be loaded dynamically? What are the pros and…

Dynamic config files are wrong for the same reason you don't want logic in your HTML templates.

Re: TOML, Tom's Own Markup Language

#167

Earlier quoted context omitted.

How could: HashMap = HashTable = Map = Table = Dictionary = Hash possibly not qualify as "obviously bad"? The only reason you've offered up is because it is easy...

I think this is fine. The obviously bad part is being able to remove/change constants, especially as these changes are global.

The obviously bad part is that you pollute the global namespace for no reason other than laziness. When someone comes across code that uses a "Table" object interchangeably with "Dictionary" and "Hash", then he's going to have to look through the source code to find this bizarre line only to find out that you renamed a built-in container for no good reason.

Re: TOML, Tom's Own Markup Language

#168

Earlier quoted context omitted.

I think this is fine. The obviously bad part is being able to remove/change constants, especially as these changes are global.

The obviously bad part is that you pollute the global namespace for no reason other than laziness. When someone comes across code that uses a "Table" object interchangeably with "Dictionary" and "Hash", then he's going to have to look through the source code to find this bizarre line only to find out that you renamed a built-in container for no good reason.

Yes, I suppose that's also true.

Re: TOML, Tom's Own Markup Language

#169
post #89

Earlier quoted context omitted.

Sadly "map" is also the name of the critical "map" function which operates on lists. Maybe with an indefinite article ("a map") it's clear enough.

Sure, so go the Lua route: table. Or the python route: dictionary. If neither of those do it for you, how about "mapping"? Hash (and hash map, hash table etc) leak too much implementation detail. What if you want a tree-based mapping instead? I like how in C++ it's map (for ordered, rb-tree based maps) and unordered_map (for unordered, hash table based maps).

I'm going to try out "mapping" -- good suggestion.

Re: TOML, Tom's Own Markup Language

#170
post #148

Earlier quoted context omitted.

Why? I dislike those comments.

Text editors will sometimes insert end-of-line characters in the name of word-wrap. Using the end-of-line as a comment terminator would require significant refactoring of JSON parsers, which were previously at liberty to lump CR and LF together with SP and TAB. A starting and ending token, on the other hand, fits the pattern already required of a JSON parser.

> Text editors will sometimes insert end-of-line characters in the name of word-wrap.

In this decade, only a brain damaged text editor would do that.

Post reply on HN