Ad/iklan :







Search.Pencarian Menu

Add text send email to rh3252705.adda@blogger.com or Click this (Text porn Will delete) | Tambah teks kirim email ke rh3252705.adda@blogger.com atau Klik ini (Teks porno akan dihapus)
Total post.pos : 13631+

[Go Make Things] JavaScript anti-pattern: ignoring code base style norms

Yesterday, I wrote about how self-documenting code (without any comments or a README) is an anti-pattern for a code base.

Today, I want to talk about another one: ignoring code base style norms.

A well-maintained code base should look like one person wrote it, even when it's been maintained by a team of people.

This isn't purely an aesthetic preference. Inconsistent norms around things like how you author functions, how you define variables, and how your structure code can lead to every developer just "doing their own thing." Over the life of a project, this is how you end up with spaghetti code.

There's no "right way" or "correct" set of norms around code base style, but I personally like to see a consistent set of practices around…

As an example, when I see most of a code base written using const for libraries and let for everything else, but one file contains a bunch of var declarations, I know that other file was written by someone else.

I also know they didn't adhere to the code base norms, which makes me a bit nervous about what else they've touched in the code base.

If you're creating a README for your project (and you should!), a code styleguide is a good thing to add to it.

I have a favor to ask. If you enjoyed this email, could you forward it to someone else who you think might also like it, or share a link to my newsletter on your favorite social media site?

Cheers,
Chris

Want to share this with others or read it later? View it in a browser.

Share :

Facebook Twitter Google+
0 Komentar untuk "[Go Make Things] JavaScript anti-pattern: ignoring code base style norms"

Back To Top