Worst ideas/features in programming languages?

Antonio antonio at abrevia.net
Fri Oct 15 09:47:48 UTC 2021


On Monday, 11 October 2021 at 15:59:10 UTC, Atila Neves wrote:
> I'm brainstorming about what I'll talk about at DConf, and 
> during a conversation with Walter I thought it might be cool to 
> talk about:
>
> * Worst features implemented in a non-toy language
> * Worst features (in your opinion) in D
> * Features you'd like to see in D
>
> Ideas? Examples?
>
> Thanks!

About Wrong D features:


In my opinion, **D is afraid of embracing decisions with all it's 
consequences**... it maintains itself in a position where nothing 
is "the best for niche X"

**i.e.:** UFCS has not been really embraced with all it's 
consequences

D doesn't allow this
```d
"hello".(s){
   s.writeln;
}
```
Of course, you can introduce a template like ```auto doWith(alias 
f,T)(T v)=>f(v)``` or use the "pipe!" template:
```d
"hello".doWith!((s){
   s.writeln;
})
```

But then yo find you can't do this
```d
void x(string s){
   s.writeln;
}
"hello".x;
```

**i.e.:** The "Nullable" allien!!!

D has a complete functional library based on ranges

But then, you find an alien named "Nullable" that is not the 
equivalent to Optional/Some/None and has not the range 
capabilities (map, fold, ...).

How difficult will be to embrace the Optional/Some/None pattern 
in phobos?

D needs to assume it's responsibility standardizing this kind of 
decisions giving a solid base to other "high level" libraries 
like database ones (i.e.: managing nullable fields in a 
"functional" way using the Optional pattern).

**i.e.:** GC/Not GC.

I really don't want to enter here, but I'm unhappy with this kind 
of discussions and I find myself driven to use other languages 
where they have made that decision clearly:   Nim has GC (you can 
select the GC strategy), Rust has not GC.

**i.e.:** **Official "high level" libraries for common uses** 
(i.e.: Database libraries)

1 week ago I "returned" to D after some months... I need to 
perform a simple database task (with postgres) and I found that 
dpq2 was the most "recommended" one (Dlang site itself).  It has 
vibe-d dependency (nice!!! may be it's based on fibers!!!)

The library didn't compile (it references an old vive-d version 
with deprecated code)... I created an issue on github with the 
problem and maintainer didn't recognize the problem (initially).  
  Finally I modified manually the library and tried to run the 
example proposed in "examples" folder but DMD couldn't compile 
because some strange missing things on system libraries with my 
Ubuntu...

I have not mentioned that for checking it, I first created an 
small webserver using **the example you can find in D home 
page**... surprise!!! it didn't compile neither because 
references the same vive-d deprecated version (after updating the 
version, all worked enought).

It was enough for me.  May be next year :-)  (and it will be my 
N-D try).


More information about the Digitalmars-d mailing list