Programming thread

  • 🇵🇦 Nuestro primer dominio localizado está en español en kiwifarms.pa. Our first localized domain is on Spanish on kiwifarms.pa.
  • Want to keep track of this thread?
    Accounts can bookmark posts, watch threads for updates, and jump back to where you stopped reading.
    Create account
It's all fun and games until somebody has a different delimiter than a comma like those shitheads in europe.
There's also the big question about how you quote the delimiter, with one school saying you enclose the entire field in doublequotes (God help you if the field also contains a literal doublequote, because you now have the issue of whether to allow Pascal-style quoting or C-style quoting or maybe both), another school saying you enclose the entire field in singlequotes, another school saying doublequotes and singlequotes are both good as long as the opening and closing delimiters match, and the other school saying you escape it with a backslash.

The best way is to probably just use the old /etc/passwd format, where fields are separated by colons (or whatever you like), and literal separators or backslashes are quoted by preceding them with a backslash, since that's at least simple and consistent.
 
There's also the big question about how you quote the delimiter, with one school saying you enclose the entire field in doublequotes (God help you if the field also contains a literal doublequote, because you now have the issue of whether to allow Pascal-style quoting or C-style quoting or maybe both), another school saying you enclose the entire field in singlequotes, another school saying doublequotes and singlequotes are both good as long as the opening and closing delimiters match, and the other school saying you escape it with a backslash.
I'm personally fond of how APL does it, a less common style:
Código:
  'test''ing'
test'ing
  'look at that '''
look at that '
  ''''
'
I prefer to think about it as the concatenation of two strings joined by the delimiter. This is one subtle way in which APL is even nicer than Common Lisp, as it avoids the reverse solidus for escaping, such an arbitrary character to use for this. It's a shame this style is so rare.
 
Atrás
Top Abajo