Reddit: why aren't people using D?
Knud Soerensen
4tuu4k002 at sneakemail.com
Thu Jul 23 05:53:14 PDT 2009
Walter Bright wrote:
> http://www.reddit.com/r/programming/comments/93jh5/ask_proggit_the_d_programming_language_looks/
>
Let me start with an example.
Some time ago I need a script to get and process some data.
I trough why not use D, but I couldn't find a function in the standard
library which would get a simple web page with http.
Instead of find and downloading other libraries I switched to peal and
had it running in no time.
I think it is the choice of problem domain for D.
Successful language are typical the first moves in a new and popular
problem domain.
FORTRAN - vector processing.
PHP - server side web programing.
Java - platform independent client side programing.
etc.
If you want people to switch you need provide the tools for solving this
problems.
To get the Fortran crowd D needs faster vector processing.
To get the PHP crowd D needs libraries that support web programming.
To get the java crowd, it should be possible to run platform independent
D programs in you browser.
etc.
I know the real focus for D system programing and the C++ people.
I think one of D's strongest points for people to make the switch is
build in unit testing. (at least this is the strongest point for me)
But the very simple implementation of unit testing in D nearly ruin the
advantage it gives. (see suggestion from the wishlist below)
C++ have a lot of good libraries to solve all type of problems,
for me it wouldn't be a problem if I knew that the D libraries would be
a much better quality.
A indicator for this would be if I knew that the library was properly
unit tested.
A simple way to ensure that could if the compiler issued a error/warning
if a function had no unit tests or contracts.
What follows is some unit test suggestions from
http://all-technology.com/eigenpolls/dwishlist
Because I would like to hear your opinion about them.
** unit test & code separation
I think it would be more useful if the code
and the unit test where two separate binaries.
Sometimes you need to move the production binary to another
machine/environment.
It would be nice if one could move the test binary with it and test that
everything works.
It would also allow for arguments to the test binary,
so that you would be able to run a specific unit test.
** black box unit testing
The d compiler should enforce black box unit tests.
Which is unit tests that only use the classes exposed interface.(public,
protected)
Together with 100% unit test coverage it helps ensure that
the code is modular,decoupled and that you can change
the private parts without changing the unit tests.
For those how is not ready for this high code standard,
there might be a --allow-white-box switch.
** Unit test isolation
I would like to be able to isolate the unit test,
so that if one fail the next still runs.
unittest()
{
test("test1")
{
assert(...);
assert(...)
}
test("test1")
{
assert(...);
assert(...)
}
for (i=3;i<10;i++)
{
test("test"~i)
{
assert(...);
assert(...)
}
}
}
** Unit test measurements
In combination with test isolation
it would be nice to have d output
memory and time used in each unit test.
--
Join me on
CrowdNews http://crowdnews.eu/users/addGuide/42/
Facebook http://www.facebook.com/profile.php?id=1198821880
Linkedin http://www.linkedin.com/pub/0/117/a54
Mandala http://www.mandala.dk/view-profile.php4?profileID=7660
More information about the Digitalmars-d
mailing list