5 ms·
I think it was Bjarne Stroustrup who said something like - "don't be clever, be simple and obvious". ... still nice article... ;)
by cominous 9y ago
I think it was Bjarne Stroustrup who said something like - "don't be clever, be simple and obvious".
... still nice article... ;)
- k__ 9y agoWas he trying to be funny after he did c++?!
- krylon 9y agoIt is possible to write simple and obvious code in C++. A lot of people just choose not to. ;-)
- camus2 9y ago> It is possible to write simple and obvious code in C++. A lot of people just choose not to. ;-) You still need to be C++ fluent enough to be able to read other people's code. And it's not like everybody has the same definition of "simple and obvious".
- coldtea 9y ago>And it's not like everybody has the same definition of "simple and obvious". No, but it's like we can expect of people to more or less agree on a definition of "simple and obvious" or else be outliers.
- krylon 9y ago> And it's not like everybody has the same definition of "simple and obvious". That is a very good point. I had an interesting discussion with a Perl programmer once regarding the use of Perl's default variable $_ - to him, code that relied heavily on it was straightforward and readable. But to a newcomer, it can be very tricky to figure out what is going on. And even to an experienced Perl programmer, it can increase the mental overhead of parsing code significantly if s/he is not used to it.
- dvddgld 9y agoTrue, though languages should be designed so that it is difficult to write obscure, tricky or otherwise unreadable code.
- krylon 9y agoFor better or worse, languages that put am emphasis on readable code tend to remain not-so-popular. Python is an example, but Ada or Pascal are relatively unpopular these days. But that is one thing I like about Go, because "idiomatic" Go code tends to be very straightforward and readable.
- dvddgld 9y agoI mean C++ isn't going to disappear anytime too soon, but I like where we're headed with language design. Python isn't just popular, it's monumentally popular, and I think that's a great sign. In my eyes, Ada and Pascal aren't missed, precisely because there are better choices for new projects. I love what they've done with Go from my experience with it so far, they hit the target on a number of design fronts.
- darthlord382 9y agoToo bad he didn’t follow his own advise in design of C++ (at least the simple and obvious part)
- deleted 9y ago[deleted]
- edejong 9y agoThe competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humility, and among other things he avoids clever tricks like the plague. Dijkstra (1972) The Humble Programmer (EWD340).