<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/50-coding-laws-that-would-make-you-a-decent-programmer--iet07bdfc" -->

---
title: 50 Coding Laws That Would Make You A Decent Programmer.
description: Learn 50 coding laws that can help you become a better programmer. These laws cover various aspects of coding such as avoiding comments, naming variables and...
canonical: https://daily.dev/posts/50-coding-laws-that-would-make-you-a-decent-programmer--iet07bdfc
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: 50 Coding Laws That Would Make You A Decent Programmer. | daily.dev
og:description: Learn 50 coding laws that can help you become a better programmer. These laws cover various aspects of coding such as avoiding comments, naming variables and...
og:url: https://daily.dev/posts/50-coding-laws-that-would-make-you-a-decent-programmer--iet07bdfc
og:image: https://api.daily.dev/og/posts/IET07bDFc.png
og:image:alt: 50 Coding Laws That Would Make You A Decent Programmer.
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# 50 Coding Laws That Would Make You A Decent Programmer.

**[Community Picks](https://daily.dev/sources/community)** · 22 min read · 1002 upvotes · 51 comments

## Summary

Learn 50 coding laws that can help you become a better programmer. These laws cover various aspects of coding such as avoiding comments, naming variables and functions, writing clean code, and following best practices.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://medium.com/@alexobidiegwu/50-laws-of-best-practices-in-python-6942c7cafd56>

## Community discussion

Top comments from developers on daily.dev.

**@arryuniox** · 53 upvotes

> I don't think that we should avoid comments. The main thing with bad comments is that when you update your code, you forget to update your comments, so I think the better suggestion would be to continuously update your comments as you update your code. This helps other people working with you to understand what you are working on as well as helps you remember what you are working on. A helpful reference I think would be similar to Javadocs which describes the action of the function as well as what the parameters it takes in are (typewise) as well as what they represent.

**@silverhorn** · 4 upvotes

> Great article, it was very useful for the beginners like me, thanks

**@augustomen** · 4 upvotes

> Many of these laws are obvious, but some of them are disagreeable - dangerous even (like avoiding comments? except Exception? using "is" instead of "=="? snake_case for class names?). This makes me question the seniority of the author.

**@chaacxib** · 3 upvotes

> Great article, easy to follow and I would say it covers 95% of the Jr struggles

**@ghost** · 2 upvotes

> I follow Fireship's philosophy about comments. Most of the time, you will not need comments to explain what code does, but rather, why the code is there.

## Similar posts on daily.dev

- [Don’t just attend KubeCon \+ CloudNativeCon, Merge Forward your experience\!](https://daily.dev/posts/don-t-just-attend-kubecon-cloudnativecon-merge-forward-your-experience--l0rpp73x8) · CNCF · 1 upvotes · 0 comments
- [Announcing H2 2026 KCDs](https://daily.dev/posts/announcing-h2-2026-kcds-m96goajm1) · CNCF · 1 upvotes · 0 comments
- [Two months of Open Community Groups](https://daily.dev/posts/two-months-of-open-community-groups-asf52zhbs) · CNCF · 0 upvotes · 0 comments

---

Tags: [#python](https://daily.dev/tags/python)

[View this post on daily.dev](https://daily.dev/posts/50-coding-laws-that-would-make-you-a-decent-programmer--iet07bdfc)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"50 Coding Laws That Would Make You A Decent Programmer.","url":"https://daily.dev/posts/50-coding-laws-that-would-make-you-a-decent-programmer--iet07bdfc","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/50-coding-laws-that-would-make-you-a-decent-programmer--iet07bdfc"},"datePublished":"2024-05-21T12:32:54.002Z","dateModified":"2024-05-21T12:33:08.939Z","description":"Learn 50 coding laws that can help you become a better programmer. These laws cover various aspects of coding such as avoiding comments, naming variables and...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/064615a41d231dfcfddac394e3811bda?_a=AQAEuiZ","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/064615a41d231dfcfddac394e3811bda?_a=AQAEuiZ","isAccessibleForFree":true,"articleSection":"Community Picks","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Community Picks","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1655817725/logos/community","url":"https://daily.dev/sources/community"},"commentCount":51,"discussionUrl":"https://daily.dev/posts/50-coding-laws-that-would-make-you-a-decent-programmer--iet07bdfc","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1002},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":51}],"keywords":"python","timeRequired":"PT22M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Community Picks","item":"https://daily.dev/sources/community"},{"@type":"ListItem","position":3,"name":"50 Coding Laws That Would Make You A Decent Programmer."}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/50-coding-laws-that-would-make-you-a-decent-programmer--iet07bdfc","comment":[{"@type":"Comment","text":"I don’t think that we should avoid comments. The main thing with bad comments is that when you update your code, you forget to update your comments, so I think the better suggestion would be to continuously update your comments as you update your code. This helps other people working with you to understand what you are working on as well as helps you remember what you are working on. A helpful reference I think would be similar to Javadocs which describes the action of the function as well as what the parameters it takes in are (typewise) as well as what they represent.","datePublished":"2024-05-22T20:55:35.937Z","url":"https://daily.dev/posts/IET07bDFc#c-NezhrXHNe","author":{"@type":"Person","name":"Jed Lin","url":"https://daily.dev/arryuniox","image":"https://avatars.githubusercontent.com/u/93277456?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":53}},{"@type":"Comment","text":"Great article, it was very useful for the beginners like me, thanks","datePublished":"2024-05-23T05:19:31.697Z","url":"https://daily.dev/posts/IET07bDFc#c-euQGls6IA","author":{"@type":"Person","name":"Silver Horn","url":"https://daily.dev/silverhorn","image":"https://avatars.githubusercontent.com/u/74889534?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":4}},{"@type":"Comment","text":"Many of these laws are obvious, but some of them are disagreeable - dangerous even (like avoiding comments? except Exception? using “is” instead of “==”? snake_case for class names?). This makes me question the seniority of the author.","datePublished":"2024-05-23T13:27:04.728Z","url":"https://daily.dev/posts/IET07bDFc#c-nBK700lez","author":{"@type":"Person","name":"Augusto Men","url":"https://daily.dev/augustomen","image":"https://media.daily.dev/image/upload/s--O0TOmw4y--/f_auto/v1715772965/public/noProfile"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":4}},{"@type":"Comment","text":"Great article, easy to follow and I would say it covers 95% of the Jr struggles","datePublished":"2024-05-23T02:44:47.466Z","url":"https://daily.dev/posts/IET07bDFc#c-7szbmzBLA","author":{"@type":"Person","name":"ChaacXib","url":"https://daily.dev/chaacxib","image":"https://media.daily.dev/image/upload/s--0x1ovIl4--/f_auto/v1715642651/avatars/avatar_L6eYXmPz5NfZZkjcZV4Ji"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":3}},{"@type":"Comment","text":"I follow Fireship’s philosophy about comments. Most of the time, you will not need comments to explain what code does, but rather, why the code is there.","datePublished":"2024-05-26T17:33:21.673Z","url":"https://daily.dev/posts/IET07bDFc#c-SJoc6wBTc","author":{"@type":"Person","name":"Deleted user","url":"https://daily.dev/ghost","image":"https://media.daily.dev/image/upload/s--hNIUzLiO--/f_auto/v1705327420/public/ghost_vlftth"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}}]}
```

