My two cents

bauss jj_1337 at live.dk
Wed Oct 25 18:54:16 UTC 2017


On Wednesday, 25 October 2017 at 16:07:21 UTC, ecstatic.coder 
wrote:
> On Tuesday, 24 October 2017 at 08:06:55 UTC, Atila Neves wrote:
>> [...]
>
> I agree. D MUST remain as simple as possible.
>
> For instance I'm against forcing D programmers to use 
> annotations which won't be implicit anymore.
>
> Keep D's syntax as simple and concise as it is now, don't make 
> it more complicated.
>
> And if you add synctactic sugar constructs to make it even more 
> concise, first make sure that this won't make D more 
> complicated to learn and to use...

Syntactic sugar is what makes a language easy to learn, because 
you don't have to memorize functions, their modules and whether 
you imported them or not, which modules imported which modules 
public, so you don't need to.

Ex. the example above you have to remember which module the 
function is stored, what the name of the function is and the 
exact arguments of it.

Now that may sound like "Oh it's not a big deal with such a 
thing", but it's still extra unnecessary work required to do 
something as simple as constructing a string.

You must remember to import the module too and you must also know 
which modules have the module imported as public import, because 
in those cases you don't need to import it. That's another extra 
thought you need to have, that must be repeated for every module.

I often tend to forget to important for format() and it's kinda 
tedious when you write multiple big modules and then forgot to do 
the correct imports and you have to go into all of them and fix 
it.

Of course you could just assume no modules have public imports 
and you won't need to worry about which modules import what, but 
that defeats the whole purpose of public imports in the specific 
modules too, which makes the module system seem complicate and 
kinda useless, compared to how "complicated" a simple syntactic 
sugar addition like string interpolation, which btw. pretty much 
is a feature in most modern languages these days.

String interpolation is a very handy feature to write bugless 
code, because it's much harder to end up writing errors in your 
code like Atila already showed in his example that was supposed 
to show why you shouldn't have the feature.


More information about the Digitalmars-d mailing list