[Issue 13670] bug in assigning to dynamic array element

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Nov 1 21:04:21 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=13670

--- Comment #4 from Ketmar Dark <ketmar at ketmar.no-ip.org> ---
(In reply to Jonathan M Davis from comment #3)
> (In reply to Ketmar Dark from comment #2)
> > so i don't have to
> > track if my variable is dynamic or static array manually.
> 
> In general, I'd be very worried about code that didn't care about whether it
> was dealing with a dynamic array or a static array, because they're
> fundamentally different types.
so why so many efforts were spent to make dynamic arrays looks like static
arrays? if they are "fundamentally different types", they shouldn't look the
same. there must be another different operation for them with different syntax,
different declaration syntax and so on. and compiler *must* at least warn me
that it's so stupid that it can't make the simple code works as any sane person
expected it to work.

and i still can't understand why i should manually track if my variable is of
static array type or of dynamic array type. and i'm still sure that this code
should never asserts, it's nonsense:

  info.list[idx] = saveIt(info, count-1);
  assert(info.list[idx] != 0);

it's insane. it's counterintuitive. it's beyoud any logic. language that
asserts here for built-in type is a toy language which shouldn't be used even
for simple throw-away scripts. i can never explain to anyone why built-in type
have to work like this. bwah! i can't even explain this to myself. this is
ridiculous.

D smells. with all that "let's keep our legacy 'cause Random Reddit User will
go insane despite the actual users are begging for fix that", "let's not bless
dfix for another year", etc.

another hobbyst project that wastes years of my time. my bad, i have to
recognize that hobbyst smell from the beginning and not hoping for the best.
i'm glad that i was unsuccessfull pushing our development department towards D.
they were right, there is no sense to learn another quirky language that has so
little libraries when we already have quirky C++ with alot of libraries.

so be it.

--


More information about the Digitalmars-d-bugs mailing list