From mboxrd@z Thu Jan 1 00:00:00 1970 From: bakul@bitblocks.com (Bakul Shah) Date: Sat, 06 May 2017 12:50:49 -0700 Subject: [TUHS] Discuss of style and design of computer programs from a user stand point In-Reply-To: Your message of "Sun, 07 May 2017 04:43:33 +1000." References: <201705060202.v4622L1J013430@coolidge.cs.Dartmouth.EDU> <5a2d6cc957c2efcd968f35aa5557c7a0e309dd27@webmail.yaccman.com> <20170506091857.GE12539@yeono.kjorling.se> <20170506144011.GF28787@mcvoy.com> Message-ID: <20170506195049.8FBEA124AEA4@mail.bitblocks.com> On Sun, 07 May 2017 04:43:33 +1000 Dave Horsfall wrote: > > > I also made the point that "clever" sucks. At least most of the time. > > All "clever" means is "hard to understand". The brief joy one gets from > > clever code is stomped on by the frustration one gets from having to fix > > it. > Apropos the above, I do confess to writing "clever code" from time to time > (PERL is a beautiful language for such sins)... > > Of course, in the olden days it was the APL "one-liners" :-) On the other hand, you have to grok only one line of code instead reading pages of Java/C++ with surprises lurking everywhere :-) Since you need one line to do the work of many many lines of c++/Java code, you should expect to spend more time on that one line! The same is true with shell one liners as well. We don't (usually) consider constructs such as the following "clever" because we expect its reader to have a certain level of code literacy and context (or an ability to gain such). tr -cs A-Za-z '\n' | tr A-Z a-z | sort | uniq -c | sort -rn | sed ${1}q