const?? When and why? This is ugly!

Walter Bright newshound1 at digitalmars.com
Wed Mar 4 15:19:19 PST 2009


bearophile wrote:
> What I can tell you is that I now know both Python and
> D (I know Python more, but my experience of D is getting sufficient),
> and I am usually able to write correct programs in quite less time in
> Python. "correct programs" includes unit tests, debugging, global
> testing, etc too. It's not easy to tell when a program is "debugged
> enough", it's an art. To write a "correct" program in C I need even
> more time and sometimes at the end I am not sure yet the program is
> debugged enough (despite I know C for far more time than D).

This is definitely strongly related to experience. I find that over time 
coding in any language, I gradually write fewer and fewer bugs. I 
essentially learn how to avoid the ones peculiar to that particular 
language.

A lot of influence on D comes from trying to design out of existence 
particular bugs in C/C++ that cost me a lot of time and effort to track 
down. I tend to not make those errors anymore in my C/C++ code, but the 
taste is still bitter and the learning curve is long. Others shouldn't 
have to follow the same path.



More information about the Digitalmars-d mailing list