3 ms·
Is that in order of importance? I'd put readability above everything else. Compact code is nice but I'd rather have self-documenting code, even if it means seve
by MichaelApproved 12y ago
Is that in order of importance? I'd put readability above everything else. Compact code is nice but I'd rather have self-documenting code, even if it means several more lines of code added to the functions.
- mhomde 12y agoIts hard to put a clear hierarchy of importance since it's a rather fine balance. As you say going for maximum compactness makes it much less understandable (Regex anyone?). That's also why i used the term entropy rather than compactness. It's not primarily the number of characters we're optimizing for but code as information dense and devoid of redundancies as possible. I actually think you should be verbose to the point of building a DSL-like syntax for your solution to improve readability. Even for instance addint small properties and methods that simplifies reading. It's much easier to read if (CanWrite && WillFitDisk) than if (File.Position != File.EOF && Disk.AvailableSpace > Buffer.Size) Even if reusability of those small methods and properties aren't high So I see it as "compact" as possible as long as you fulfill understandability and maintainability.