Other notes

bearophile bearophileHUGS at lycos.com
Sun Nov 25 06:12:03 PST 2007


Thank to everyone for the answers and comments.

BCS:

>leave that to some sort of "Lint for D"

I agree that certain things are better left to a lint (because for example a static analysis of the code can be quite slow and complex, so it may make the compiler too much slow and complex. And some of those things may make its command line too much hairy, and some of those things may be a bit controversial), but there are other things better left to the compiler (optional integral overflow cheeks, warnings issued for unused variables/classes/functions, optional accurate pointer/reference cheeks. I think all three of them are quite important, and the first two are commonly found in other languages too (like Delphi and C#)).


>I only use real. On most, if not all, systems it's just as fast as double (OK it needs more IO time but...) so why not use it?<

Maybe to help the port of D to different not-Intel CPUs, but I am not expert about this.

-------------------

Moritz Warning:

>Features may also mean generalisation that elemitates complexity.<

You are right.
(The following note is a bit unrelated) But I have seen languages like Scheme where most things are very general, you can combine them in every way; the net result is that people write quite unreadable programs because such people find really twisted ways to nest and mix those things (think of the Y combinator). Python on the other hand offer some general tools, but such tools aren't too much general, so they must be used for a certain class of purposes, so the resulting code is readable, beucause you can't nest things too much and you can't combine them in totally novel ways every 5 lines of code. There is a balance between a language too much tailored and one where you can do everything, both extremes are bad (too much flexible or too little flexible, you may also say). Scheme (and maybe Haskell), Cobol, Fortran (and maybe the first versions of Pascal) are near one corner or the other, while Python (and maybe D) seems closer to the the middle. (But note that some programming fields and some programmer minds are more fit for a more flexible or for a less flexible language, so no language is fit for everything and everyone).


>Well.. I guess it's hard to spot for the compiler that there could be an error.<

I see, this specific thing may be better left to a lint program.

-------------------

David B. Held:

>I use the iteration variable as a temporary sometimes.  I would be annoyed if the compiler tried to 'detect' that for me.<

I see, it may be too much difficult to spot such things. Another thing for a lint, then.

Bye,
bearophile



More information about the Digitalmars-d mailing list