DEV Community

The Art of Clean Code: Mastering the Betty Style 🧑🏾‍💻

Angel Oduro-Temeng Twumasi on July 16, 2023

Introduction When it comes to developing software in any programming language, adhering to a consistent coding style is crucial for main...
Collapse
 
pauljlucas profile image
Paul J. Lucas

The style for documenting code should be the de facto standard of Doxygen.

Collapse
 
angelotheman profile image
Angel Oduro-Temeng Twumasi

I see that. I just read and it has some interesting notes in there. But I still believe, Betty has the best of both worlds.

Code styling and documenting

Collapse
 
pauljlucas profile image
Paul J. Lucas

For formatting, clang-format is the de factor standard.

Thread Thread
 
angelotheman profile image
Angel Oduro-Temeng Twumasi

Interesting one. I gave a resource in the write-up, you can check it out.

Collapse
 
mxglt profile image
Maxime Guilbert

Always useful to share the noble art of clean code. By sharing this kind of standards we are sure that anyone can read any code.

Collapse
 
angelotheman profile image
Angel Oduro-Temeng Twumasi

Yeah Maxime. Clean code should be advocated. If you want to be a good programmer, be good at writing clean codes.

This makes code interpretation easy and hence working on the code doesn't become tedious

Collapse
 
darthjade-i profile image
Solomon Ovie Okomowho

This is fantastic!!!! can I share this article on my page?

Collapse
 
angelotheman profile image
Angel Oduro-Temeng Twumasi

Under condition that you attribute the authorship to me. You can share the knowledge.

Also reach out to me on my socials let's discuss if you want me to write for your agency

Collapse
 
jeff_barnes_3afd3fb0c5f9f profile image
Jeff Barnes

The 'use of braces' section is wrong. It should only have start brace on the next line for functions, not statements.

Collapse
 
angelotheman profile image
Angel Oduro-Temeng Twumasi • Edited

I love that you comment on this post. However, I would plead you get your facts right.

You can go to the links I shared read about it. This article is C programming and the Betty coding style.

Collapse
 
jeff_barnes_3afd3fb0c5f9f profile image
Jeff Barnes

This article claims this conforms to the Linux Kernel code guidelines. I was just pointing out that it doesn't.

Thread Thread
 
angelotheman profile image
Angel Oduro-Temeng Twumasi

In what ways does it not? Remember that this is Betty Coding Style

Collapse
 
daveasiamah profile image
David Asiamah

I think most of the rules regarding formatting can be handled by a linter.

Collapse
 
angelotheman profile image
Angel Oduro-Temeng Twumasi

The Linter is also a great one. However I think Betty has an edge as it not only check the formatting, but it checks the docs as well.

In fact, Aunty Betty makes you adhere to strict coding protocols 😀

Collapse
 
beanalby profile image
Jason Viers

Functions must contain 40 lines of code

Functions must FIT IN 40 lines. So they have to be less than 40, not greater than 40. Confused the heck out of me at first.

Collapse
 
angelotheman profile image
Angel Oduro-Temeng Twumasi

Error corrected. Thank you for pointing that out 😊