Re: Opinions about the "Oneliners"
- To: mathgroup at smc.vnet.net
- Subject: [mg40317] Re: Opinions about the "Oneliners"
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Tue, 1 Apr 2003 04:50:57 -0500 (EST)
- Organization: Universitaet Leipzig
- References: <b690h1$l7u$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
- Sender: owner-wri-mathgroup at wolfram.com
Hi, > > But to be honest: Isn't it a torture trying to understand the "how does it > work" of a oneliner written by some else? If it was hard to program, it should be hard to understand ... > > Is it useful to use //TreeForm to visualize the inner structure of a > oneliner (where is the "inner beginning") No, it is useful to split up the nested function calls an to see what every step does. > > The vast majority of oneliners presented here lack on comments. A one-liner with comments is longer than one line and is not a one-liner any more. > Despite of > the wonderful constructs, is this good programming style? hmm "Real Programmers don't need comments-- the code is obvious." it is stil an open task to rewrite http://www.pbm.com/~lindahl/real.programmers.html for Mathematica programmers. It is a question of you personal style, how many comments you need to understand the code in 2-3 years. In the most cases the authors have no idea "how skilled is the questioner". If the questioner does not understand the answer, he can ask again or he can try to understand the solution by its own and learn a lot ... If you look on the threads with one-liners, it is seldom, that the questioner ask back for an explanation. In the most cases the regulars in the group start a discussion "how can the code be optimized" or "which one-liner is the faster". So, it seems, that there is a little need for larger comments. Regards Jens