3 ms·
Understandability is more important than conciseness in a team environment. In a team, you're not writing code for you - you're writing code to be reviewed by
by Arainach 9y ago
Understandability is more important than conciseness in a team environment. In a team, you're not writing code for you - you're writing code to be reviewed by other people, integrated with other people's code, and maintained by other people in the future.
In the example from this article, all developers I've ever worked with would understand what the "good old C" example is doing within seconds. Most would understand the Python example. Most of them still working in the industry today would be able to figure out what the functional python code was doing without much excessive effort - it would take them longer, which is bad, but if they were working in it every day I'm willing to believe that they'd parse simple examples like that readily enough.
None of them would understand APL. J is even worse. I stared at the J code for a full minute without any comprehension of the language syntax or what was being accomplished. That code isn't readable or maintainable. It is bad code.
- mikebenfield 9y ago> J is even worse. I stared at the J code for a full minute without any comprehension of the language syntax or what was being accomplished. That code isn't readable or maintainable. It is bad code. But why does code need to be readable to someone who doesn't know the language? Yes, it's true that Python and some other languages are pretty readable even to people who haven't written any of that language, and that is a nice feature in many contexts... nevertheless, if I'm hiring a Python programmer, I'm either going to hire someone with experience in Python, or I'm going to accept that they're not going to hit the ground running and be massively productive right out of the gate... so how is it really such a loss to write in J and accept that non-J programmers won't understand my code?
- drdrey 9y agoTo avoid silos?
- Arainach 9y agoReadable code decreases ramp-up time, both in a language and in a codebase. I've never written a line of Java in my life, but if you dropped me in a Java codebase I could start understanding the structure immediately and contributing to it very quickly. If you dropped me in a J codebase I'm not convinced that would ever be the case. Writing terse readable code is great. Writing code that is so terse that it doesn't have variable names is an antipattern.
- kortex 9y agoLook at the top 7 languages used in industry: C/++/#, Java, JS, Python, and VB.NET. They all more or less follow "C-like syntax". In fact compare APL or J to any of the Tiobe 20, and you'll see they are wildly different in look and feel. https://www.tiobe.com/tiobe-index// https://www.tiobe.com/tiobe-index//
- mikebenfield 9y agoWell, I'm definitely aware of what mainstream programming langauges look like. But I think the popularity of a language is only loosely related to its technical attributes.
- agumonkey 9y agoForget it. It's a different culture, it's void to try to understand this without leaving your previous point of view. And for the laughs, I've been taught java first, and read a lots of C code, and I had a very bad understanding of what was going on. APL or similar don't cause that confusion. Actually, after years of FP, I now get C a lot more. To quite Hickey, it's not easy but it's simple. There's a set of primitives and operations, a clear system. It fits some peoples brain. For others, imperative state machine are just what they like.