3 ms·
C++ says "no" to readability. Everything that has been added to C to create C++ was added in order to help out the person writing new code. Nothing that was a
by smcameron 10y ago
C++ says "no" to readability. Everything that has been added to C to create C++ was added in order to help out the person writing new code. Nothing that was added to C to make C++ is there to help the person trying to read the code. Though I doubt it was deliberate, much of what makes C++ different than C seems actively hostile to the person trying to read the code.
- jordigh 10y agoYou really find auto x = new int[64]; harder to read than int* x = malloc(sizeof(int)*64); ? If so, I think it's just a matter of habituation and imprinting. Whatever you learned first is easier and everything else is hard.
- smitherfield 10y agoBoth C and C++ have readability issues. ((void(*)())exec)(); or template <typename T> struct value_type { typedef typename T::value_type type; }; template <typename T> struct value_type<T*> { typedef T type; }; Six of one, half a dozen of the other.
- emmelaich 10y agoI think there's a gap that could be filled by making a nice front-end to C++ with nicer simpler (even Pythonic) syntax. Drop the semi-colons, convert "dict of int to string' to map<int, std:string> etc. It would be ok if it only did a subset of C++ at first.
- dmytrish 10y agoSounds like http://nim-lang.org/ http://nim-lang.org/ . Just simplifying syntax is not a great idea for a system programming language though.