It's possibly a bad sign if - Any of the functions in the app can not be described in a single sentence. - There is looping, not that looping is necessarily bad. - The same construct is used over and over. See for example *A Design Exercise <https://forums.dyalog.com/viewtopic.php?f=30&t=1683> *(Dyalog APL Chat Forum post). - The same construct is _not_ used when you expect it to be used. See the link in the previous item. - You go back to look at your code a day/week/month later and you can not explain it to your own satisfaction. - Ravel (monadic ,) is used on a non-scalar. , destroys structure and that structure was there for a reason. - Reshape (dyadic $) is used on a right argument with rank >1. Again, reorders structure.
On Thu, Aug 20, 2020 at 3:24 AM ethiejiesa via Programming < [email protected]> wrote: > What are some classes of code smell in J? > > For clarity, "code smell" means any characteristic of source code that > indicates a potentially deeper problem. These are anti-patterns that occur > at > the source code level. > > The canonical example is probably duplicated code, which indicates a > potential > for abstraction or merging of the repeated code. In C-like languages, > deeply > nested if statements are typically considered smelly, suggesting a > potential > need for better data structures, separation of mixed concerns, etc. In > haskell > "boolean blindness" is another. > > When writing tacit verbs, I find that trying to avoid ("), ([) or (]), and > parentheses as much as possible often helps me find better solutions. > That's > what prompted this question. > > Anyway, what are similar code anti-patterns in J (or APL) that have helped > you > write better J by recognizing and avoiding them? > > > Cheers! > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
