Apache resigns from the Java Community Process executive committee
Posted Dec 16, 2010 4:39 UTC (Thu) by
cmccabe (guest, #60281)
In reply to:
Apache resigns from the Java Community Process executive committee by HelloWorld
Parent article:
Apache resigns from the Java Community Process executive committee
Just so people don't think I only criticize C++, here are some subtle errors in C code:
> char buf[80];
> fgets(user_str, sizeof(buf), stdin);
> printf(user_str);
> extern int *my_array;
> /* "zero the array" */
> memset(my_array, 0, sizeof(my_array));
Anyway, to reiterate. C++ was never designed to be safer than C. Every time the designers of C++ had to choose between execution speed and safety, they chose execution speed. C++ is almost like a rapid application development kit for C.
The problem is, when you select execution speed and short development time as your two highest priorities, readability and code quality suffer. For a lot of applications (for example, the Linux kernel), that's simply not acceptable. C++ is still appropriate for many applications. For example, the computer games industry loves C++, despite all the new languages that have come out in the last few years.
> What kind of "fancy syntax" for composition do you have in mind?
At a minimum, C++ should offer something like Ruby does: the ability to create accessors for elements by adding a quick attribute in the variable declaration. For example:
> class Foo {
> int bar : attr_reader
> int baz : attr_reader, attr_writer
> }
>
> cout << my_foo.bar() << endl; // look ma, no boilerplate!
Personally, I'm going to explore Google Go a little bit more. It doesn't even have the concept of inheritance. Go just has "specifications" that say what methods a type must provide to meet the specification. Any type that has such methods can be used. Sort of like duck typing, but enforced at compile time and safe! And there is no "static type" vs. "dynamic type" misery, and no base classes teleporting random variables into the middle of your code.
(
Log in to post comments)