enum behaivor. another rehash of the topic
bearophile
bearophileHUGS at lycos.com
Sun Dec 15 03:27:50 PST 2013
monarch_dodra:
> I've been in enough large scale C++ projects to enjoy D's
> verbose approach. Sure, C++ is convenient and works 99% of the
> time. But all you need is for some retard to create a Global
> enum containing things like the words "Yes, No, True, False,
> Red, Black, White", and then he's ruined it for *everyone* on
> the project.
By the way, I am not criticizing "D verbose approach". I have
criticized the weak typing:
enum Foo { good, bad }
void main() {
int x = Foo.good; // Weak typing.
}
And some people have criticized the verbosity in special
situations, like this:
enum Foo { good, bad }
void bar(Foo f) {}
void main() {
// bar(bad); // Not enough
bar(Foo.bad);
}
Bye,
bearophile
More information about the Digitalmars-d
mailing list