Why Strings as Classes?

superdan super at dan.org
Wed Aug 27 09:51:42 PDT 2008


Simen Kjaeraas Wrote:

> Michiel Helvensteijn <nomail at please.com> wrote:
> 
> > a[i] looks much nicer than a.nth(i).
> 
> To me, this is one of the most important points here. I want a
> language that seems to make sense, more than I want a language
> that is by default very fast. When I write a short example
> program, I want to write a[i] not a.getElementAtPosition(i).

sure. you do so with arrays. i think you confuse "optimized-fast" with "complexity-fast".

> D is known as a language that does the safe thing by default,
> and you have to jump through some hoops to do the fast, unsafe
> thing. I will claim that a[i] is the default, as it is what
> we're used to, and looks better. a.nth(i),
> a.getElementAtPosition(i) and whatever other ways one might
> come up with, is jumping through hoops.

guess i missed the lesson teachin' array indexing was unsafe. you are looking at them wrong tradeoffs. it's not about slow and safe vs. fast and unsafe. safety's nothin' to do with all this. you're lookin' at bad design vs. good design of algos and data structs.



More information about the Digitalmars-d mailing list