Compiler as dll
dsimcha
dsimcha at yahoo.com
Thu Jan 29 20:09:40 PST 2009
== Quote from Bill Baxter (wbaxter at gmail.com)'s article
> One thing, though, that I noticed using Python, is that a lot of what
> is considered so easy-to-use about dynamic languages is just that
> people are more willing to use expensive (but elegant) abstractions.
> If you're willing to do things in a slightly less efficient way, you
> can make the code look pretty darn elegant. I think this is the basis
> of much of Bearophile's libs. Most of the time you really don't need
> that extra performance. With a dynamic language there's no way to
> really get the performance, anyway, so you might as well use something
> elegant. People seem to have a harder time throwing away their
> desire for efficiency when they know their language *is* capable of
> being efficient. I'm certainly included in that group. I would have
> a hard time convincing myself to code in D similar to how I code in
> Python. It just feels so sloppy to me when it's in D, because I know
> D can do better. But in truth, most of the code I write would
> probably perform fine even with large helpings of extra slop.
> --bb
I feel the exact same way, but I thought I was just crazy. I don't use Python on
a regular basis because most of the code I write has at least enough parts that
have to be fast that it makes more sense to just write the whole thing in D. When
I did use it a few times out of curiosity, I was like wow, some of this stuff is
so much more elegant than the way I would do this in D. Then I thought for a
little while longer and was like, "wait a minute, I _could_ do it that way in D,
it's just that I never would because when I'm in D coding mode I'm so used to
thinking about efficiency." Now, when I'm coding a part of a D program where
performance isn't going to matter, like a function that gets run once at startup,
I actively try to force myself _not_ to think about efficiency and to just keep it
simple and elegant.
More information about the Digitalmars-d
mailing list