A few notes on choosing between Go and D for a quick project
Chris via Digitalmars-d
digitalmars-d at puremagic.com
Fri Mar 13 05:36:14 PDT 2015
On Friday, 13 March 2015 at 00:20:40 UTC, Andrei Alexandrescu
> A friend of mine needed to complete a small project and thought
> of using a language he didn't know for it. He already knew I
> work on D so he considered it alongside Go. He ended up
> choosing the latter, and documented his decision making process
> in a few notes that he subsequently shared with me. I'll paste
> below a sort of transcript of his handwritten notes.
> I think this is valuable information from a relatively unbiased
> potential user, and good ideas and action items on how we can
> improve our curb appeal. Even mistaken perceptions are good
> signal - it means our materials weren't explicit enough to
> dispel them.
> * Golang: simple!
> + very small language, very concise & simple
D is also simple, if you want to do simple things. You can keep
things simple, if you want. But it allows you to do complicated
things whenever the occasion arises, yet it doesn't enforce
"difficult" or "complicated" code. This is a point I have made
several times and it is probably not made clear enough on the D
When I advise people to use D, they think they have to learn
programming all over again and opt for Python or C only to
program a f***ing number grinding for-loop. When they have to
implement arrays, it's good-bye to C and hello to Python,
although D would give them Python's convenience with C's
We do something wrong here. The perception is D = "you have to be
a programming Einstein". Not true. You don't have to, but it
allows you to be one.
> + playground/tutorial
Maybe a simple VAT calculator instead of "Computes average line
length for standard input" on the start page? Some everyday task
like find string in string? Would be better, I think. How do I
find "ab" in "abc". std.string? std.regex? std.algorithm? These
things are not clear at all, but this is what users usually need
first. They don't need templates, they need "startsWith" kinda
> + easy to start using it, no-nonsense
Same goes for D. But we have failed to communicate this to people.
> + vast libraries
Yep. D is not great for this, unless you know the community and
> + no inheritance
From C? C++?
> + one binary to distribute
This goes for D as well.
> + good for servers
Doable with D (vibe.d), but not part and parcel of the language,
> + feels like a better C (mostly)
> - can't write generic code involving arrays/slices
> - no good IDE
> + Google!
Well, what can I say?
> + clear feeling it's here to stay
> + visible, many projects
I agree, D is invisible. Everyone who's using D professionally
should make it public.
> + enforced style (indentation, exports)
D is about freedom. No enforced style please. We already have
> * Dlang: big!
> # big language
> # IDE?
> # small subset?
> # libraries?
> # will it be around?
> # Perception matters
> ## how stable is it?
> ## not great for servers or UIs; what then?
> ## new house in unpopulated neighborhood; there's an "Enter,
> it's open" sign but sits emtpy; by comparison Go -> condo in
> hip, trendy area
> * Ideas for D
> # what C++ should be but cannot
> ## too late for C++, but not for D
> ## some or all of @safe, immutable, pure should be the default
> # libraries, projects should be prominently listed and nurtured
> # single-idea advantage; D seems to embody too many ideas at
> ## concurrency?
> ## networking?
> ## generics?
> ## interoperability with C and C++?
> ## focus on one!
> # must attract/hook casual users
> # unclear what's a good IDE - JetBrains? is there Vim support?
> # what's D's equivalent to frameworks such as react.js?
> # language designers think of features, users think of purpose
> ## react, go, rust, java -> purpose
> ## D, C++ -> "Ivy league candidates" having a response for
> every programming language design challenge there is, but less
> focused on purpose (Andrei's note: I assume D more at fault
> than C++ on this)
> General feeling: "I don't feel smart enough for D and am
> looking for a quick way to accomplish a goal. I've read the
> Wikipedia article on D and didn't understand a few things. The
> examples seem to show off the language but that made them
> confusing. I wanted to get more into it, but by that time Go
> had already won - I looked at the tutorials, changed the sample
> code a bit right in the browser to see how it'd work for me, it
> was easy, I was in already. Some of my comments therefore
> illustrate my shortcomings than the language's, but that's true
> one way or another for all programmers (that's why technical
> superiority of a language doesn't guarantee its success)."
I appreciate his honesty. Sometimes I don't feel smart enough to
use D either, or Python or C. There's always something that
escapes me, something I could have done better. I don't think
that D has to become simpler, we just have to point out that it
can be very simple _and_ safe. (Plus benchmarking)
And we have to reach out to the real world, i.e. GUI, web
technologies, mobile platforms. Without these things, D will
always be considered as "nice, but I can't really use it". This
is why every new language builds up an infrastructure first. I
used to say that D didn't need an IDE and toolchains and all the
bells and whistles. It doesn't. But people do, because they have
to get their work done. Maybe we have lived in an ivory tower for
too long. D deserves better. D should be out there.
> I'd love us to derive a few action items from this and other
More information about the Digitalmars-d