🎉 Cyber Monday Sale! Today only, you can join the Lean Web Club for just $9/month. Try it free for 30 days, then get 50% off for the next year. I've been making a ton of updates to the Lean Web Club over the last few weeks. Last night, I was adding an interactive code sandbox the section on My (former) favorite JavaScript methodThere was a time when the You could use it like Let's imagine you have an array of
You want to create an array that contains only the names of You can do that with
But… that's kind of weird and confusing and hard to read, right? It takes a bit of mental processing to figure out what's happening. Readability is better than being cleverIf I were completing that task today, I would use
Yes, it's a second step. Yes, it's marginally slower (but not in a way that a user would ever perceive). But it's also one line shorter and much easier to read and understand. Each function tells you exactly what it's doing. There's less mental gymnastics to unravel. At the end of the day, a human has to maintain the code you write. I'm still not all-in on big libraries, but I do think code that can be read and maintained is more important than hyper-optimizations. Cheers, Want to share this with others or read it later? View it in a browser. |
0 Komentar untuk "[Go Make Things] Code readbility"