What Makes A Programming Language Good

bearophile bearophileHUGS at lycos.com
Tue Jan 18 03:27:56 PST 2011


Vladimir Panteleev:

> Forcing a code repository is bad.

In this case I was not suggesting to force things :-) But having a place to find reliable modules is very good.


> This is not practical.

It works in Python, Ruby and often in Perl too, so I don't agree.


> I assume you mean naming conventions and not actual code style (indentation etc.)

I meant that D code written by different people is better looking similar, where possible. C/C++ programmers have too much freedom where freedom is not necessary. Reducing some of such useless freedom helps improve the code ecosystem.


> - Probably D the package system needs to be improved. Some Java people  
> are even talking about introducing means to create superpackages. Some  
> module system theory from ML-like languages may help here.

> Why?

- Currently D packages are not working well yet, there are bug reports on this.
- Something higher level than packages is useful when you build very large systems.
- Module system theory from ML-like languages shows many years old ideas that otherwise will need to be painfully re-invented half-broken by D language developers. Sometimes wasting three days reading saves you some years of pain.


> I don't think this is practical until someone writes a D interpreter.

CTFE interpter is already there :-)


> How would DMD become even more IDE-friendly that it already is?

- error messages that give column number
- folding annotations?
- less usage of string mixins and more on delegates and normal D code
- More introspection
- etc


> I have to agree that named arguments are awesome, they make the code much more readable and maintainable in many instances.<

I haven not already written an enhancement request on this because until few weeks ago I have thought that named arguments improve the usage of functions with many arguments, so they may encourage D programmers to create more functions like this from Windows API:

HWND CreateWindow( LPCTSTR lpClassName, LPCTSTR lpWindowName,DWORD style,int x, int y, int width, int height, HWND hWndParent,HMENU hMenu,HANDLE hInstance,LPVOID lpParam);

but lately I have understood that this is not the whole truth, named arguments are useful even when your functions have just 3 arguments. They make code more readable in both little script-like programs, and help avoid some mistakes in larger programs too.

Bye,
bearophile


More information about the Digitalmars-d mailing list