Splitter quiz / survey

"Jérôme M. Berger" jeberger at free.fr
Mon Apr 27 11:34:28 PDT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Daniel Keep wrote:
|
| Andrei Alexandrescu wrote:
|> ...
|>
|> We might just go with the terminator semantics and ask people who
need
|> separator semantics to use a stripl() or a munch() prior to
splitting.
|> I'd personally prefer having an enum there.
|>
|>
|> Andrei
|
| I'm going to invoke the principle of least surprise here; 6 out of 7
| respondents said it should be #4.  The dissenter voted #1.  No one
| thought it would be the behaviour as actually implemented. [1]
|
	Funny thing is, I answered before looking at the responses and
without knowing what the current behaviour was. IMO, #1 is the worst
solution because even if you know how many fields you expect, there
is no way to know which are empty. All three other solutions allow
you to find out.

	I vote #2 before #3 because in my experience, you never want to
drop the first few empty fields but you sometimes want to ignore the
trailing ones.

	Ideally, I'd say #4 (principle of least surprise) with an option to
choose #2 (probably the most useful IMO) or #1.

		Jerome

PS: I've never used Perl and I agree that it should die, but I still
vote #2 over #1...
- --
mailto:jeberger at free.fr
http://jeberger.free.fr
Jabber: jeberger at jabber.fr
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkn1+rMACgkQd0kWM4JG3k8UuwCePGgWCm5teSloTePVPQVruDJn
03QAni1hWgdXPQetVNNJHlpizpKSYz13
=yGRf
-----END PGP SIGNATURE-----



More information about the Digitalmars-d mailing list