DEV Community

Discussion on: Mutation is ok

Collapse
 
nosknut profile image
nosknut • Edited

Generally i choose whatever code is more readable. Readabillity over performance is generally a good rule. Unless you get a meaningful performance drop that actually impacts the application, or alredy when making it know that the code will be executed constantly many times a second, readabillity is king in my book. Generally i prefer the code i dont need to understand. If the method signature is enough, i prefer not looking too much into the implementation. If the implementation is nice clean english such as users.filter, i won't have to give the rest a detailed read to feel comfortable using or changing it. You should understand the code enough that you arent putting gibberish into your codebase of course, however the best code is the one you can understand without reading it.