sorting associative array's keys by values
Jonathan M Davis
jmdavisProg at gmx.com
Sun Jun 17 04:11:07 PDT 2012
On Sunday, June 17, 2012 13:07:24 maarten van damme wrote:
> well, the page I parse is automatically generated and thus allways
> contains </html>.
That may be true, but if your code assumes that </html> is there and it ever
isn't for any reason, then you're going to get a RangeError thrown in non-
release and undefined behavior in -release. It's generally a bad idea to assume
that something is correct like that when you have zero control over it within
your program, even if it's almost certainly correct. Something could go wrong,
and it's better to throw an exception or do some other sort of error handling
than it is to get an Error, or worse, undefined behavior.
- Jonathan M Davis
More information about the Digitalmars-d-learn
mailing list