A few notes on choosing between Go and D for a quick project

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Wed Mar 18 16:41:12 PDT 2015


On 3/18/2015 5:45 AM, CraigDillabaugh wrote:
> You said that "Unfortunately" this thinking is going out of style "for good
> reasons".   I am confused (sorry, I am at work, and didn't have time to watch
> the 1+ hour video you linked to - maybe some clues were there)!

Consider this C code:

#include <stdbool.h>
#include <stdio.h>

typedef long T;
bool find(T *array, size_t dim, T t) {
  int i;
  for (i = 0; i <= dim; i++);
  {
     int v = array[i];
     if (v == t)
         return true;
  }
}

There are several bugs in it. I've showed this to probably over 1000 
programmers, and nobody found all the bugs in it (they are obvious once pointed 
out). It is not easy to write bug free loop code, and find() is a trivial function.


More information about the Digitalmars-d mailing list